Facebook's New Linux Slab Memory Controller Saving 30~40%+ Of Memory, Less Fragmentation
Back in September we wrote about Facebook's Roman Gushchin working on a new slab memory controller/allocator implementation that in turn could provide better memory utilization and less slab memory usage. This wasn't ready in time for the 5.5 kernel but a revised patch series was sent out last week.
Roman continues to talk up this new slab memory controller with it turning out much better than the existing slab memory code, which he says in Facebook production workloads is only seeing 45~65% slab utilization and at best case around 85%. This controller rework aims for better slab utilization and also sharing of slab pages between multiple memory cgroups. The memory accounting is done now per-object rather than per-page, among other changes.
In their testing they found when running a web front-end it used around 42% less slab memory, a database caching server used around 35% less, and a DNS server used around 36% less. In general there are 30 to 40% savings while also having other benefits like less memory fragmentation. But there is the risk of potential CPU regressions still being explored.
Those interested in this interesting Facebook kernel engineering work and what could be on the way to a stable kernel in 2020 can be found via this patch series.
Roman continues to talk up this new slab memory controller with it turning out much better than the existing slab memory code, which he says in Facebook production workloads is only seeing 45~65% slab utilization and at best case around 85%. This controller rework aims for better slab utilization and also sharing of slab pages between multiple memory cgroups. The memory accounting is done now per-object rather than per-page, among other changes.
In their testing they found when running a web front-end it used around 42% less slab memory, a database caching server used around 35% less, and a DNS server used around 36% less. In general there are 30 to 40% savings while also having other benefits like less memory fragmentation. But there is the risk of potential CPU regressions still being explored.
Those interested in this interesting Facebook kernel engineering work and what could be on the way to a stable kernel in 2020 can be found via this patch series.
19 Comments