1

I have two processes that peform differently on two boxes that are identical except for the amount of ram. One box has 32GB and the other has 16GB and the process performs significantly better on the former. The process itself does not use all that much memory, but it does read many large files. I suspect that it peforms better on the 32GB box because linux is able to cache more of the files due to the extra memory. However, I am not sure how to prove this. How I can tell if files are being read from the cache versus from the disk? Of course I can simply time the reads and see if they are performing better, but I want to be see why they are performing better.

frankc
  • 111
  • 3
  • Possible duplicate of http://serverfault.com/questions/157612/is-there-a-way-to-get-cache-hit-miss-ratios-for-block-devices-in-linux – Jeff Ferland Aug 08 '11 at 19:27

2 Answers2

2

Use iostat or sar to examine the disk I/O statistics on the running systems. Assuming an equivalent volume of I/O requests, the machine that is doing more caching will show a lower disk I/O rate.

womble
  • 95,029
  • 29
  • 173
  • 228
0

I can do this using mincore() function

frankc
  • 111
  • 3