R
Railway•9mo ago
bharadwaj

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
Percy
Percy•9mo ago
Project ID: c1f08a11-d87a-4728-ad7f-08846fb099c2
Brody
Brody•9mo ago
^
bharadwaj
bharadwaj•9mo ago
c1f08a11-d87a-4728-ad7f-08846fb099c2
Brody
Brody•9mo ago
have you changed the region your service is in to one that is closer to you or your database?
bharadwaj
bharadwaj•9mo ago
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
Brody
Brody•9mo ago
oh well pro isn't gonna help with code issues
bharadwaj
bharadwaj•9mo ago
will the deployment happen on 32 Core machine? I think the problem I am facing is because of low end infrastructure
Brody
Brody•9mo ago
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?
bharadwaj
bharadwaj•9mo ago
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
Brody
Brody•9mo ago
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
bharadwaj
bharadwaj•9mo ago
I understand the logic. But the same code is running very fast on my 16 core machine
Brody
Brody•9mo ago
unfortunately that does not rule out a code issue
bharadwaj
bharadwaj•9mo ago
sometimes I hit the peak of 7 vCPU usage
Brody
Brody•9mo ago
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?
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
I see this service using 6 vCPU, that means it must be in Pro workspace right? :/
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
this is in railway see the response time in 10.6 seconds 😦
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
same code run in another environment is taking only 1.1 seconds
josh
josh•9mo ago
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
Brody
Brody•9mo ago
you have yet to answer my question
bharadwaj
bharadwaj•9mo ago
absolutely, the database I am connecting to is AWS RDS yes, I have dragged it to the pro user
Brody
Brody•9mo ago
can you show a screenshot of the dashboard?
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
can you make sense of this Brody? I can share another screenshot
Brody
Brody•9mo ago
okay so lets focus on the latency issue josh brought up what region is your aws rds database in?
bharadwaj
bharadwaj•9mo ago
are we deployed in pro?
Brody
Brody•9mo ago
have you redeployed your service since draging the project over to the pro area? yes or no
bharadwaj
bharadwaj•9mo ago
yes I did multiply deploys and restarted too trying to find the region of the aws
Brody
Brody•9mo ago
then you are deployed with pro resources okay let me know when you find out
bharadwaj
bharadwaj•9mo ago
it's in Mumbai, India 😛
Brody
Brody•9mo ago
aws has regions there?
bharadwaj
bharadwaj•9mo ago
latency could be the issue you say?
Adam
Adam•9mo ago
200% Yes
bharadwaj
bharadwaj•9mo ago
haha yes, they are everywhere
Adam
Adam•9mo ago
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
bharadwaj
bharadwaj•9mo ago
wow, now that I think
Brody
Brody•9mo ago
i think india is closer to railway's Singapore region
Adam
Adam•9mo ago
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
bharadwaj
bharadwaj•9mo ago
the app deff can use it, as it's an api application written in Spring boot Yes!
Brody
Brody•9mo ago
in every service that accesses the rds database set a service variable RAILWAY_REGION to asia-southeast1
bharadwaj
bharadwaj•9mo ago
can I add this as shared variable?
Brody
Brody•9mo ago
nope people have had trouble with that
bharadwaj
bharadwaj•9mo ago
oh no then where do I add this variable, please help me
Brody
Brody•9mo ago
in the service variables
bharadwaj
bharadwaj•9mo ago
can I add it in Docker file? as an environment variable?
Adam
Adam•9mo ago
I believe it's not working as a shared variable atm. Users have reported this as an issue and the team is aware
Brody
Brody•9mo ago
service variables
No description
bharadwaj
bharadwaj•9mo ago
ah gotcha! Initializing and deploying now 😄
Brody
Brody•9mo ago
check the first log line for the build logs, does it say the correct region there?
bharadwaj
bharadwaj•9mo ago
nope says [us-west1]
Brody
Brody•9mo ago
looks like you may have done something wrong, can you please provide the same screenshot i sent you just now
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
show the variable please
bharadwaj
bharadwaj•9mo ago
sorry
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
and did you let it kick off another deployment?
bharadwaj
bharadwaj•9mo ago
yes, should I try redeploying?
Brody
Brody•9mo ago
sure
bharadwaj
bharadwaj•9mo ago
doing it now no luck :/ after redeploying too it's the same
Brody
Brody•9mo ago
show me?
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
these highly cropped screenshots aren't doing you any favors
bharadwaj
bharadwaj•9mo ago
haha my apologies
Brody
Brody•9mo ago
please resend the last two screenshots without cropping
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
that is still a cropped screenshot
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
bruh
bharadwaj
bharadwaj•9mo ago
the urls are gettign exposed so pls understand this screenshot doesn't work either is it?
josh
josh•9mo ago
looks like it's still going to us-west1
bharadwaj
bharadwaj•9mo ago
yes
Brody
Brody•9mo ago
is that project located in your pro section of the dashboard
bharadwaj
bharadwaj•9mo ago
No description
Brody
Brody•9mo ago
does the variable name or variable value have a space in it or something
bharadwaj
bharadwaj•9mo ago
are the projects in pro though?
Brody
Brody•9mo ago
ive already said yes
bharadwaj
bharadwaj•9mo ago
nope should I include like this [asia-southeast1]?
Brody
Brody•9mo ago
no
bharadwaj
bharadwaj•9mo ago
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
bharadwaj
bharadwaj•9mo ago
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 🙂
Brody
Brody•9mo ago
i forgot all about that
bharadwaj
bharadwaj•9mo ago
ah happens! signing up now
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
it's in ap south now!!
Brody
Brody•9mo ago
awsome!
bharadwaj
bharadwaj•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
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__!
Brody
Brody•9mo ago
now move your aws rds database to Singapore too, for an even faster rtt
bharadwaj
bharadwaj•9mo ago
absolutely! my god yes! 😄
Brody
Brody•9mo ago
and now you have a pro discord badge too
bharadwaj
bharadwaj•9mo ago
oh is it? where can I find it?
josh
josh•9mo ago
nice, great job
bharadwaj
bharadwaj•9mo ago
good spotting josh!
Brody
Brody•9mo ago
No description
bharadwaj
bharadwaj•9mo ago
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!
Brody
Brody•9mo ago
it makes you look cool
bharadwaj
bharadwaj•9mo ago
loving the railway app a lot, it's so easy to deploy
Brody
Brody•9mo ago
definitely
bharadwaj
bharadwaj•9mo ago
thank you all! can I mark this post as solved?
Brody
Brody•9mo ago
already marked as solved
bharadwaj
bharadwaj•9mo ago
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
Brody
Brody•9mo ago
have a good rest!