Brotli in safe Rust. Zstandard in safe Rust. The same bytes as the C encoders, without the C.

M-Compressors rewrites Brotli and Zstandard in safe Rust with the same output as the C reference encoders, and ships NGINX modules that compress on thread pools.

Posts

  1. zstd on NGINX thread pools: ngx_mzstd vs zstd-nginx-module

    On-the-fly zstd blocks the NGINX event loop. ngx_mzstd on a thread pool against tokers/zstd-nginx-module: p99 latency, requests per second, CPU time and memory.

  2. Brotli on NGINX thread pools: ngx_mbrotli vs ngx_brotli

    On-the-fly Brotli blocks the NGINX event loop. ngx_mbrotli on a thread pool against google/ngx_brotli: p99 latency, requests per second, CPU time and memory.

  3. Building the ngx_mzstd Zstandard module for NGINX from source

    How to build ngx_mzstd from source against nginx from nginx.org's official repository, on Debian, Ubuntu, RHEL-compatible and other Linux systems, or against an nginx you compile yourself.

  4. Building the ngx_mbrotli Brotli module for NGINX from source

    How to build ngx_mbrotli from source against nginx from nginx.org's official repository, on Debian, Ubuntu, RHEL-compatible and other Linux systems, or against an nginx you compile yourself.

  5. Installing Zstandard for NGINX from packages: ngx_mzstd

    How to install the ngx_mzstd Zstandard module with apt or dnf on Debian, Ubuntu, RHEL, AlmaLinux, Rocky Linux and Amazon Linux, for nginx.org's nginx and for the distribution's own.

  6. Installing Brotli for NGINX from packages: ngx_mbrotli

    How to install the ngx_mbrotli Brotli module with apt or dnf on Debian, Ubuntu, RHEL, AlmaLinux, Rocky Linux and Amazon Linux, for nginx.org's nginx and for the distribution's own.

Projects

mbrotli Rust crate, 0.5.16
Google Brotli in safe Rust: encoder ported from the C reference with the same output at qualities 0–11, a native decoder, Read/Write adapters and parallel compression on your own threads. crates.io docs.rs
mzstd Rust crate, 0.2.8
Zstandard (RFC 8878) in safe Rust: single-threaded output byte-identical to zstd 1.5.7, a decoder written from the specification, no_std and a C ABI. crates.io docs.rs
ngx_mbrotli NGINX module, 0.4.5
Drop-in replacement for google/ngx_brotli that can compress on NGINX thread pools, so large responses no longer block the worker's event loop.
ngx_mzstd NGINX module, 0.2.3
Drop-in replacement for tokers/zstd-nginx-module with encoder reuse and thread-pool compression.
borrowed-buf Rust crate, 0.1.1
A small no_std port of the nightly-only core::io::BorrowedBuf and BorrowedCursor for stable Rust 1.89. crates.io