gunicorn.workers
Number of Gunicorn worker processesDimensions:None
Technical Annotations (115)
Configuration Parameters (20)
--error-logfilerecommended: /var/log/gunicorn/error.log--preloadrecommended: enabledworkersrecommended: 9worker-classrecommended: geventthreadsrecommended: 1timeoutrecommended: 60max_requestsrecommended: 1000max_requests_jitterrecommended: 500worker_classrecommended: syncmax-requests--workersrecommended: 3--bindrecommended: unix:/home/ubuntu/my-packing-buddy/myproject.sockNUM_WORKERSrecommended: tested 1, 3, 9, 17 - no improvementaccesslogrecommended: -access_log_formatrecommended: %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" rt=%(L)s busy=%({x-busy}i)sbacklogpreload_apprecommended: True--timeoutrecommended: 120-wrecommended: 4 (or (2 × CPU cores) + 1)--access-logfilerecommended: enabledError Signatures (24)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>exceptionWorker failed to boot.log patterngunicorn.errors.HaltServer: <HaltServer 'worker failed to boot.' 3>exceptionWorker with pid 26 was terminated due to signal 9log patternOut of memory: Killed process 776660 (gunicorn)log patternWorker failed to booterror codegunicorn.errors.HaltServer: HaltServer 'Worker failed to boot.' 3exceptionworker timeoutlog patterncore dumplog patternup == 0error codeRuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>exceptionWorker with pid [0-9]+ was terminated due to signal 9log pattern9error codeWorker with pid %s was terminated due to signal %slog patternImportError: No module namedexception499http statusWORKER TIMEOUT (pid:log patternWorker (pid:*) was sent SIGKILL! Perhaps out of memory?log patternupstream prematurely closed connection while reading response header from upstreamlog pattern502http statusShutting down: Masterlog patternWORKER TIMEOUTlog pattern[CRITICAL] WORKER TIMEOUT (pid:log patternWorker exiting (pid:log patternCLI Commands (20)
gunicorn app:app --error-logfile /var/log/gunicorn/error.log --access-logfile /var/log/gunicorn/access.log --preloaddiagnosticdmesg | grep -i 'killed process'diagnosticgunicorn app:server --workers $WORKERS --worker-class gevent --bind 0.0.0.0:8000 --timeout 60remediationpip install gunicorn geventremediationcurl --unix-socket /run/gunicorn.sock http://diagnosticsystemctl status gunicorndiagnosticsystemctl status caddydiagnosticdmesg -T | egrep -i 'memory'diagnosticdmesg -T | egrep -i 'oom'diagnosticgunicorn app:app --workers=4 --max-requests=1000 --max-requests-jitter=100remediationpkill gunicornremediation/venv/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/my-packing-buddy/myproject.sock wsgi:appremediationpy-spy --subprocessesdiagnosticpip install mymoduleremediationgunicorn --helpdiagnosticgunicorn --preload mysite.wsgi:applicationdiagnostic--timeout 120remediationfree -mdiagnostic--access-logfilediagnostic-w 4remediationTechnical References (51)
HaltServerexceptionWORKER_BOOT_ERRORerror codeOOM KillercomponentSIGKILLconceptsignal 9conceptWSGI applicationcomponentapp.pyfile pathdotenvcomponentWSGIprotocolGeventcomponentDash callbackscomponentmultiprocessingcomponentOOM killercomponentmemory_profilercomponent/run/gunicorn.sockfile pathsystemd socket activationconceptRDScomponentPrometheus up metricconceptrunbookconceptstderrfile pathlogging deadlockconceptgunicorn.arbitercomponentsync workerscomponentI/O-boundconceptmemcachedcomponentmanage.py runservercomponentconnection backlogconceptupstream_response_timecomponentgunicorn.conf.pyfile pathfaulthandlercomponentworker processcomponentnginxcomponentGoogle App EnginecomponentGoogle Cloud RuncomponentB2 instance classcomponentgthread workercomponentWIFSIGNALEDconceptwaitpidconceptsignal handlercomponentworkercomponentSIGTERMconceptmax_requestsconfigurationmastercomponentpreloadconceptmaster processcomponentload balancercomponenthealth checkconceptsocket accept queueconceptbacklogconceptOS thrashingconceptgunicorn workercomponentRelated Insights (47)
Application code errors prevent Gunicorn worker startupcritical
▸
Insufficient system resources prevent Gunicorn worker initializationcritical
▸
Gunicorn worker terminated by OOM killer due to memory exhaustioncritical
▸
Incorrect WSGI application entry point prevents worker bootcritical
▸
Missing or misconfigured environment variables cause worker startup crashcritical
▸
Missing or incompatible dependencies prevent worker processes from startingcritical
▸
Insufficient server memory prevents worker processes from startingcritical
▸
Circular imports or improper module initialization cause boot failurescritical
▸
Worker pool exhaustion causes exact 60-second request hangscritical
▸
Insufficient worker count for moderate concurrent usage causes request queueingwarning
▸
Gunicorn spawns more processes than configured causing performance degradationwarning
▸
Application memory leak causes OOM after extended uptimecritical
▸
Worker boot timeout triggers core dumps and OOMcritical
▸
Gunicorn unix socket hangs for 2-45 minutes before self-recoverycritical
▸
Multiple Gunicorn servers freeze simultaneously indicating shared resource deadlockcritical
▸
Service down detection requires immediate actioncritical
▸
High worker utilization indicates capacity limit reachedwarning
▸
Low worker count causes request handling degradationwarning
▸
Elevated request duration indicates performance degradationwarning
▸
Reentrant logging deadlock causes worker termination with SIGKILLcritical
▸
Gunicorn workers crash with reentrant logging errors causing intermittent downtimecritical
▸
Insufficient Gunicorn workers cause unpredictable response timeswarning
▸
Old Gunicorn processes block Unix socket preventing restartwarning
▸
Worker timeout prevents hung processes and memory leakswarning
▸
Worker and thread tuning controls memory vs CPU tradeoffinfo
▸
Performance degradation at 400 connections despite low resource utilizationwarning
▸
Excessive worker count degrades performance instead of improving itwarning
▸
Gunicorn CPU spike to 100% causes severe page load delayscritical
▸
Request queueing in connection backlog due to insufficient workerswarning
▸
Requests queue in connection backlog when workers are saturatedwarning
▸
Module import errors prevent Gunicorn worker initializationcritical
▸
Gunicorn configuration errors prevent worker startupcritical
▸
Worker timeout kills process without logging request URIwarning
▸
Worker saturation manifests as nginx 499 status codeswarning
▸
Gunicorn workers enter infinite timeout-SIGKILL cycle on Google App Enginecritical
▸
Worker signal handling failure indicates fatal worker problemcritical
▸
Gunicorn workers OOM killed without logging in Kubernetescritical
▸
Limit worker connections to prevent memory accumulationwarning
▸
Automatic worker restarts cause brief 502 errorswarning
▸
Worker boot failures hidden at default log levelwarning
▸
Worker timeout kills unresponsive workers after 30 secondscritical
▸
Frequent health checks trigger unnecessary worker killswarning
▸
Request duration metric excludes socket accept queue timewarning
▸
Excessive Gunicorn workers cause OS thrashing and performance degradationwarning
▸
Hosting multiple sites on 1GB RAM server causes memory exhaustioncritical
▸
Single Gunicorn worker insufficient for production without benchmarkingwarning
▸
Gunicorn worker timeout causes 20-30 second page delayscritical
▸