Skip to content
ixl55Public

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Stress Test Tool

A comprehensive multi-phase server stress testing tool written in Python. Tests HTTP, HTTPS, TCP, and ICMP layers to identify your server's breaking point under concurrent load.

Features

  • 6-phase progressive load test — from baseline (20 conns) to maximum stress (2000 conns)
  • Multi-protocol — HTTP, HTTPS, TCP, and ICMP ping floods
  • Mix of methods — GET, POST, HEAD, OPTIONS requests with randomized paths and user agents
  • Real-time stats — response times, success/failure rates, and status code distribution
  • Health assessment — automatic grading from EXCELLENT to CRITICAL
  • Failure analysis — breakdown of every error type with percentages
  • Percentile reporting — P50, P95, P99 response times

Requirements

  • Python 3.8+
  • aiohttp library
pip install aiohttp

Quick Start

Option 1: Edit the target in the script

Open stress_test.py and change the DEFAULT_TARGET variable (line 23):

DEFAULT_TARGET = "your-server.com"

Then run:

python stress_test.py

Option 2: Pass target as command-line argument

python stress_test.py your-server.com
python stress_test.py 192.168.1.1
python stress_test.py https://example.com/

The tool automatically strips https://, http://, and trailing slashes.

Test Phases

Phase Concurrency Duration Type
1 — Baseline 20 10s HTTP + HTTPS
2 — Medium 100 15s HTTP + HTTPS
3 — Heavy 500 15s HTTP + HTTPS
4 — TCP Flood 200 per port 10s TCP (ports 22, 80, 443)
5 — Ping Flood 500 pings — ICMP
6 — Maximum 2000 20s HTTP + HTTPS

Total: ~21,000+ requests in under 2 minutes

Understanding Results

Health Assessment Grades

Grade Failure Rate Meaning
EXCELLENT <1% Server handles load perfectly
GOOD <5% Minor strain, acceptable
MODERATE 5-15% Server shows visible strain
WEAK 15-30% Server struggles significantly
CRITICAL >30% Server collapses under load

Response Time Metrics

  • P50 (Median) — half of requests were faster than this
  • P95 — 95% of requests completed within this time
  • P99 — tail latency for slowest 1% of requests
  • Std Dev — consistency of response times (lower = more stable)

Example Output

[PHASE 1] BASELINE TEST (Light Load)

  [STATS] HTTP Baseline (20 conns)
  +-- Total Requests    : 345
  +-- Successes         : 345 (100.0%)
  +-- Failures          : 0 (0.0%)
  +-- Response Time:
  |   +-- Avg  : 549.4 ms
  |   +-- Min  : 94.0 ms
  |   +-- Max  : 4219.0 ms
  |   +-- P50  : 250.0 ms
  |   +-- P95  : 1859.0 ms
  |   +-- P99  : 3828.0 ms
  |   +-- Std  : 729.9 ms
  +-- Status Codes     : 403: 345

Common Issues

100% failures with ClientConnectorDNSError

The domain does not resolve via your system DNS. Try:

  1. Use the server's direct IP instead of the domain
  2. Switch to a public DNS (e.g., Google 8.8.8.8 or Cloudflare 1.1.1.1)
  3. The domain may be behind Cloudflare proxy — check with nslookup

"403 Forbidden" on all requests

Normal — the server is behind nginx and rejecting unauthenticated paths. The tool measures response availability, not content validity. A 403 is still a successful server response.

High failure rate at 500+ concurrency

Your server has a connection limit. Recommendations:

  1. Increase nginx worker_connections
  2. Enable keepalive_timeout and keepalive_requests
  3. Deploy a CDN (Cloudflare, Fastly)
  4. Upgrade VPS resources (CPU, RAM, network)

Configuration

You can customize these values inside the script:

Variable Default Description
DEFAULT_TARGET "169.58.148.152" Target IP or domain
PORTS {80, 443, 22} Ports to test
PATHS 8 common paths URL paths to randomize
METHODS GET, POST, HEAD, OPTIONS HTTP methods to randomize
USER_AGENTS 5 agents User-Agent strings

Adjust concurrency and duration values in each phase function call within main() to customize test intensity.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages