Performance — Đo lường hiệu suất

Load testing, benchmarking, và profiling để đảm bảo hệ thống đáp ứng performance requirements.

Cú pháp


Bảng tham chiếu nhanh


/benchmark — Load Testing

1

Bước 1: Generate scenarios

Tạo test scenarios dựa trên API endpoints và user flows.
2

Bước 2: Execute load test

Chạy với multiple concurrency levels (10, 50, 100, 500 users).
3

Bước 3: Collect metrics

Thu thập: requests/sec, p50/p95/p99 latency, error rate, throughput.
4

Bước 4: Analyze + Report

Identify bottlenecks, suggest optimizations.

/profile — Performance Profiling

Phân tích:
  • CPU usage per function
  • Memory allocation patterns
  • Database query performance (N+1 detection)
  • Network I/O bottlenecks

Ví dụ thực tế


Performance Thresholds


Khi nào dùng / không dùng