# M-Compressors > Engineering blog of M-Compressors: Brotli and Zstandard rewritten in safe Rust, byte-identical to the C reference encoders, plus NGINX modules that compress on thread pools. Benchmarks, design notes and release write-ups. M-Compressors is an open-source organization on GitHub (https://github.com/M-Compressors) maintained by Mikhail Panfilov (https://m-compressors.github.io/authors/mikhail-panfilov/): Backend developer from Saint Petersburg, working at Aisory. Author of mbrotli, mzstd and the ngx_mbrotli and ngx_mzstd NGINX modules: Brotli and Zstandard rewritten in safe Rust. Its codecs are written in Rust with `unsafe` forbidden in production code. Key facts: - mbrotli writes the same bytes as Google Brotli 1.2.0 at qualities 0–11 under equivalent streaming settings. In the independent lzbench 2.4 run (Silesia corpus, one core of an AMD EPYC 9555P) mbrotli 0.5.2 compressed 14–20% faster than Google Brotli at qualities 8 and 11, with the same compressed size; decompression was 3–10% slower. - mzstd's single-threaded output is byte-identical to zstd 1.5.7 at levels -131072 to 22. In the project's own benchmarks it compresses at a median 1.112× and decompresses at 1.111× zstd's speed. - ngx_mbrotli and ngx_mzstd are drop-in replacements for google/ngx_brotli and tokers/zstd-nginx-module that can compress on NGINX thread pools (`brotli_thread_pool default;`, `zstd_thread_pool default;`). ## Projects - [mbrotli](https://github.com/M-Compressors/mbrotli): Rust crate, version 0.5.16, MIT OR Apache-2.0. 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. Crate: https://crates.io/crates/mbrotli, API docs: https://docs.rs/mbrotli - [mzstd](https://github.com/M-Compressors/mzstd): Rust crate, version 0.2.8, MIT OR Apache-2.0. 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. Crate: https://crates.io/crates/mzstd, API docs: https://docs.rs/mzstd - [ngx_mbrotli](https://github.com/M-Compressors/ngx_mbrotli): NGINX module, version 0.4.5, MIT. 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](https://github.com/M-Compressors/ngx_mzstd): NGINX module, version 0.2.3, MIT. Drop-in replacement for tokers/zstd-nginx-module with encoder reuse and thread-pool compression. - [borrowed-buf](https://github.com/M-Compressors/borrowed-buf): Rust crate, version 0.1.1, MIT. A small no_std port of the nightly-only core::io::BorrowedBuf and BorrowedCursor for stable Rust 1.89. Crate: https://crates.io/crates/borrowed-buf ## Posts - [zstd on NGINX thread pools: ngx_mzstd vs zstd-nginx-module](https://m-compressors.github.io/2026/ngx-mzstd-thread-pool-benchmarks/): 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. - [Brotli on NGINX thread pools: ngx_mbrotli vs ngx_brotli](https://m-compressors.github.io/2026/ngx-mbrotli-thread-pool-benchmarks/): 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. - [Building the ngx_mzstd Zstandard module for NGINX from source](https://m-compressors.github.io/2026/build-ngx-mzstd-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. - [Building the ngx_mbrotli Brotli module for NGINX from source](https://m-compressors.github.io/2026/build-ngx-mbrotli-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. - [Installing Zstandard for NGINX from packages: ngx_mzstd](https://m-compressors.github.io/2026/install-ngx-mzstd-packages/): 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. - [Installing Brotli for NGINX from packages: ngx_mbrotli](https://m-compressors.github.io/2026/install-ngx-mbrotli-packages/): 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. ## Optional - [About](https://m-compressors.github.io/about/): who maintains the projects and how to reach them - [Mikhail Panfilov](https://m-compressors.github.io/authors/mikhail-panfilov/): the author's page, with links to GitHub, crates.io, Telegram and LinkedIn - [Full text for LLMs](https://m-compressors.github.io/llms-full.txt): every post as plain text in one file - [RSS feed](https://m-compressors.github.io/feed.xml)