Technologies/Celery/celery.task.duration
CeleryCeleryMetric

celery.task.duration

Task execution duration
Dimensions:None
Available on:OpenTelemetryOpenTelemetry (1)Native (1)PrometheusPrometheus (1)DatadogDatadog (1)
Interface Metrics (4)
OpenTelemetryOpenTelemetry
Duration of task execution from start to completion
Dimensions:None
Native
Task execution duration in seconds
Dimensions:None
PrometheusPrometheus
Histogram of task runtime in seconds
Dimensions:None
DatadogDatadog
Task execution time in seconds
Dimensions:None

Technical Annotations (41)

Configuration Parameters (13)
task_time_limitrecommended: 300
Hard limit in seconds to prevent indefinite task execution
task_soft_time_limitrecommended: 280
Soft limit allows graceful shutdown before hard limit
time_limitrecommended: based on expected duration
Should reflect actual task execution time to avoid false failures or unresponsive workers
retry_backoffrecommended: True with base ~10 seconds
enables exponential backoff starting at base interval
retry_jitterrecommended: True
adds randomization to prevent retry storms
countdownrecommended: dynamic based on retry count
sets initial retry delay
max_retriesrecommended: 3-5
prevents queue flooding and resource drain
CELERY_BEAT_MAX_LOOP_INTERVALrecommended: 300
max sleep time between beat schedule iterations
CELERY_RESULT_BACKENDrecommended: None
result backend disabled in this deployment
CELERYD_CONCURRENCYrecommended: 4
Controls the number of concurrent worker processes
default_retry_delay
Sets delay between retry attempts
task_acks_laterecommended: True
Acknowledges tasks only after completion to prevent data loss
task_reject_on_worker_lossrecommended: True
Ensures task rejection on worker failure when using late acknowledgment
CLI Commands (2)
celery worker --loglevel INFOdiagnostic
start_http_server(8000)monitoring
Technical References (26)
cgroupscomponentPrometheuscomponentGrafanacomponentcircuit breakerconceptcelery beatcomponentperiodic tasksconceptCDNcomponentmicroservice architectureconceptSQLconceptslow query logscomponentexponential backoffconceptretry mechanismconceptlatencyconcepthigh-frequency tasksconcepttask timeoutconceptexecution timeconceptpriority queueconcepttask starvationconceptFIFOconceptconnection poolcomponentRSSconceptOOM killconceptMainProcesscomponentprometheus-clientcomponenttask_preruncomponenttask_postruncomponent
Related Insights (24)
Unresponsive external services cause timeoutswarning
Resource constraints prevent task executioncritical
Timeout issues account for 30% of task failureswarning
Network latency increases task execution time by 25%warning
Exponential backoff reduces failure rates by 30% under high loadwarning
Retries without concurrency caps flood queues causing latencycritical
Low task volume deployment with periodic scheduled tasks on Kubernetesinfo
High network latency causes up to 30% increase in task completion timewarning
Slow database queries delay task execution when lacking proper indexingwarning
Insufficient worker processes cause task queue buildup and delayswarning
Inefficient task design causes latency from external service dependencieswarning
Optimizing retry mechanisms reduces task turnaround time by 30%info
High-frequency tasks exceeding 100ms latency degrade user satisfactionwarning
Tasks exceeding average execution time by 30% are 65% more prone to failureswarning
Priority queues without monitoring cause starvation of lower-priority taskswarning
Connection pooling reduces broker latency by 27%warning
Memory leaks cause 35% task completion time increase over 24 hourscritical
Horizontal scaling outperforms vertical beyond 8 workers per nodewarning
P95 task completion should not exceed 4x expected execution intervalwarning
95th percentile task completion triggers scaling when 30% over SLAwarning
Celery task execution times reveal slow tasks through worker logsinfo
Task latency spikes identified as primary bottleneck in 65% of deploymentswarning
Prometheus metrics integration reduces MTTD by 40%info
Task execution time degradation impacts user experiencewarning