Django - What happens when setting WEB_CONCURRENCY too high in heroku 1xdyno

I have a Django app running in Heroku with GUnicorn, I have 1Xdyno and just found that you can set your WEB_CONCURRENCY.

What's the optimal WEB_CONCURRENCY?

Answers


Article Deploying Python Applications with Gunicorn tells about various parameters of Gunicorn and their effect on Heroku.

Below is the text copied from this article regarding WEB_CONCURRENCY

Gunicorn forks multiple system processes within each dyno to allow a Python app to support multiple concurrent requests without requiring them to be thread-safe. In Gunicorn terminology, these are referred to as worker processes (not to be confused with Heroku worker processes, which run in their own dynos).

Each forked system process consumes additional memory. This limits how many processes you can run in a single dyno. With a typical Django application memory footprint, you can expect to run 2–4 Gunicorn worker processes on a 1X dyno. Your application may allow for a variation of this, depending on your application’s specific memory requirements.

We recommend setting a configuration variable for this setting, so you can tweak it without editing code and redeploying your application.

$ heroku config:set WEB_CONCURRENCY=3

Need Your Help

Does PreparedStatement convert empty strings to null?

mysql jdbc prepared-statement string

I'm working with MySQL and their last available JDBC driver, on a User table with NOT NULL constraints on all its fields, which are id, name, password and email.

How can call a PHP function from Perl code?

php perl cgi

I have a function written in PHP and would like to call this inside a CGI script. Is there any direct way to do this?