Skip to content

Configuration

Django Cheroot is configured entirely through the cheroot command’s arguments — there are no extra settings to add to settings.py. This page is the complete reference.

OptionShortLongTypeDefaultDescription
Host IP-ip--hostipstr127.0.0.1The address to bind. Use 0.0.0.0 to listen on all interfaces.
Port-p--portint8000The TCP port to listen on.
Max worker threads-w--maxthreadsint40Upper bound on worker threads Cheroot will create under load.
Min threads-t--minthreadsint30Threads kept warm in the pool at all times.
Max queued connections-c--connectionsint20Size of the OS listen backlog for pending connections.
Terminal window
python manage.py cheroot \
--hostip 0.0.0.0 \
--port 8000 \
--minthreads 30 \
--maxthreads 40 \
--connections 20

Internally the command builds a cheroot.wsgi.Server and starts it. The mapping is:

Command optioncheroot.wsgi.Server parameter
--hostip + --portbind_addr (the (host, port) tuple)
--minthreadsnumthreads
--maxthreadsmax
--connectionsrequest_queue_size
  • --minthreads / --maxthreads size the worker pool. Cheroot keeps minthreads warm and grows toward maxthreads as concurrent requests arrive. For mostly-idle apps, keep minthreads low; for steady traffic, set it close to your typical concurrency so you don’t pay thread-startup cost on every spike. maxthreads should account for your peak concurrent in-flight requests.
  • --connections is the accept backlog — how many connections may wait for a free worker before the OS starts refusing them. Raise it if you see connection resets under bursty load.