If you ever noticed /proc/slabinfo, its contents surely mystified you. That documentation is as geeky as it gets. There's a "slabtop" command that supposedly makes it more comprehensible but probably does not. Basically, it's information about internal kernel caches. "Slabs" are small allocations of memory, less than a page or not a multiple of page size. The kernel needs a lot of these odd sized chunks for caches.
I first came across mention of /proc/slabinfo in a performance tuning book, which suggested that the statistics here could be useful in determining where your kernel is using too much memory. Of course that's true, but unless you have a baseline for comparison, you wouldn't know what's normal and what isn't. For example, here's part of "slabtop" on a 2.6 webserver:
223533 221207 98% 0.14K 8279 27 33116K dentry_cache 165902 165870 99% 0.34K 15082 11 60328K linvfs_icache 165902 165870 99% 0.36K 15082 11 60328K xfs_inode 48636 39464 81% 0.27K 3474 14 13896K radix_tree_node 37976 37493 98% 0.46K 4747 8 18988K ext3_inode_cache 23550 20517 87% 0.05K 314 75 1256K buffer_head 5734 5658 98% 0.08K 122 47 488K vm_area_struct
Obviously the biggest kernel caches here are for directory entries (dentry_cache). That probably makes sense; I guess I'd expect directory caches to be much higher than tcp related caches. But again, unless I had experience and knowledge of what's normal here, this doesn't help me.
You can find a few interesting threads that mention this by Googling "slabinfo tuning", but the few I looked at were disappointing and didn't enlighten me much..
Got something to add? Send me email.
More Articles by Tony Lawrence © 2012-07-20 Tony Lawrence
Anyone who puts a small gloss on a fundamental technology, calls it proprietary, and then tries to keep others from building on it, is a thief. (Tim O'Reilly)