Show HN: Python file streaming 237MB/s on $8/M droplet in 507 lines of stdlib

7 b_llc 2 8/19/2025, 2:02:22 PM bellone.com ↗
Quick Links:

- PyPI: https://pypi.org/project/axon-api/

- GitHub: https://github.com/b-is-for-build/axon-api

- Deployment Script: https://github.com/b-is-for-build/axon-api/blob/master/examp...

Axon is a 507-line, pure Python WSGI framework that achieves up to 237MB/s file streaming on $8/month hardware. The key feature is the dynamic bundling of multiple files into a single multipart stream while maintaining bounded memory (<225MB). The implementation saturates CPU before reaching I/O limits.

Technical highlights:

- Pure Python stdlib implementation (no external dependencies)

- HTTP range support for partial content delivery

- Generator-based streaming with constant memory usage

- Request batching via query parameters

- Match statement-based routing (eliminates traversal and probing)

- Built-in sanitization and structured logging

The benchmarking methodology uses fresh Digital Ocean droplets with reproducible wrk tests across different file sizes. All code and deployment scripts are included.

Comments (2)

SkiFire13 · 59m ago
> The implementation saturates CPU before reaching I/O limits.

Is this supposed to be a pro?

b_llc · 26m ago
Good question! Yes, CPU saturation is the desired behavior here.

The multipart streaming workload is inherently expensive. The cost of generating boundaries and constructing headers scales with request count and payload size. The architecture demonstrates efficient resource utilization: bounded memory usage (<225MB) while maximizing CPU throughput.

CPU saturation with bounded memory means performance scales predictably with processing power. On multicore systems, you can leverage multiple processes to effectively utilize all cores. Alternatively, you can distribute the workload horizontally using droplets as cost-efficient instances.