a year ago
Hello, my app is very slow after I switched to runtime v2. My app is Django <#846875565357006878>
44 Replies
After I made the change to runtime v2 the speed changed drastically, it only improved when I changed the region to us-west1 Oregon
a year ago
I can't change my django server to the us-west1 Oregon region again and this is causing a lot of slowness because I have a DB and a redis in this Oregon region and my django server in us-west2
a year ago
you would want to be using the private network to connect to the database to avoid any latency issues
a year ago
use the private network to connect to them
a year ago
If you're ever unsure of how to do something, reference the docs
a year ago
metal is the default for hobby now
a year ago
it's slow likely because you are not using the private network
a year ago
are you making a new database connection for every query?
a year ago
I'm sorry but that doesn't answer the question
I am not opening a new connection on every query, each connection is opened and held up to 600 seconds
a year ago
metal is the default for hobby now
Kinda related...
Our deployments our failing (I just opened a public help issue as well). Our railway.json config file points to a non-metal region and since we keep getting put onto a default metal region it causes a conflict and we cannot get a passing deployment. Yikes...
a year ago
if you're connecting to the database via the private network then any slowness you are seeing would be due to inefficient code
If I switch to the pro plan, will the amount I pay per month for my project increase, in addition to the change from $5 to $20?
a year ago
nope
a year ago
pro plan is not the solution here
It's because before when everyone was in the same region the speed was much higher
a year ago
the speed is still high as long as you connect via the private network
Is there any change in the monthly cost besides the monthly fee of $5 to $20?
Could the django server's region be affecting its speed? Maybe due to overload or distance?
a year ago
again, the speed decrease is likely because you are connecting to the database publicly
a year ago
no it has nothing to do with application performance
My variables in railway are like this: DATABASEURL="${{Postgres.DATABASEPRIVATEURL}}" RAILWAY="True" REDISURL="${{Redis.REDISPRIVATEURL}}"
a year ago
I don't know if you are using DATABASE_URL in code
import djdatabaseurl
DATABASE_URL = os.getenv("DATABASE_URL")
DATABASES = {
"default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600),
}a year ago
^^
I don't understand why it was fast before if there was no change in the code, just in the region and runtime
a year ago
going to mark this as solved because the railway side of things is sorted, what's left to do is write more efficient code so your application is no longer slow
a year ago
!s
Status changed to Solved brody • about 1 year ago