Get started with Flux in 5 minutes!
- Docker installed and running
- Basic understanding of HTTP APIs
cd flux
./build.shOr manually:
docker build -t flux:latest .Create the required directories:
mkdir -p data resultsWe provide several ready-to-use examples:
# Simple GET request
./run-example.sh samples/simple-get.yaml
# POST with JSON body
./run-example.sh samples/simple-post.yaml
# Multi-step authentication scenario
./run-example.sh samples/scenario-auth.yamlCreate config.yaml:
target: "https://jsonplaceholder.typicode.com/posts"
method: "GET"
headers:
Accept: "application/json"
concurrency: 10
duration: "10s"
mode: "async"
output:
json: "/app/results/output.json"
html: "/app/results/report.html"docker run --rm \
-v $(pwd)/config.yaml:/app/config.yaml \
-v $(pwd)/data:/app/data \
-v $(pwd)/results:/app/results \
flux:latestYou'll see real-time progress:
═══════════════════════════════════════════════════════════════════
⚡ Flux Load Test Started
═══════════════════════════════════════════════════════════════════
Target : https://jsonplaceholder.typicode.com/posts
Concurrency : 10 workers
Duration : 10s
Mode : ASYNC
═══════════════════════════════════════════════════════════════════
[00:00:05] [████████████████████░░░░░░░░░░░░] 5/10s (5s)
RPS: 245 | Avg Latency: 42ms | Errors: 0 (0.0%)
Open results/report.html in your browser to see:
- Beautiful charts and graphs
- Latency distribution
- Status code breakdown
- Detailed statistics
The results/output.json contains raw data for further analysis.
target: "https://api.example.com/users"
method: "GET"
headers:
Authorization: "Bearer YOUR_TOKEN"
concurrency: 20
duration: "30s"
mode: "async"
output:
json: "/app/results/api-test.json"
html: "/app/results/api-test.html"target: "https://api.example.com/upload"
method: "POST"
multipart:
- type: "file"
name: "document"
path: "/app/data/myfile.pdf"
- type: "field"
name: "description"
value: "Test upload"
concurrency: 5
duration: "15s"
mode: "async"
output:
json: "/app/results/upload-test.json"
html: "/app/results/upload-test.html"target: "https://api.example.com"
scenarios:
- name: "login"
method: "POST"
url: "/auth/login"
headers:
Content-Type: "application/json"
body: |
{
"username": "test",
"password": "secret"
}
extract:
token: "$.access_token"
- name: "get-profile"
method: "GET"
url: "/profile"
headers:
Authorization: "Bearer {{ token }}"
depends_on: "login"
concurrency: 10
duration: "20s"
mode: "async"
output:
json: "/app/results/auth-test.json"
html: "/app/results/auth-test.html"Begin with low concurrency and short duration:
concurrency: 5
duration: "10s"Then gradually increase to find your system's limits.
Watch CPU and memory usage:
# In another terminal
docker statsFor maximum throughput, use async mode:
mode: "async"The HTML report provides visual insights that are easier to understand than raw numbers.
Always test your configuration locally before running against production systems.
Solution: Check that your YAML syntax is correct:
# Validate YAML syntax
python3 -c "import yaml; yaml.safe_load(open('config.yaml'))"Solution: Ensure files are in the data/ directory:
ls -la data/Solution: Check that the target URL is accessible:
curl -I https://your-target-url.comSolution:
- Reduce concurrency
- Increase duration to spread load
- Check target server capacity
- Read the full README:
README.mdfor detailed documentation - Explore samples: Check
samples/directory for more examples - Customize reports: Modify
src/templates/report.htmlif needed - Scale up: Increase concurrency and duration for real load tests
- Check
README.mdfor detailed documentation - Review
IMPLEMENTATION.mdfor technical details - Examine sample configurations in
samples/
Here's a complete example session:
# 1. Build
./build.sh
# 2. Create config
cat > config.yaml << 'EOF'
target: "https://jsonplaceholder.typicode.com/posts/1"
method: "GET"
concurrency: 10
duration: "10s"
mode: "async"
output:
json: "/app/results/test.json"
html: "/app/results/test.html"
EOF
# 3. Create directories
mkdir -p data results
# 4. Run test
docker run --rm \
-v $(pwd)/config.yaml:/app/config.yaml \
-v $(pwd)/data:/app/data \
-v $(pwd)/results:/app/results \
flux:latest
# 5. View results
open results/test.html # macOS
xdg-open results/test.html # LinuxOn modern hardware (4 cores, 8GB RAM), you can expect:
- Simple GET: 5,000-10,000 RPS
- POST with JSON: 3,000-8,000 RPS
- Multipart uploads: 500-2,000 RPS
- Multi-step scenarios: 1,000-5,000 RPS
Actual performance depends on:
- Network latency
- Target server capacity
- Request/response size
- System resources
Happy Load Testing! ⚡