Operating System - HP-UX
1836585 Members
2647 Online
110102 Solutions
New Discussion

Logical vs. Physical reads?

 
Alex Georgiev
Regular Advisor

Logical vs. Physical reads?

I have a couple of questions about performance stats...

Until now I was under the impression that every time a process issues a read() call (or one of it's cousins readv & pread), that would count as a Logical read in Glance and MeasureWare. If the request could not be satisfied from buffer cache and had to retrieved from disk, then it would count as a physical read, as well.

First of all, is the above statement correct?

According to what I'm seeing now, it's not. I have been given an app which opens several files and does random preads() from each of the files, always in 8K blocks.

I've been looking at the app with Glance, and in the Process Resources screen (R key in Glance) I'm only seeing physical reads. Never any logical reads.

Why is that?

Through a little experimentation I was able to determine that if an 8K block is in buffer cache, the physical read IO doesn't register in glance. In other words, if the app does 10 preads(), and all of them are satisfied from buffer cache, then the Physical reads counter in Glance will not increment. Unfortunately, the Logical reads counter doesn't increment, either.

Is this normal, or is my glance broken?

What exactly are logical reads?

P.S. It goes without saying that good points will be given for good explanations. Many thanks in advance!
2 REPLIES 2
Pete Randall
Outstanding Contributor

Re: Logical vs. Physical reads?

Hi Alex,

I'm quoting from Glance's own help files here:

"Physical I/O

A input/output operation where data is transferred from memory to disk or vice-versa. Physical IO includes file system IO, raw IO, system IO and virtual memory IO.

Logical I/O

A read or write system call to a file system to obtain data. Because of the effects of buffer caching, this operation may not require a physical access to the disk if the buffer is located in the buffer cache."


That, I think, agrees with your (and my) interpretation. Why you're seeing only physical reads I'm not sure.


Pete

Pete
Pete Randall
Outstanding Contributor

Re: Logical vs. Physical reads?

P.S. Perhaps version and patch level info might prove helpful.


Pete

Pete