Local development environment for load testing and observability — K6 stress tests, Prometheus/Grafana monitoring, and ELK log analysis, all wired up with a single Docker Compose command.
K6 부하 테스트 + Prometheus/Grafana 모니터링 + ELK 로깅을 Docker Compose 하나로 구성한 로컬 실습 환경입니다.
| Layer | Tool |
|---|---|
| Load Testing | K6 |
| Backend | Django + Nginx |
| Monitoring | Prometheus · Grafana · cAdvisor · Node Exporter |
| Logging | Filebeat → Logstash → Elasticsearch → Kibana |
docker compose up --buildInstall K6 first, then run:
k6 run --vus 100 --duration 30s script.js100 virtual users send requests concurrently for 30 seconds. Sample output:
http_req_duration..: avg=5.55s min=1.66s med=4.4s max=19.52s p(90)=10.56s p(95)=13.56s
http_reqs..........: 433 5.80/s
http_req_duration— how long each request took end-to-endp(90)— 90% of requests completed within this time
GET http://localhost/api/v1/multi?x=100&y=100
x * y iterations run in a loop — adjust to simulate different CPU loads.
| Service | URL | Purpose |
|---|---|---|
| App | http://localhost:8000 | Django backend |
| Grafana | http://localhost:3001 | Metrics dashboard |
| Prometheus | http://localhost:9090 | Metrics storage |
| cAdvisor | http://localhost:8080 | Container metrics |
| Node Exporter | http://localhost:9100 | Host metrics |
| Kibana | http://localhost:5601 | Log analysis |
- Add data source: Configuration → Data Sources → Add → Prometheus → URL:
http://prometheus:9090→ Save & Test - Import dashboard: Create → Import → enter a Grafana dashboard ID (e.g.
6756)
→ Grafana playground · django-prometheus setup
Nginx access log → Filebeat → Logstash → Elasticsearch → Kibana
Log index pattern: stress-logs-yyyy.MM.dd
- Go to http://localhost:5601
- Search Index Management → confirm
stress-logs-*indices exist - Analytics → Dashboard → Create data view → pattern:
stress-logs-* - Create Visualization → drag fields onto the canvas