Load test'in amacı
Load test, sistemin beklenen kullanıcı yükü altında nasıl davrandığını ölçer. AIOR projelerinde load test yapmadan production'a aldığımız sistem yok — production'da sürpriz yaşamamak için baseline kurulur. Müşteri tarafına SLA verirken (örn. p99 latency < 500ms) somut ölçümler şart.Load test tipleri
- Smoke test — minimal yük, sistemin ayakta olduğunu doğrula.
- Load test — beklenen production yükü, baseline performans.
- Stress test — yükü artırarak breaking point bulmak.
- Spike test — ani yük artışı (örn. flash sale), nasıl davranır.
- Soak test (endurance) — uzun süreli yük (24h+), memory leak vb. tespit.
- Breakpoint test — sistem nereye kadar dayanır?
Her test farklı soruyu cevaplar.
k6 — modern tercih
k6 (Grafana Labs), AIOR'ın varsayılan load testing aracı. Avantajları:- JavaScript ile test scripting — geliştirici-dostu.
- Goroutine tabanlı (Go ile yazılmış) — tek makineden yüksek concurrency üretir.
- Prometheus, Datadog, InfluxDB entegrasyonu native.
- CI/CD entegrasyonu temiz.
- Cloud (k6 Cloud) veya self-hosted seçeneği.
Locust — Python alternatifi
Python kullanan ekipler için Locust pratik. Web UI ile real-time monitoring güçlü; distributed mode multi-machine support. AIOR'da Python ağırlıklı müşteri projelerinde Locust kullanıyoruz.Gerçekçi test senaryoları yazma
Load test'in en kritik kısmı senaryo doğruluğu. Hatalı senaryolar yanlış güven üretir:- Production analytics'ten user behavior pattern çıkarılır.
- Yalnız happy path değil, real-world kullanım — login, browse, search, purchase, logout.
- Think time (kullanıcı arası bekleme) gerçekçi olmalı.
- Data variation — her virtual user farklı data ile (cache'leme problemi yaratmasın).
- Ramp-up gradual — anlık 1000 user yerine 0→1000 üzerinden 5dk.
Hangi metrikler izlenir?
- Throughput — requests per second.
- Response time — average, median, p95, p99 percentile.
- Error rate — HTTP 5xx, timeout, connection refused.
- Concurrent users — anlık aktif user sayısı.
- Server-side: CPU, memory, disk I/O, network bandwidth.
- Database: connection pool kullanımı, query latency.
- Cache hit ratio — Redis veya CDN.
AIOR'da k6'nın stdout output'u Prometheus'a yazılıp Grafana'da görselleştiriyoruz.
Doğru ortamda test
Load test ideal olarak production-identical staging ortamında çalıştırılmalı. AIOR'da müşteri projelerinde staging genelde production'ın küçültülmüş hâli — testleri scale-down faktörü ile yorumluyoruz. Bazı durumlarda off-peak'te production'da chaos test yapılır (kontrollü, küçük yükle).Database darbeleri
Load test'te en sık darboğaz database. AIOR'ın izleme listesi:- Slow query log — load altında ortaya çıkan N+1.
- Connection pool exhaustion.
- Lock contention.
- Index missing.
- Disk I/O saturation.
CDN ve cache testi
Static assets ve cache'lenebilir API response'ların CDN'den gelmesi gerekir; cache miss'in load test'te ortaya çıkması production tutarsızlık göstergesi.Sonuç
Load test 2026'da production-ready sistemler için pazarlık edilmez. k6 veya Locust ile düzenli load test çalıştırmak production sürprizlerini önler. AIOR olarak müşteri projelerinde release öncesi smoke + load test standart; major release'lerde stress + soak test. Sizin tarafınızda load test rutini var mı, yoksa "production'da görürüz" mi diyorsunuz?The purpose of load testing
A load test measures how the system behaves under expected user load. We don't ship any AIOR project to production without load testing — to avoid production surprises, a baseline is set. When giving SLAs to customers (e.g. p99 latency < 500ms), concrete measurements are mandatory.Load test types
- Smoke test — minimal load, verify the system is up.
- Load test — expected production load, baseline performance.
- Stress test — increase load to find the breaking point.
- Spike test — sudden load surge (e.g. flash sale), behaviour under spike.
- Soak test (endurance) — long-running load (24h+) to detect leaks, etc.
- Breakpoint test — how far does the system hold up?
Each answers a different question.
k6 — modern pick
k6 (Grafana Labs) is AIOR's default load-testing tool. Advantages:- JavaScript test scripting — developer-friendly.
- Goroutine-based (written in Go) — high concurrency from a single machine.
- Native Prometheus, Datadog, InfluxDB integration.
- Clean CI/CD integration.
- Cloud (k6 Cloud) or self-hosted option.
Locust — Python alternative
Locust is practical for Python-shop teams. Strong real-time monitoring via web UI; distributed mode supports multi-machine. AIOR uses Locust on Python-heavy customer projects.Writing realistic scenarios
The most critical part of load testing is scenario accuracy. Wrong scenarios produce false confidence:- Derive user behaviour patterns from production analytics.
- Not only happy path — real-world flow: login, browse, search, purchase, logout.
- Think time (pause between user actions) must be realistic.
- Data variation — each virtual user with different data (avoid caching false positives).
- Gradual ramp-up — ramp 0→1000 over 5 minutes, not instantly.
Which metrics to monitor?
- Throughput — requests per second.
- Response time — average, median, p95, p99 percentile.
- Error rate — HTTP 5xx, timeouts, connection refused.
- Concurrent users — momentary active user count.
- Server-side: CPU, memory, disk I/O, network bandwidth.
- Database: connection pool usage, query latency.
- Cache hit ratio — Redis or CDN.
At AIOR we write k6's stdout output to Prometheus and visualise in Grafana.
Testing in the right environment
Load tests ideally run on a production-identical staging environment. On AIOR customer projects, staging is typically a scaled-down production — we interpret results with a scale-down factor. In some cases, controlled chaos tests run on production at off-peak (with small loads).Database pressure
The most common bottleneck under load is the database. AIOR's watch list:- Slow query log — N+1 surfacing under load.
- Connection pool exhaustion.
- Lock contention.
- Missing indexes.
- Disk I/O saturation.