Flask

ProfilerMiddleware adds overhead in production environments

info
performanceUpdated May 21, 2024(via Exa)
Technologies:
How to detect:

Werkzeug ProfilerMiddleware profiles every request and adds measurement overhead. When enabled continuously in production, it degrades application performance and impacts user experience.

Recommended action:

Enable ProfilerMiddleware only in staging environments or for brief periods in production when actively debugging performance issues. Use time-limited profiling sessions and disable immediately after collecting necessary data. Consider application performance monitoring tools for continuous production monitoring instead.