Thanks for the response.
The real concern comes from administrators or other less technical staff logging into the box, and getting concerned at the amount of memory used up. Although user education is always positively accepted, the general comfort level would be much higher if they could login to a host and not see that 98% of memory is in use.
Regarding performance, this isn't much of a concern, although this host is intermittently hit with large work loads (which is why the kernel cache reaches the point of consuming all memory) which consume much memory, and another thought was that when these sporadic work loads proceed, there would be a slight performance hit waiting for free memory to be available as the cache is cleared.
If this thought is misguided please let me know. Either way, what would be the correct method for tuning the kernel parameters?
Justin.
-----Original Message----- From: Daniel de Kok [mailto:danieldk@pobox.com] Sent: Monday, September 11, 2006 10:36 AM To: CentOS mailing list Subject: Re: [CentOS] kbcached tuning on CentOS 4
On Fri, 2006-09-08 at 10:31 -0400, Justin Randall wrote:
I had been chasing a potential memory leak until "sar -r", had revealed that all the "mysteriously used" memory was actually being taken up by the kernel data cache. It is chewing up all unused memory on the system slowly over time, which is a concern.
Why is this a concern? The larger a cache is, the more potential cache hits. Linux is pretty smart about managing caches and buffers, and will grow/shrink the cache depending on the amount of memory.
-- Daniel
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Regarding performance, this isn't much of a concern, although this host is intermittently hit with large work loads (which is why the kernel cache reaches the point of consuming all memory) which consume much memory, and another thought was that when these sporadic work loads proceed, there would be a slight performance hit waiting for free memory to be available as the cache is cleared.
If this thought is misguided please let me know. Either way, what would be the correct method for tuning the kernel parameters?
The Linux kernel provides very little parameters for the vm. For what it is worth, go read /usr/share/doc/kernel-doc-2.6.9/Documentation/sysctl/vm.txt
You will get this file after installing the kernel-doc package.
On Mon, 2006-09-11 at 11:30 -0400, Justin Randall wrote:
The real concern comes from administrators or other less technical staff logging into the box, and getting concerned at the amount of memory used up. Although user education is always positively accepted, the general comfort level would be much higher if they could login to a host and not see that 98% of memory is in use.
Now, that would be a bad reason for tinkering with VM parameters, /etc/motd solves this problem ;).
Regarding performance, this isn't much of a concern, although this host is intermittently hit with large work loads (which is why the kernel cache reaches the point of consuming all memory) which consume much memory, and another thought was that when these sporadic work loads proceed, there would be a slight performance hit waiting for free memory to be available as the cache is cleared.
Usually there is no such thing as literally clearing a cache. E.g. for the page cache the kernel keeps a list for active pages, and one for inactive pages. So, claiming pages is just a matter of dequeuing pages from the inactive list. Or if the inactive list becomes to short, moving pages from the active list to the inactive list if they weren't referenced recently.
Queuing/dequeuing of items to/from a list are mostly pointer operations, which are very fast, and nowhere as expensive as a cache miss. As I said in my previous e-mail, you need real good reasons to want to change the default kernel VM behavior. Of course, it's your system :).
-- Daniel
On Monday 11 September 2006 11:30, Justin Randall wrote:
The real concern comes from administrators or other less technical staff logging into the box, and getting concerned at the amount of memory used up.
Memory is bought to be used, not to sit idle. And memory is not 'used up' like hard disk space is; memory in use by disk cache is instantly freeable by the kernel, and is not 'used up' in any sense of the phrase.
If this thought is misguided please let me know. Either way, what would be the correct method for tuning the kernel parameters?
Your thought is misguided. The Linux Kernel does a pretty good job of freeing cached disk memory when processes need the memory; you don't need nor do you want to tune it any other way.
If these admins are savvy enough to worry about memory, they are savvy enough to be taught the difference in the types of Linux memory usage.
For instance, on my laptop right now, top tells me: Mem: 1035160k total, 1021300k used, 13860k free, 134616k buffers Swap: 1052216k total, 4k used, 1052212k free, 427556k cached
Ok, I have 13MB of RAM that is sitting there unused, idle, and generally not doing something useful. I have roughly 420MB used in cache, which speeds disk access, but that memory is instantly available if I, say, start up OpenOffice. As long as my swap used number stays low, I'm probably OK as far as memory goes.
Out of 1GB memory, the kernel is using roughly 99% for doing something useful. This is a very good thing; it would be a shame to have paid for 1GB and never use more than 512MB.