Django app, slow server response
Anonymous
TRIALOP

2 years ago

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.

14 Replies

Anonymous
TRIALOP

2 years ago

bdca37b2-12cd-4a44-8091-d27170f251f1


2 years ago

what location do you have your database in?


Anonymous
TRIALOP

2 years ago

It's Toronto


Anonymous
TRIALOP

2 years ago

wait


Anonymous
TRIALOP

2 years ago

us-central1, that seems to be Iowa


2 years ago

how are you having railway run your django app?


Anonymous
TRIALOP

2 years ago

Not sure I understand. It's using gunicorn, automatically deployed after git push.


2 years ago

whats your start command


Anonymous
TRIALOP

2 years ago

web: gunicorn tomo.wsgi
release: python manage.py migrate


Anonymous
TRIALOP

2 years ago

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


2 years ago

you can use a dockerfile to run with python 3.12


Anonymous
TRIALOP

2 years 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


Anonymous
TRIALOP

2 years ago

SOLVED


2 years ago

It doesnt have anything to do with the platform, every time this is a user code / config issue.


Loading...