Skip to content

Archives

Debunking zswap and zram myths

  • Debunking zswap and zram myths

    This is pretty compelling. I like this example:

    We have some concrete numbers to show this in practice. On Instagram, which runs on Django and is largely memory bound, we ran a test where we moved from their existing setup (with swap entirely disabled) to a setup with disk swap and zswap tiering. Django workers accumulate significant cold heap state over their lifetime, like forked processes with duplicated memory, growing request caches, Python object overhead, you get the idea. The results were twofold:

    • We achieved roughly 5:1 compression. That's a huge benefit for such a memory bound workload, and also enables us to consider further stacking workloads.
    • Enabling zswap reduced disk writes by up to 25% compared to having no swap at all(!).

    As you can imagine, as a result of this test, Instagram has been using zswap for many years now.

    Tags: kernel compression memory linux ops performance swap zswap zram