Cloudflare Company published second release of the framework Pingora, designed for developing secure, high-performance network services in the Rust language. The proxy, built using Pingora, has been used in the Cloudflare content delivery network instead of nginx for about a year and processes more than 40 million requests per second. The code is written in Rust and published licensed under Apache 2.0.
Key features of Pingora:
- Support for HTTP/1 and HTTP/2 (HTTP/3 in plans), as well as the ability to create services using their own protocols or UDP/TCP.
- Possibility of multi-threaded processing of requests in asynchronous mode.
- Support for attaching callback handlers and filters that allow you to manage various stages of request processing, as well as modify, redirect, block and log requests and responses.
- Proxying gRPC and WebSocket.
- Connectable load balancers.
- Ability to change configuration without restarting.
- Support for updating application code without breaking connections.
- Means for load switching in case of failure (failover).
- Integration with various monitoring and logging systems (Syslog, Prometheus, Sentry, OpenTelemetry).
- Support for TLS encryption (using OpenSSL or BoringSSL).
- Ready-made Rust packages for creating HTTP proxies, working with network protocols, parsing HTTP headers, accounting and limiting traffic, load balancing, working with the Ketama distributed hash table, maintaining a cache in RAM and asynchronous processing of timeouts.
Among the changes in the new version:
- Added support for setting filters for additional HTTP/2 headers.
- Added the ability to change the buffer size of incoming packets for TCP.
- Added body_bytes_read() function.
- Added cache_not_modified_filter filter.
- Added the ability to log TLS keys.
- Added callback function purge_response.
Thanks for reading: