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.
Solution:Jump to solution
It doesnt have anything to do with the platform, every time this is a user code / config issue.
11 Replies
Project ID:
bdca37b2-12cd-4a44-8091-d27170f251f1
bdca37b2-12cd-4a44-8091-d27170f251f1
what location do you have your database in?
It's Toronto
wait
us-central1, that seems to be Iowa
how are you having railway run your django app?
Not sure I understand. It's using gunicorn, automatically deployed after git push.
whats your start command
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
you can use a dockerfile to run with python 3.12
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
It doesnt have anything to do with the platform, every time this is a user code / config issue.