Date: Thu, 26 Dec 2013 11:28:03 -0500 From: John Baldwin <jhb@freebsd.org> To: freebsd-hackers@freebsd.org Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>, Mark van der Meulen <mark@fivenynes.com> Subject: Re: vmstat buckets Message-ID: <201312261128.03527.jhb@freebsd.org> In-Reply-To: <4260012E-9911-47AB-88B9-FDCD6748E6EE@fivenynes.com> References: <4260012E-9911-47AB-88B9-FDCD6748E6EE@fivenynes.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, December 25, 2013 6:02:42 am Mark van der Meulen wrote: > Hi All, > > I have question about buckets in vmstat -z output which I haven’t been able to find an answer for online… > > I have 6 FreeBSD 9 boxes running as routers and they are seeing varying results in vmstat -z. I’m interested in understanding what the Buckets represent/mean and how I can influence usage of them. > > Some of the routers show 0 free buckets under 64 or 128 Bucket and so I did some research and haven’t been able to find out what it means - most people who have asked online have received an answer that it is nothing to worry about, which is meaningless to me. > > It seems that the higher the usage of the router, especially when it is also running userspace applications the less Bucket availability there is. Also I found someone speculating it was related to free kernel memory so that was updated on some routers however I saw little difference(although not sure if adding it in /etc/sysctl.conf actually does anything as some haven’t had the vm.kmem_size value change at all, despite reboots). > > Can anyone explain what the buckets (16,32,64,128) do and what they represent? Also if you know anything about troubleshooting bucket failures? There doesn’t appear to be anything useful online despite many searches. > > I am aware that it may not have anything to do with the problems I am seeing, but I would still like to understand. They are used to back malloc(9). The in-kernel malloc(2) rounds allocations smaller than a page up to the next power of two and then allocates that from a UMA zone for that power of two. For example, the '128' bucket is used for all calls to malloc(9) for a size between 65 and 128. vmstat -m can give you a sense of which buckets each malloc type uses, but it doesn't give you a very detailed breakdown. However, if you compare snapshots of vmstat -m taken along with your vmstat -z snapshots, you might be able to infer which malloc buckets are seeing activity and use that to see which malloc types correspond to the stats you care about from vmstat -z. -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312261128.03527.jhb>
