- How to pass args or kwargs to gunicorn?
# codename/app.py
def create_app():
app = FrameworkApp()
...
return app
$ gunicorn --workers=2 'codename.app:create_app()'
Positional and keyword arguments can also be passed, but it is recommended to load configuration from environment variables rather than the command line.
- Resolve Gunicorn timeout error -
[2020-04-14 19:27:11 +0530] [86010] [CRITICAL] WORKER TIMEOUT (pid:86032)
or
ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))
default timeout is 30 seconds. Tweak it. Example:
Setting timeout to 100 seconds
gunicorn -b localhost:5000 'codename.app:make_app(model="bert")' --timeout 100 --graceful-timeout 100