Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Stress Test Stack

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 하나로 구성한 로컬 실습 환경입니다.

Stack

Layer Tool
Load Testing K6
Backend Django + Nginx
Monitoring Prometheus · Grafana · cAdvisor · Node Exporter
Logging Filebeat → Logstash → Elasticsearch → Kibana

Quick Start

docker compose up --build

Load Testing with K6

Install K6 first, then run:

k6 run --vus 100 --duration 30s script.js

100 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-end
  • p(90) — 90% of requests completed within this time

K6 metrics reference

Test Endpoint

GET http://localhost/api/v1/multi?x=100&y=100

x * y iterations run in a loop — adjust to simulate different CPU loads.

Observability Endpoints

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

Grafana Setup

  1. Add data source: Configuration → Data Sources → Add → Prometheus → URL: http://prometheus:9090 → Save & Test
  2. Import dashboard: Create → Import → enter a Grafana dashboard ID (e.g. 6756)

Grafana playground · django-prometheus setup

ELK Log Pipeline

Nginx access log → Filebeat → Logstash → Elasticsearch → Kibana

Log index pattern: stress-logs-yyyy.MM.dd

Kibana Visualization

  1. Go to http://localhost:5601
  2. Search Index Management → confirm stress-logs-* indices exist
  3. Analytics → Dashboard → Create data view → pattern: stress-logs-*
  4. Create Visualization → drag fields onto the canvas

Kibana demo

About

부하테스트를 위한 장고 모니터링, nginx 로깅 예제

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages