gunicorn.request.duration
HTTP request processing durationDimensions:None
Technical Annotations (105)
Configuration Parameters (25)
timeoutrecommended: 120workersrecommended: 9worker-classrecommended: geventthreadsrecommended: 1http_request_duration_seconds.bucketsrecommended: [0.01, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]NEW_RELIC_CONFIG_FILErecommended: newrelic.iniscrape_configs.job_namerecommended: django_appscrape_configs.static_configs.targetsrecommended: ['localhost:8000']--bindrecommended: unix:/run/gunicorn.sockproxy_passrecommended: http://unix:/run/gunicorn.sockListenStreamrecommended: /run/gunicorn.sock--timeoutrecommended: 60--workersrecommended: 3statsd_prefixrecommended: your_app_namestatsd_hostrecommended: metrics-aggregator:9125NUM_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)sbacklog--access-logfilerecommended: '-'--error-logfilerecommended: '-'appendfsyncrecommended: noworker_tmp_dirrecommended: /dev/shm or tmpfs mountpreload_apprecommended: True-wrecommended: 4 (or (2 × CPU cores) + 1)Error Signatures (11)
[CRITICAL] WORKER TIMEOUT (pid:log pattern500http status[CRITICAL] WORKER TIMEOUTlog patternWORKER TIMEOUT (pid:log patternWorker (pid:*) was sent SIGKILL! Perhaps out of memory?log patternupstream prematurely closed connection while reading response header from upstreamlog pattern502http statusH12 Request Timeouterror codeWORKER TIMEOUTlog pattern504http statusWorker exiting (pid:log patternCLI Commands (14)
sudo systemctl daemon-reloadremediationsudo systemctl restart gunicornremediationgunicorn app:server --workers $WORKERS --worker-class gevent --bind 0.0.0.0:8000 --timeout 60remediationpip install gunicorn geventremediationpip install newrelicmonitoringnewrelic-admin generate-config YOUR_LICENSE_KEY newrelic.inimonitoringNEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program gunicorn myapp.wsgi:applicationmonitoringsudo systemctl restart nginxremediationpy-spy --subprocessesdiagnostic--timeout 120remediationfree -mdiagnostictopdiagnostic--access-logfilediagnostic-w 4remediationTechnical References (55)
workercomponentsystemdcomponentExecStartcomponentWSGIprotocolGeventcomponentDash callbackscomponentASGIprotocolEventletcomponentCelerycomponentP95concepthistogram_quantileconceptRED Methodconceptnewrelic-admincomponenttransaction tracesconceptscrape_configscomponentstatic_configscomponent/run/gunicorn.sockfile path/etc/systemd/system/gunicorn.socketfile path/etc/nginx/conf.d/filename.conffile pathUnix socketconceptmemcachedcomponentmanage.py runservercomponentconnection backlogconceptupstream_response_timecomponentmaster/child process modelconceptApp Service LinuxcomponentCProfilecomponentSNAT port exhaustionconceptos.fchmodconceptheartbeatcomponentfaulthandlercomponentworker processcomponentGoogle App EnginecomponentGoogle Cloud RuncomponentB2 instance classcomponentgthread workercomponentHTTP request smugglingconceptreverse proxycomponentmaster processcomponenttmpfscomponenthttp.disconnectcomponentasyncio.CancelledErrorexceptionasyncio.wait_forcomponentdatabase queriesconceptindexesconceptload balancercomponenthealth checkconceptgeventcomponentuvicorncomponentsocket accept queueconceptbacklogconceptsocket queueconceptswap memoryconceptgunicorn workercomponentDjango Debug ToolbarcomponentRelated Insights (39)
Gunicorn worker timeout on long-running requestswarning
▸
Worker pool exhaustion causes exact 60-second request hangscritical
▸
Synchronous WSGI workers block on I/O preventing concurrent request handlingwarning
▸
Request timeout rate increases with each load testwarning
▸
Slow backend responses cause concurrent request memory buildupwarning
▸
P95 latency exceeding 2 seconds degrades user experiencewarning
▸
Elevated request duration indicates performance degradationwarning
▸
Gunicorn startup with New Relic APM wrapperinfo
▸
Prometheus metrics scraping from Django applicationinfo
▸
TCP socket binding causes severe request latency compared to Unix socketcritical
▸
Insufficient Gunicorn workers cause unpredictable response timeswarning
▸
Multi-process model complicates Prometheus metrics collectioninfo
▸
Long-running requests terminated by worker timeoutwarning
▸
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
▸
Worker killed when timeout setting too low or missingcritical
▸
Worker timeout due to high CPU causing slow request processingwarning
▸
Worker timeout from long running requests exceeding timeout thresholdwarning
▸
Redis appendfsync blocking causes Gunicorn worker timeoutcritical
▸
Worker heartbeat blocks indefinitely on disk-backed filesystemcritical
▸
Worker timeout kills process without logging request URIwarning
▸
Slow external dependencies cause worker saturation and cascading failureswarning
▸
Gunicorn workers enter infinite timeout-SIGKILL cycle on Google App Enginecritical
▸
Request interpretation desynchronization between proxy and backendcritical
▸
Master process disk I/O blocking causes multi-second response latencycritical
▸
Request persistence after platform timeout causes resource wastewarning
▸
Worker timeout kills unresponsive workers after 30 secondscritical
▸
Database bottlenecks cause worker timeoutswarning
▸
Frequent health checks trigger unnecessary worker killswarning
▸
External service delays trigger worker timeoutswarning
▸
Slow application logic causes worker timeoutswarning
▸
Request duration metric excludes socket accept queue timewarning
▸
Socket backlog queue time not exposed as metricinfo
▸
Request duration metric excludes socket queue wait timewarning
▸
Memory swapping causes slow response times and Nginx 504 timeoutscritical
▸
Single Gunicorn worker insufficient for production without benchmarkingwarning
▸
Gunicorn worker timeout causes 20-30 second page delayscritical
▸
Large gap between Django CPU time and total request time indicates WSGI layer bottleneckinfo
▸