天天看點

gunicorn開啟gevent模式,啟動服務的時候報逾時錯誤,服務起不來報錯解決方案參考:

報錯

[[2022-08-25 08:26:45 +0000]] CRITICAL [glogging.py:255] WORKER TIMEOUT (pid:669)'
           
gunicorn開啟gevent模式,啟動服務的時候報逾時錯誤,服務起不來報錯解決方案參考:

解決方案參考:

有可能是協程模型,worker_connections 的預設值過大,導緻起不來,改成多線程,gthread模型,服務就可以起來。

https://github.com/benoitc/gunicorn/issues/2608

https://github.com/benoitc/gunicorn/issues/1840

It has been said many time to not ry to ru a pytorch or other blocking process in main worker processes (or in gevent). If you need to orun a blocking process, run it as a separate daemon and dialog with it using unix sockets . Asyncio will not change anything as well there.

So in short: start the process from a gunicorn request, and make your client polling the sytem from time to time or wait for it in an unblocking manner.

It has been said many time to not ry to ru a pytorch or other blocking process in main worker processes (or in gevent). If you need to orun a blocking process, run it as a separate daemon and dialog with it using unix sockets . Asyncio will not change anything as well there.

So in short: start the process from a gunicorn request, and make your client polling the sytem from time to time or wait for it in an unblocking manner.

已經說過很多次不要嘗試在主工作程序(或 gevent)中運作 pytorch 或其他阻塞程序。 如果您需要運作阻塞程序,請将其作為單獨的守護程序運作并使用 unix sockets 與之對話。 Asyncio 也不會在那裡改變任何東西。

簡而言之:從 gunicorn 請求開始該過程,并讓您的用戶端不時輪詢系統或以暢通無阻的方式等待它。

繼續閱讀