mysqlguy.net

STATUS variables: the difference between innodb_pages_read and innodb_buffer_pool_reads

Submitted by jay on February 25, 2008 - 1:17pm

I haven't gotten any responses to my question from Friday, so I figured I'd post a more direct question:


The two variables 'innodb_pages_read' and 'innodb_buffer_pool_reads' are different.  'Innodb_pages_read' seems consistently higher than the buffer_pool_reads.  Certainly the buffer pool reads 'pages', but what else would be counted as a page read?


On the flip side, 'innodb_pages_written' and 'innodb_buffer_pool_pages_flushed' seem consistent.  

Anyone have any clues?

Trackback URL for this post:

http://mysqlguy.net/trackback/15

from this link

from this link http://johnjacobm.wordpress.com/2007/06/

Innodb_buffer_pool_reads = "The number of logical reads that InnoDB could not satisfy from buffer pool and had to do a single-page read."

Innodb_pages_read="The number of pages read"

I hope that makes it a bit more clear.






jay's picture

Unfortunately, no.  That

Unfortunately, no.  That appears to be exactly what the manual states as well.  


If it was a matter of logical to physical reads, then innodb_buffer_pool_read_requests would equal innodb_pages_read, but it doesn't.  

Innodb_buffer_pool_read_requests > (much >) Innodb_pages_read > Innodb_buffer_pool_reads

What innodb_pages_read - innodb_buffer_pool_reads means is what I'm after.  

innodb_page_reads are the

innodb_page_reads are the actual number of pages read from the innodb_buffer_pool

-Bruce

jay's picture

Ok, but how does that differ

Ok, but how does that differ from "Innodb_buffer_pool_reads".

BTW, I'm going to sit down and grok the source tomorrow to figure this out.

Innodb_buffer_pool_reads is

Innodb_buffer_pool_reads is how many it had to go to disk for because it couldn't get the data from the innodb buffer pool itself.  Compare that with innodb_buffer_pool_read_requests...

buffer pool read performance = innodb_buffer_pool_reads / innodb_buffer_pool_read_requests.

Each read request can read multiple pages AFAIK.

I did grok the source and that's what I found for innodb_page_reads.  : )

-Bruce

jay's picture

I get that, but what about

I get that, but what about 'innodb_page_reads'?  It seems to equal neither of those two metrics. 

It doesn't equal the other

It doesn't equal the other metrics because I believe multiple pages can be read from the innodb_buffer_pool at one time.

It is simply the actual number of pages that have been read from the innodb_buffer_pool, nothing more.


Innodb_pages_read is


Innodb_pages_read is incremented whenever a file page is read from buffer pool. And when the page is not there in the buffer, InnoDB reads from disk to a new buffer while incrementing Innodb_buffer_pool_reads.

I would like to put it this way. Innodb_pages_read are the pages read from buffer pool and Innodb_buffer_pool_reads are the pages read for the buffer pool.

References:
1. http://forge.mysql.com/wiki/MySQL_Internals_Files_In_InnoDB_Sources [\buf (Buffering) section]
2. buf0buf.c
3. buf0rea.c

Warning!

Comment abuse is not tolerated on this site, besides all the comments are moderated, so don't bother posting comments that are not on topic, only for increasing the SEO of your site, or are outright spam.  If you've got something intelligent to contribute, by all means, post a link to your blog.  

About Me

Jay Janssen
Yahoo!, Inc.
jayj at yahoo dash inc dot com
MySQL
High Availability
Global Load Balancing
Failover
View Jay Janssen on Twitter  View Jay Janssen's LinkedIn profile View Jay Janssen's Facebook profile