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
Percy
Percy2y ago
Project ID: N/A
Percy
Percy2y ago
⚠️ experimental feature
krshnaprog
krshnaprogOP2y ago
N/A
krshnaprog
krshnaprogOP2y ago
Okay I understand that timeout is for workers, but how can actually I have to implement it? Is there any source that teaches this?
Brody
Brody2y ago
do you have a procfile or have you set a start command in the service settings?
krshnaprog
krshnaprogOP2y ago
Let me check I have procfile with the content "web: gunicorn djangoauthapi.wsgi"
Brody
Brody2y ago
change to web: gunicorn --timeout 600 djangoauthapi.wsgi
krshnaprog
krshnaprogOP2y ago
Easy 😄 Thank you Can I ask one more question here?
Brody
Brody2y ago
yes
krshnaprog
krshnaprogOP2y ago
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
Brody
Brody2y ago
do you see a worker timeout error in the railway logs at the time your frontend throws an error?
krshnaprog
krshnaprogOP2y ago
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
Brody
Brody2y ago
and how long do you expect the backend to take to handle these images?
krshnaprog
krshnaprogOP2y ago
I expect 10 seconds max, but I guess files is too large and takes time to get there.. 5 pictures I have..
Brody
Brody2y ago
well that timeout flag is time in seconds, so adjust to your needs
krshnaprog
krshnaprogOP2y ago
Okay Brody thank you again, you are doing good job bless you!
Brody
Brody2y ago
thank you!
krshnaprog
krshnaprogOP2y ago
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)
Brody
Brody2y ago
that would seem like a code issue than
krshnaprog
krshnaprogOP2y ago
Ahh Okay
Brody
Brody2y ago
but send me your current procfile in use in your project
krshnaprog
krshnaprogOP2y ago
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..?
Brody
Brody2y ago
common issue, try settings PYTHONUNBUFFERED = 1 in the service settings
krshnaprog
krshnaprogOP2y ago
where is the service settings? Ahh, in my Django project? settings.py
Brody
Brody2y ago
sorry, in the service variables
Brody
Brody2y ago
krshnaprog
krshnaprogOP2y ago
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?
Brody
Brody2y ago
its just sounding more and more like a code issue if im being honest
Want results from more Discord servers?
Add your server