Fincore – how to monitor VM cache (A.K.A. what’s inside)

Back in November 2008, I’ve asked question how to monitor VM cache performance (cache hit ratio) under Linux on Kevin Closson’s blog. Now I’ve just found utility that allows to show pretty nicely what *is* in VM cache. The utility is called “fincore”, it is written in Python and has some strange Python/perl dependecies, but it works:

[oracle@xeno test]$ fincore -justsummarize *.dbf
page size: 4096 bytes
0 pages, 0.0  bytes in core for 10 files; 0.00 pages, 0.0  bytes per file.
[oracle@xeno test]$ echo $ORACLE_SID
oceperf
[oracle@xeno test]$ sqlplus "/ as sysdba"

SQL*Plus: Release 11.1.0.6.0 - Production on Tue Mar 17 10:35:01 2009

Copyright (c) 1982, 2007, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup;
ORACLE instance started.

Total System Global Area  535662592 bytes
Fixed Size                  1301112 bytes
Variable Size             348128648 bytes
Database Buffers          180355072 bytes
Redo Buffers                5877760 bytes
Database mounted.
Database opened.
SQL> show parameter filesystem

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
filesystemio_options                 string      none
SQL>


So let’s verify again (11g on Linux uses O_DIRECT IO by default).

[oracle@xeno test]$ fincore -justsummarize *.dbf
page size: 4096 bytes
0 pages, 0.0  bytes in core for 10 files; 0.00 pages, 0.0  bytes per file.
[oracle@xeno test]$

Use those DBF files with VM cache (trick):

[oracle@xeno test]$ cat *.dbf > /dev/null
[oracle@xeno test]$ fincore -justsummarize *.dbf
page size: 4096 bytes
154788 pages, 604.6 Mbytes in core for 10 files; 15478.80 pages, 60.5 Mbytes per file.
[oracle@xeno test]$

But not all is cached:

[oracle@xeno test]$ du -sh *.dbf
5.1M    ble.dbf
431M    sysaux01.dbf
551M    system01.dbf
131M    temp01.dbf
3.2M    temp02.dbf
226M    undotbs01.dbf
33M     undotbs2.dbf
33M     undotbs3.dbf
21M     uniform2_01.dbf
348M    users01.dbf
[oracle@xeno test]$
[oracle@xeno test]$ fincore -justsummarize undotbs3.dbf
page size: 4096 bytes
3029 pages, 11.8 Mbytes in core for 1 file; 3029.00 pages, 11.8 Mbytes per file.
[oracle@xeno test]$ ls -alh undotbs3.dbf
-rw-r----- 1 oracle oinstall 33M Feb 27 14:34 undotbs3.dbf
[oracle@xeno test]$

And we have total ~917 MB cached in VM:

[oracle@xeno test]$ grep ^Cached /proc/meminfo
Cached:         939208 kB
[oracle@xeno test]$

The fincore uses mincore(2) syscall, and it appeared in the old days of 2.3.99pre1, so it should work on most of your old boxes, provided that somebody would get rid of that python dependency ;)

Comments are closed.