How does pro plan upgrade works for application? particularly Spring boot app...
Hi all, I find it difficult to understand how pro plan upgrade works. I upgraded my Spring boot app from hobby plan to pro, and the response times of the requests are still the same. It looks like the deployement did not happen on 32vCPU machine, someone please help me understand what am I missing please! Thank you so much! 😄
project id: c1f08a11-d87a-4728-ad7f-08846fb099c2
105 Replies
Project ID:
c1f08a11-d87a-4728-ad7f-08846fb099c2
^
c1f08a11-d87a-4728-ad7f-08846fb099c2
have you changed the region your service is in to one that is closer to you or your database?
From my home computer when I submit the request I am able to get a response in 3 seconds tops, whereas the railway app is taking 20 seconds 😦
using the same database for both home pc and railway app
oh well pro isn't gonna help with code issues
will the deployment happen on 32 Core machine?
I think the problem I am facing is because of low end infrastructure
if you moved your project over to the pro region of the dashboard and redeployed, yes
the hobby plan had 8gb of ram and 8 vcpu, where you maxing those resources out previously?
I was not maxing out the resources there, the cpu usage was low. but the requests serving are taking a lot of time on 1-2 vcPU
running apache tomcat, Java Spring Boot api application
then pro isn't gonna help you, that's like having a 10 amp charger and plugging in a phone that only takes 2 amps to charge, your phone will not charge any faster
the hobby and the pro plan both use the same cpu type, just the pro plan has more of them
if you weren't utilizing all the resources on the hobby plan, having more resources won't speed anything up
I understand the logic. But the same code is running very fast on my 16 core machine
unfortunately that does not rule out a code issue
sometimes I hit the peak of 7 vCPU usage
I'd recommend time logging different functions of your request to see what is taking 20 seconds
but have you dragged the project over to the pro region of the dashboard?
I see this service using 6 vCPU, that means it must be in Pro workspace right? :/
this is in railway see the response time in 10.6 seconds 😦
same code run in another environment is taking only 1.1 seconds
are you sure this isn't because of latency or a similar issue?
not to seem like an idiot, but always helpful to quickly check
you have yet to answer my question
absolutely, the database I am connecting to is AWS RDS
yes, I have dragged it to the pro user
can you show a screenshot of the dashboard?
can you make sense of this Brody? I can share another screenshot
okay so lets focus on the latency issue josh brought up
what region is your aws rds database in?
are we deployed in pro?
have you redeployed your service since draging the project over to the pro area? yes or no
yes
I did multiply deploys and restarted too
trying to find the region of the aws
then you are deployed with pro resources
okay let me know when you find out
it's in Mumbai, India 😛
aws has regions there?
latency could be the issue you say?
200%
Yes
haha yes, they are everywhere
Just hopping in to say yes, the latency between your service and your db is 100% the issue here. When running from your machine, I'm assuming you're relatively close to the db
wow, now that I think
i think india is closer to railway's Singapore region
Additionally, upgrading to 32VCPU will not affect latency, it will only use more CPU if your app needs it.
Agreed, but your db and your service should be in the same region no matter what
When developing you can handle some extra latency. Your app in production should have as little as possible
the app deff can use it, as it's an api application written in Spring boot
Yes!
in every service that accesses the rds database set a service variable
RAILWAY_REGION
to asia-southeast1
can I add this as shared variable?
nope
people have had trouble with that
oh no then where do I add this variable, please help me
in the service variables
can I add it in Docker file? as an environment variable?
I believe it's not working as a shared variable atm. Users have reported this as an issue and the team is aware
service variables
ah gotcha!
Initializing and deploying now 😄
check the first log line for the build logs, does it say the correct region there?
nope says [us-west1]
looks like you may have done something wrong, can you please provide the same screenshot i sent you just now
show the variable please
sorry
and did you let it kick off another deployment?
yes, should I try redeploying?
sure
doing it now
no luck :/
after redeploying too it's the same
show me?
these highly cropped screenshots aren't doing you any favors
haha my apologies
please resend the last two screenshots without cropping
that is still a cropped screenshot
bruh
the urls are gettign exposed so pls understand
this screenshot doesn't work either is it?
looks like it's still going to us-west1
yes
is that project located in your pro section of the dashboard
does the variable name or variable value have a space in it or something
are the projects in pro though?
ive already said yes
nope
should I include like this [asia-southeast1]?
no
or is there a hypen missing somewhere?
I can try testing with another region and check if it's working there
from what I see in docs railway seems to be only in one location of us-west
I see that I need to be in priority boarding to access these locations
let me try signing up for the beta access. I think that was the problem 🙂
i forgot all about that
ah happens! signing up now
it's in ap south now!!
awsome!
and the response times are at 2.77 seconds!!
that's awesome!
it's been very helpful @Brody great find by @joshmo_dev ! thank you @a_dumb__!
now move your aws rds database to Singapore too, for an even faster rtt
absolutely! my god yes! 😄
and now you have a pro discord badge too
oh is it? where can I find it?
nice, great job
good spotting josh!
ahh yess! haha I don't know what can I do with it though 😄
thank you for being patient and helping it through @Brody !
the multi region feature got released just last week! lucky me!
it makes you look cool
loving the railway app a lot, it's so easy to deploy
definitely
thank you all! can I mark this post as solved?
already marked as solved
haha Absolutely! I feel like I learnt a lot things new today already!
super! 😄
have a good rest of the day @Brody its 4 am in India an all nighter for me! XD
have a good rest!