A high-performance HTTP package for Go, optimized for speed with zero memory allocations in hot paths.
Fasthttp is a high-performance HTTP package for the Go programming language, specifically tuned for handling thousands of small to medium requests per second with consistent low millisecond response times. It solves the performance limitations of the standard net/http package by eliminating memory allocations in critical code paths and optimizing for speed.
Go developers building high-throughput HTTP servers or clients that need to handle thousands of requests per second, such as API gateways, proxy servers, or real-time services where latency and resource efficiency are critical.
Developers choose Fasthttp when they need maximum HTTP performance in Go, as it provides up to 10x speed improvements over net/http through zero-allocation designs and optimized hot paths, making it ideal for performance-sensitive edge cases.
Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show fasthttp servers are up to 6x faster and clients up to 4x faster than net/http, with zero allocations in hot paths reducing GC pressure.
Successfully serves over 1.5 million concurrent keep-alive connections per physical server in production, as noted in the README from VertaMedia.
Allows setting headers and writing response body in any order, unlike net/http's sequential restrictions, providing more control for advanced use cases.
Encourages zero-allocation designs with unsafe helpers for byte-string conversions and tricks like reusing []byte buffers, minimizing memory overhead.
Deliberately breaks from net/http conventions, requiring manual code rewrites and making it harder to leverage the broader Go ecosystem of net/http-compatible tools.
Lacks native support for HTTP/2.0 and WebSockets, requiring third-party add-ons, and admits net/http handles more HTTP corner cases and is more battle-tested.
Performance optimizations introduce pitfalls like data races if RequestCtx references are held after handlers return, necessitating careful use of TimeoutError and race detection.