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