New memory management method from Facebook

One of the members of the social network development team Facebook, Roman Gushchin, proposed in the developers' mailing list a set of patches for the Linux kernel, aimed at improving memory management through the implementation of a new control mechanism — slab (slab memory controller).

Slab allocation — is a memory management mechanism designed for more efficient memory allocation and significant fragmentation reduction. The basis of this algorithm is the retention of allocated memory containing an object of a certain type, and the reuse of this memory for the next allocation of an object of the same type. This method was first introduced in SunOS by Jeff Bonwick and is now widely used in the kernels of many Unix operating systems, including FreeBSD and Linux.

The new controller is based on transferring slab accounting from the memory page level to the kernel object level, which allows the sharing of a single slab page across different cgroups instead of allocating a separate cache for each cgroup.

Test results indicate that the proposed memory management method increases the efficiency of slab usage by up to 45%, as well as reduces the overall memory consumption by the OS kernel. Additionally, by reducing the number of slab pages allocated, the overall memory fragmentation decreases, which positively affects system performance.

The new controller has been tested on Facebook's production servers for several months now, and so far the testing can be deemed successful: with no performance losses or increased error rates, a notable decrease in memory usage has been observed — on some servers, up to 1GB. This number is quite subjective; earlier conducted tests showed slightly smaller results:

  • 650-700 MB on the web frontend
  • 750-800 MB on the database caching server
  • 700 MB on the DNS server

>>> Author's page on GitHub


>>> Results of early tests

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster