![]() Gunicorn provides a different set of configuration options to Uvicorn, so some options such as -limit-concurrency are not yet supported when running with Gunicorn. You can do this by using the UvicornH11Worker class. ![]() To run under PyPy you'll want to use pure-python implementation instead. The UvicornWorker implementation uses the uvloop and httptools implementations. The following will start Gunicorn with four worker processes: Uvicorn includes a gunicorn worker class that means you can get set up with very little configuration. Gunicorn is probably the simplest way to run and manage Uvicorn in a production setting. Uvicorn provides a lightweight way to run multiple worker processes, for example -workers 4, but does not provide any process monitoring. Running Uvicorn using a process manager ensures that you can run multiple processes in a resilient manner, and allows you to perform server upgrades without dropping requests.Ī process manager will handle the socket setup, start-up multiple server processes, monitor process aliveness, and listen for signals to provide for processes restarts, shutdowns, or dialing up and down the number of running processes. ![]() The reload and workers parameters are mutually exclusive. To run directly from within a Python program, you should use n(app, **config). See the settings documentation for more details on the supported options for running uvicorn. factory Treat APP as an application factory, i.e. app-dir TEXT Look for APP in the specified directory, byĪdding this to the PYTHONPATH. version Display the uvicorn version and exit. header TEXT Specify custom default HTTP response headers ssl-ciphers TEXT Ciphers to use (see stdlib ssl module's) ssl-cert-reqs INTEGER Whether client certificate is required (see ssl-version INTEGER SSL version to use (see stdlib ssl module's) ssl-keyfile-password TEXT SSL keyfile password timeout-keep-alive INTEGER Close Keep-Alive connections if no new data limit-max-requests INTEGER Maximum number of requests to service before backlog INTEGER Maximum number of connections to hold in limit-concurrency INTEGER Maximum number of concurrent connections or root-path TEXT Set the ASGI 'root_path' for applications $FORWARDED_ALLOW_IPS environment variable if ![]() forwarded-allow-ips TEXT Comma separated list of IPs to trust with use-colors / -no-use-colors Enable/Disable colorized logging. access-log / -no-access-log Enable/Disable access log. log-config PATH Logging configuration file. env-file PATH Environment configuration file. WebSocket per-message-deflate compression ws-ping-timeout FLOAT WebSocket ping timeout ws-ping-interval FLOAT WebSocket ping interval ws-max-queue INTEGER The maximum length of the WebSocket message ws-max-size INTEGER WebSocket max size message in bytes workers INTEGER Number of worker processes. reload-delay FLOAT Delay between previous and next check ifĪpplication needs to be. Option has no effect unless watchfiles is reload-exclude TEXT Set glob patterns to exclude while watchingįor files. Includes '*.py' by default theseĭefaults can be overridden with `-reload-Įxclude`. reload-include TEXT Set glob patterns to include while watchingįor files. reload-dir PATH Set reload directories explicitly, instead fd INTEGER Bind to socket from this file descriptor.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |