Wednesday, April 20, 2011

Checking AIX cache

The cache area is a memory area where the operating system places blocks of files used often, therefore reducing costly I/O to slower devices like hard disks. It is a good concept and very useful for boosting performance of file servers (NFS, samba), but is not so good for database software like Oracle because an instance manages its own cache area.

Therefore, if you are an Oracle administrator of databases in AIX servers it's a good practice to be aware of memory configuration and usage, and maybe help a bit your fellow sysadmin just in case. The important parameters to check are the minimum and maximum percentage of RAM for file caching purposes (minperm% and maxperm%):

root:myserver> vmstat -v
2621440 memory pages
2525761 lruable pages
180000 free pages
4 memory pools
647419 pinned pages
80.0 maxpin percentage
20.0 minperm percentage
80.0 maxperm percentage
24.8 numperm percentage
627654 file pages
0.0 compressed percentage
0 compressed pages
24.8 numclient percentage
25.0 maxclient percentage
627654 client pages
0 remote pageouts scheduled
58246 pending disk I/Os blocked with no pbuf
10544297 paging space I/Os blocked with no psbuf
2228 filesystem I/Os blocked with no fsbuf
805 client filesystem I/Os blocked with no fsbuf
2215609 external pager filesystem I/Os blocked with no fsbuf
0 Virtualized Partition Memory Page Faults
0.00 Time resolving virtualized partition memory page faults

As you can see in this example, there is a lot of minimum memory allotted for file caching (20%) and wasted because Oracle caching is better for Oracle databases than operating system caching, but you can't assign that 20% RAM space to Oracle unless you change the virtual memory AIX parameters.

Moreover, the maximum memory reserved for file caching is limited by the maxclient percentage (25%) so in this system you can use up to 25% of RAM for file caching of non-JFS filesystem files and the other 55% for caching files of JFS filesystems. You can check JFS memory pages usage with this command:

root:myserver> svmon -G
size inuse free pin virtual
memory 2621440 2442500 178940 647452 2186997
pg space 5373952 925157

work pers clnt other
pin 562525 0 0 84927
in use 1734676 0 707824

PageSize PoolSize inuse pgsp pin virtual
s 4 KB - 2326020 925157 571068 2070517
m 64 KB - 7280 0 4774 7280

You might notice that there are 0 pages used for JFS file caching (pers), and that might be because there are no JFS file systems in this server:

root:myserver> mount
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ---------------
/dev/hd1 / jfs2 Jun 05 19:09 rw,log=/dev/hd8
/dev/hd2 /usr jfs2 Jun 05 19:09 rw,log=/dev/hd8
/dev/hd5 /var jfs2 Jun 05 19:10 rw,log=/dev/hd8
/dev/hd3 /tmp jfs2 Jun 05 19:10 rw,log=/dev/hd8
/dev/hd4 /home jfs2 Jun 05 19:11 rw,log=/dev/hd8
/proc /proc procfs Jun 05 19:11 rw
/dev/hd6 /opt jfs2 Jun 05 19:11 rw,log=/dev/hd8
/dev/fslv00 /myfs jfs2 Jun 05 19:11 rw,log=/dev/loglv00

IBM recommends setting the parameters as follows:

maxperm = 90%
maxclient = 90%
minperm = 3%

More information:

Tuning the AIX file caches
Overview of AIX page replacement

No comments:

Post a Comment