1827293 Members
2575 Online
109717 Solutions
New Discussion

cache hit Ratio

 
SOLVED
Go to solution
nag_5
Occasional Contributor

cache hit Ratio

Hi,
What is "Cache hit Ratio" on a HP-UX server.

How can i tune this value. One of the HPUX server is giving 100% cache hit ratio

Tks,
1 REPLY 1
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: cache hit Ratio

"Cache Hit Ratio" can mean many things but it is most often used to describe "Disk Read Cache Ratio" or "Disk Write Cache Ratio".

The HP-UX OS maintains a buffer cache that all filesystem i/o goes through. This is referred to as "cooked" i/o as opposed to "raw" i/o that bypasses the buffer cache.

Let's suppose that you want to read block 45 of "/xxx/yyy/myfile". The user process issues a read() system call, the OS then looks to see it that block has already been read and stored in cache, if so then the read is satisfied directly from memory and no disk i/o is needed. If block 45 is not currently in the cache then the disk block is read and stored into cache and the data are copied to the user's process space.

The fraction of reads satisfied by accessing the cache / total number of reads is the "hit ratio".

The kernel maintains a list of most accessed cache blocks so that as the cache fills it can flush the least used blocks to disk to make room for more blocks.

100% is a good thing if you have plenty of memory for other things. Typically, you would like to see read hits in the 90% range and writes in the 70% range but this can vary tremendously. For example, database programs do random i/o all over a filesystem and a given block might not often be reread so in that case, your cache hit ratios might be very low --- and normal.

There are two methods of tuning the buffer cache: dynamic: the size of the buffer cache varies between min_dbc_pct (of total memory) and max_dbc_pct. The other method is a fixed buffer cache size configured by setting bufpages to a non-zero value equal to the number of 4K pages.
If it ain't broke, I can fix that.