performance-engineering

Profile and load test Python web services to identify CPU, memory, I/O, and database bottlenecks.

3|Updated Jan 25, 2026
One-click install
npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill performance-engineering-ai-enhanced-engineer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-engineering
Source: https://github.com/ai-enhanced-engineer/aiee-skills/tree/main/skills/performance-engineering
Command: npx skills add https://github.com/ai-enhanced-engineer/aiee-skills --skill performance-engineering-ai-enhanced-engineer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires py-spy, Locust, k6, memory_profiler, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps developers and engineers profile, load test, and optimize Python web services, identifying bottlenecks and improving efficiency.

Core Features & Use Cases

  • CPU and Memory Profiling: Utilize tools like py-spy and memory_profiler to find and address CPU and memory issues.
  • Load Testing: Employ Locust or k6 to simulate real-world traffic and measure performance under load.
  • Database Optimization: Apply best practices for database query optimization and connection pooling.
  • WebSocket Scaling: Learn how to scale WebSocket connections effectively.

Quick Start

Run py-spy record -o profile.svg --pid <PID> to profile the running process with py-spy.

Frequently Asked Questions about performance-engineering

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I profile a running Python web service to find CPU and memory bottlenecks?

Profile Python web services by attaching py-spy to a running process to generate CPU flame graphs, and use memory_profiler to identify memory bottlenecks. Run `py-spy record --pid <PID>` to output visual profiling data.

Can I use Locust and k6 for load testing Python web applications?

Yes, you can use Locust and k6 for load testing Python web applications. Both tools simulate real-world traffic to measure performance under load, helping identify I/O and database bottlenecks before they impact production.

What is the best way to optimize database queries and connection pooling in Python web services?

Optimize database queries in Python web services by profiling slow queries, applying connection pooling best practices, and identifying I/O bottlenecks through load testing. This reduces latency and improves overall application throughput.

Do I need Python and py-spy installed to run performance profiling scripts?

Yes, you need Python and py-spy installed to execute performance profiling scripts. The Skill requires Python, py-spy, Locust, and other related tools to be present in the environment to run tests and optimize web services.

How does load testing help scale WebSocket connections in Python?

Load testing helps scale WebSocket connections by simulating concurrent traffic with tools like Locust or k6. This measures performance limits under load and highlights I/O bottlenecks, enabling effective WebSocket scaling strategies.

When should I use py-spy versus memory_profiler for Python performance optimization?

Use py-spy for CPU performance optimization to visualize thread execution and find CPU bottlenecks, and use memory_profiler to monitor memory usage line-by-line. Both are needed to address different resource bottlenecks in Python web services.