How would you monitor and improve the performance of a Django application?
Instruction: Discuss tools and methodologies for monitoring Django application performance and identifying bottlenecks.
Context: This question seeks to uncover the candidate's experience with performance optimization and monitoring tools specific to Django applications.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
Define the affected user journey and a baseline before optimizing. Measure latency distributions such as median and p95, throughput, error rate and resource saturation over comparable traffic. A lower average can conceal a slower or failing tail.
Use production-safe tracing and metrics to separate database time, external calls, cache behavior and application work. Control sampling, retention and sensitive attributes...