Debugging Advice
Debugging Performance Issues in Production Environments
This prompt helps engineering teams identify and resolve performance-related issues in production environments. It focuses on profiling, monitoring, and optimizing code or infrastructure to restore normal operation.
Responsible:
Engineering/IT
Accountable, Informed or Consulted:
Engineering
THE PREP
Creating effective prompts involves tailoring them with detailed, relevant information and uploading documents that provide the best context. Prompts act as a framework to guide the response, but specificity and customization ensure the most accurate and helpful results. Use these prep tips to get the most out of this prompt:
Gather monitoring data or performance metrics from tools like Grafana, CloudWatch, or Prometheus.
Provide logs or traces that highlight where the performance issues occur.
Share details about recent deployments or configuration changes.
THE PROMPT
Provide debugging advice for resolving performance issues in a production environment for [specific software application]. The application is built using [specific programming language or framework] and faces [specific symptoms, e.g., high CPU usage, slow response times, or memory leaks]. Focus on:
Profiling Tools: Recommend tools like New Relic, Datadog, or application-specific profilers (e.g., Python’s cProfile, Node.js Inspector) to identify bottlenecks in real time.
Log Analysis: Suggest methods for analyzing application logs to detect patterns, errors, or anomalies contributing to the performance degradation.
Code Bottlenecks: Provide strategies to debug slow functions, inefficient loops, or database queries causing delays. Include examples of profiling outputs if needed.
Infrastructure Debugging: Recommend checks for infrastructure issues, such as overloaded servers, insufficient resources, or misconfigured load balancers.
Temporary Mitigation: Propose immediate mitigation strategies, such as throttling requests, restarting services, or scaling resources, while long-term fixes are implemented.
Provide a structured debugging plan with detailed steps and tools to address performance issues. If additional details about the environment or application architecture are required, ask clarifying questions to refine the advice.
Bonus Add-On Prompts
Propose techniques for debugging high memory usage in microservices-based architectures.
Suggest methods for identifying and optimizing network latency issues in distributed systems.
Highlight strategies for implementing automated alerts for performance regressions in production.
Use AI responsibly by verifying its outputs, as it may occasionally generate inaccurate or incomplete information. Treat AI as a tool to support your decision-making, ensuring human oversight and professional judgment for critical or sensitive use cases.
SUGGESTIONS TO IMPROVE
Focus on debugging performance issues specific to a database, such as query latency or connection pooling.
Include tips for debugging server-side versus client-side performance problems.
Propose ways to isolate performance issues in containerized environments, such as Kubernetes.
Highlight strategies for simulating production conditions in a staging environment for testing.
Add suggestions for leveraging APM tools to visualize performance trends and root causes.
WHEN TO USE
To address performance bottlenecks in live applications affecting end-users.
When debugging infrastructure issues impacting application performance.
During post-deployment analysis to identify regressions.
WHEN NOT TO USE
For minor performance issues that don’t significantly impact users or operations.
If debugging tools or monitoring data are unavailable for analysis.