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