[ale] Disk performance

Ed Cashin ecashin at noserose.net
Mon Aug 26 10:41:15 EDT 2013


On Sun, Aug 25, 2013 at 11:36 PM, Alex Carver <agcarver+ale at acarver.net>wrote:

> On 8/25/2013 19:34, Brian Mathis wrote:
>
>>
>> The 'free' command will directly show you how much of the used RAM is in
>> buffers/cache, and how much is in use by programs.  As far as reducing RAM
>> used for cache, you almost always don't want to do that.  RAM is both fast
>> and expensive, so unused RAM is wasted RAM.  Linux is smart enough to be
>> able to free buffers/cache when a program needs to use it.
>>
>
> I know in theory it's supposed to be smart enough but I don't think that's
> the case on this particular system.  It appears to be caching things that
> don't get reused so there's almost no value to the cache.
>
> The main job of this particular system is to log data and then present a
> few micro websites (20-30kB pages) that update regularly.  Each page is
> dynamic (generated each visit by polling the database) so there isn't much
> to cache.
>

Sometimes stuff that's cached is "free" even though it doesn't show up as
"free".  :)

For example, if there are blocks on disk that are part of the apache
executable, then those blocks get mapped read-only into memory.  You can
see regions like that in the "maps" in /proc.

  awk '$2~/r/&&$2!~/rw/{print}' /proc/$$/maps

If the system needs a free page of memory to, e.g., run awk, then all that
stuff is essentially ready to be used, since the blocks can be read from
disk if they're needed again.  So even though it doesn't show up as free,
it's usable.

The cached data that cannot be used is dirty data, and sometimes there's an
advantage to telling the kernel to flush out writes from RAM to the slower
backing store, disk or whatever.  And yes, there are knobs for that.


More information about the Ale mailing list