In 2017 I wrote "Fastest Redis configuration for Django". Now, I've made an update for 2026 that focuses on comparing default Redis with three compressors:

  • zlib
  • lzma
  • zstd

The results on macOS are:

                        TIMES        AVERAGE   MEDIAN (P50)   MEDIAN (P90)         STDDEV
default                    198        0.181ms        0.176ms        0.216ms        0.038ms
zlib                       213        0.190ms        0.182ms        0.237ms        0.039ms
lzma                       134        0.273ms        0.272ms        0.332ms        0.042ms
zstd                       202        0.192ms        0.180ms        0.243ms        0.046ms

Best Means (shorter better)
###############################################################################
█████████████████████████████████████████                        0.181  default
███████████████████████████████████████████                      0.190  zlib
███████████████████████████████████████████████████████████████  0.273  lzma
████████████████████████████████████████████                     0.192  zstd

Best Medians (shorter better)
###############################################################################
████████████████████████████████████████                         0.176  default
██████████████████████████████████████████                       0.182  zlib
███████████████████████████████████████████████████████████████  0.272  lzma
█████████████████████████████████████████                        0.180  zstd

Size of Data Saved (shorter better)
###############################################################################
████████████████████████████████████████████████████████████████  5151  default
██████████████████████████                                        2151  zlib
█████████████████                                                 1420  lzma
████████████████████████                                          2010  zstd

Size of Data without Default (shorter better)
###############################################################################
███████████████████████████████████████████████████████████████████  2151  zlib
████████████████████████████████████████████                         1420  lzma
██████████████████████████████████████████████████████████████       2010  zstd

The "conclusion", on macOS, is that lzma is slowest but compresses the best. On Ubuntu (in GitHub Actions), the fastest of the compressors is zstd and the best compression is lzma.

But it's a very small difference.

The type of data you store in Redis will matter for your use case. In this experiment, it's storing strings of numbers. Each number is about 10 characters long.

Your email will never ever be published.

Previous:
How to use a list/tuple/array in Django with a raw SQL cursor July 14, 2026 Python, Django
Related by category:
Using AI to rewrite blog post comments November 12, 2025 Python
Comparison of speed between gpt-5, gpt-5-mini, and gpt-5-nano December 15, 2025 Python
Autocomplete using PostgreSQL instead of Elasticsearch December 18, 2025 Python
logger.error or logger.exception in Python March 6, 2026 Python
Related by keyword:
How much faster is Redis at storing a blob of JSON compared to PostgreSQL? September 28, 2019 Python, PostgreSQL, Redis
Brotli compression quality comparison in the real world December 1, 2021 Node, JavaScript
Fastest Redis configuration for Django May 11, 2017 Python, Linux, Web development, Django
Fastest database for Tornado October 9, 2013 Python, Tornado