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