Increasing Worker Timeout
I want to increase worker timeout because it takes long to make some action, so I want to make it longer..
[1] [CRITICAL] WORKER TIMEOUT (pid:14) this is the error
30 Replies
Project ID:
N/A
You might find these helpful:
- Very slow response time
- CRITICAL WORKER TIMEOUT ISSUE
- Getting worker timeout error
⚠️ experimental feature
N/A
Okay I understand that timeout is for workers, but how can actually I have to implement it?
Is there any source that teaches this?
do you have a procfile or have you set a start command in the service settings?
Let me check
I have procfile with the content
"web: gunicorn djangoauthapi.wsgi"
change to
web: gunicorn --timeout 600 djangoauthapi.wsgi
Easy 😄 Thank you
Can I ask one more question here?
yes
Okay, I have API for my mobile aplication, I am mobile dev and I do not know anything about backends but I followed Django tutorial and I created simple API, where from frontend I am sending some pictures and in the backend I have the function that handles it.. But sometime my frontend throws error because of no response from back, I think that increasing timeout will help this problem, because in the local deployment it works just fine..
Is above solution suffiecient for this purpose?
I want to make timeout longer, like 5 minutes for exxample
do you see a worker timeout error in the railway logs at the time your frontend throws an error?
yes..
[1] [CRITICAL] WORKER TIMEOUT (pid:14)
[2023-04-11 04:44:13 +0000] [14] [INFO] Worker exiting (pid: 14)
[2023-04-11 04:44:13 +0000] [14] [INFO] Worker exiting (pid: 14)
[2023-04-11 04:44:13 +0000] [15] [INFO] Booting worker with pid: 15
[2023-04-11 04:44:13 +0000] [15] [INFO] Booting worker with pid: 15
and how long do you expect the backend to take to handle these images?
I expect 10 seconds max, but I guess files is too large and takes time to get there..
5 pictures I have..
well that timeout flag is time in seconds, so adjust to your needs
Okay Brody thank you again, you are doing good job bless you!
thank you!
I increased Timeout As you say --timeout 600 but still after 30 seconds it says the same thing
with timer I set time and after 30 seconds it says [CRITICAL] WORKER TIMEOUT (pid:9)
that would seem like a code issue than
Ahh Okay
but send me your current procfile in use in your project
I have print functions in my code that should print at least something in the logs but railway logs do not support I guess that loggings...
Where Can i get more detailed logs..?
common issue, try settings
PYTHONUNBUFFERED
= 1 in the service settingswhere is the service settings?
Ahh, in my Django project?
settings.py
sorry, in the service variables
Okay
When Worker timeout it happening in railway? Is it possible to happen when I send some data from frontend to backend deployed in railway, and data is not completely sent, like too large info sent by user from frontend and it took too long and stopped sending data from frontend, Is it likely to have Worker timeout there?
its just sounding more and more like a code issue if im being honest