2 years 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
2 years 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
2 years ago
you would want to be using the private network to connect to the database to avoid any latency issues
2 years ago
use the private network to connect to them
2 years ago
If you're ever unsure of how to do something, reference the docs
2 years ago
metal is the default for hobby now
2 years ago
it's slow likely because you are not using the private network
2 years ago
are you making a new database connection for every query?
2 years 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
2 years 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...
2 years 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?
2 years ago
nope
2 years ago
pro plan is not the solution here
It's because before when everyone was in the same region the speed was much higher
2 years 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?
2 years ago
again, the speed decrease is likely because you are connecting to the database publicly
2 years ago
no it has nothing to do with application performance
My variables in railway are like this: DATABASE_URL="${{Postgres.DATABASE_PRIVATE_URL}}"
RAILWAY="True"
REDIS_URL="${{Redis.REDIS_PRIVATE_URL}}"
2 years ago
I don't know if you are using DATABASE_URL in code
import dj_database_url
DATABASE_URL = os.getenv("DATABASE_URL")
DATABASES = {
"default": dj_database_url.config(default=DATABASE_URL, conn_max_age=600),
}2 years ago
^^
I don't understand why it was fast before if there was no change in the code, just in the region and runtime
2 years 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
2 years ago
!s
Status changed to Solved brody • over 1 year ago