Performance monitoring
Python performance monitoring
Python web apps are usually limited by workers and the database, not raw CPU speed. Measure latency per route, worker saturation and where each request spends its time.
2 min read7 sectionsUpdated
On this page
| Signal | Source | Worry when |
|---|---|---|
| p95 / p99 latency per route | Traces | Above target, or rising after a deploy |
| Error rate per route | Traces, error tracking | Above 1 to 2% |
| Busy workers vs total | Server metrics or logs | All workers busy for minutes |
| Database time per request | Traces | Most of the request time |
| Celery queue length and task duration | Broker and task spans | Queue grows faster than it drains |
| Process memory (RSS) | Infrastructure metrics | Grows with every request; see Python memory usage |
Typical Python bottlenecks
- Too few workers for I/O-bound apps, or too many for the CPU and memory available. A common start for gunicorn is
2 × cores + 1sync workers, adjusted from measurements. - CPU-bound work in the request (image processing, big JSON, report generation) holds the GIL; move it to a task queue or a process pool.
- Blocking calls in async code: a synchronous database driver inside FastAPI blocks the event loop for every request.
- ORM N+1 queries in Django and SQLAlchemy; see finding slow database queries.
- Slow imports and cold starts in serverless functions.
Sync or async workers?
Async (uvicorn, gevent) helps when requests spend most time waiting on I/O and your libraries are async-friendly. For CPU-heavy or blocking code, sync workers with more processes are simpler and often faster.
Does OpenTelemetry work with Celery?
Yes. The Celery instrumentation traces tasks and links them to the request that queued them.
Check it now, free
- Response time checker: Measure TTFB with DNS, connect, TLS and server time.
Related reading
- PHP performance monitoring: Monitor PHP and Laravel apps: request latency, PHP-FPM worker saturation, OPcache hit rate, slow queries, external calls and errors.
- Java performance monitoring: Monitor Java and Spring applications: JVM heap and GC, thread pools, JDBC connection pools, request latency from traces.
- Best APM tools: Choose an APM tool in 2026: the criteria that matter, from OpenTelemetry support to pricing models, well-known options compared and how to run a fair trial.
- What is APM (application performance monitoring)?: APM explained: what application performance monitoring measures, how traces and spans work, why p95 beats averages, a worked example and how to start.
- IIS monitoring and IIS logs: Monitor Microsoft IIS: performance counters, request queues, application pool health and recycling, W3C log fields such as time-taken.
- Go performance monitoring: Monitor Go services: goroutine counts, GC and heap, request latency per handler, pprof profiling in production and OpenTelemetry tracing with otelhttp.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.