Skip to content

nilicule/bandwidthSaturation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bandwidth-saturation

Downloads a large file across N parallel TCP streams and shows live per-stream throughput.

A single TCP stream rarely saturates a fast link — slow-start, congestion control, and RTT all cap it well below the physical limit. Running 4–8 parallel streams bypasses that and gives you a realistic ceiling for your actual available bandwidth.

Requirements

Python 3.13+, no third-party dependencies.

Usage

python3 bandwidth_test.py [num_streams] [--url URL]
python3 bandwidth_test.py            # 4 streams, default URL
python3 bandwidth_test.py 8          # 8 streams, default URL
python3 bandwidth_test.py 8 --url http://example.com/bigfile.bin

Press Ctrl+C to stop at any time.

Example output

  Bandwidth Saturation Test  —  4 streams  —  elapsed: 5s
  Stream      Speed      Downloaded  Bar                     Status
  ──────────────────────────────────────────────────────────────
  Stream 0     237.4 Mbps      284.6 MB  [█████░░░░░░░░░░░░░░░]  active
  Stream 1     241.8 Mbps      290.2 MB  [█████░░░░░░░░░░░░░░░]  active
  Stream 2     235.1 Mbps      282.1 MB  [█████░░░░░░░░░░░░░░░]  active
  Stream 3     238.6 Mbps      286.3 MB  [█████░░░░░░░░░░░░░░░]  active
  ──────────────────────────────────────────────────────────────
  TOTAL        952.9 Mbps        1.1 GB

How it works

Each stream runs in its own thread, downloading the target file with urllib.request. A separate display thread wakes up once per second, computes per-stream throughput from the byte delta since the last tick, and redraws the table in-place using ANSI escape codes — no curses dependency required.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages