Django app, slow server response

I am having django app, regular django templates. Database is on google cloud. This is railway response: https://i.imgur.com/E8E258d.png This is from localhost: https://i.imgur.com/vSFdilW.png both are hitting the same database, which takes 400ms.
Imgur
Imgur
Solution:
It doesnt have anything to do with the platform, every time this is a user code / config issue.
Jump to solution
11 Replies
Percy
Percy7mo ago
Project ID: bdca37b2-12cd-4a44-8091-d27170f251f1
webomania
webomaniaOP7mo ago
bdca37b2-12cd-4a44-8091-d27170f251f1
Brody
Brody7mo ago
what location do you have your database in?
webomania
webomaniaOP7mo ago
It's Toronto wait us-central1, that seems to be Iowa
Brody
Brody7mo ago
how are you having railway run your django app?
webomania
webomaniaOP7mo ago
Not sure I understand. It's using gunicorn, automatically deployed after git push.
Brody
Brody7mo ago
whats your start command
webomania
webomaniaOP7mo ago
web: gunicorn tomo.wsgi release: python manage.py migrate gunicorn should be run like `gunicorn -k 'gevent' tomo.wsgi . Problem is now the deploy is crashing probably because it doesn't work with python3.12. I will have to open another issue before I can check this one
Brody
Brody7mo ago
you can use a dockerfile to run with python 3.12
webomania
webomaniaOP7mo ago
gunicorn -k 'gevent' works. Please update docs if you have time, I've seen lot of posts about slow server response time with django SOLVED
Solution
Brody
Brody7mo ago
It doesnt have anything to do with the platform, every time this is a user code / config issue.
Want results from more Discord servers?
Add your server