Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8932

innodb buffer pool hit rate is less than zero

Details

    Description

      When I set my.cnf like this:

      innodb_buffer_pool_size = 102400M
      innodb_buffer_pool_dump_at_shutdown=1
      innodb_buffer_pool_dump_now=1
      innodb_buffer_pool_load_at_startup=1
      innodb_buffer_pool_load_now=1

      and use (1-Innodb_buffer_pool_reads/Innodb_buffer_pool_read_requests)*100% to calculate innodb buffer pool hit rate ,I got a number less than zero,like

      +----------------------+
      | hit_rate             |
      +----------------------+
      | -0.04231484607035707 |
      +----------------------+

      ,and

      MariaDB [(none)]> show global status like 'innodb_buffer_pool_read%';
      +---------------------------------------+----------+
      | Variable_name                         | Value    |
      +---------------------------------------+----------+
      | Innodb_buffer_pool_read_ahead         | 0        |
      | Innodb_buffer_pool_read_ahead_evicted | 0        |
      | Innodb_buffer_pool_read_ahead_rnd     | 0        |
      | Innodb_buffer_pool_read_requests      | 13973819 |
      | Innodb_buffer_pool_reads              | 13979732 |
      +---------------------------------------+----------+

      I found Innodb_buffer_pool_reads is bigger than Innodb_buffer_pool_read_requests!

      When the server is loading pages at the start time,I execute show engine innodb status ,and I also see a negative number like:

      Buffer pool hit rate 18446744073709549183 / 1000, young-making rate 0 / 1000 not 0 / 1000
      Buffer pool hit rate 18446744073708648991 / 1000, young-making rate 0 / 1000 not 0 / 1000
      Buffer pool hit rate 18446744073709549537 / 1000, young-making rate 0 / 1000 not 0 / 1000
      Buffer pool hit rate 18446744073709551510 / 1000, young-making rate 0 / 1000 not 0 / 1000

      Obviously it's a negative number in unsigned long int.

      Attachments

        Issue Links

          Activity

            Assigning to jplindst for advice on why it could be happening. I can only think of disk problems, but I suppose it would have been detected.

            elenst Elena Stepanova added a comment - Assigning to jplindst for advice on why it could be happening. I can only think of disk problems, but I suppose it would have been detected.
            linzhoukai Zhoukai Lin added a comment -

            There are several servers have this problem. So it may not be disk problems.

            linzhoukai Zhoukai Lin added a comment - There are several servers have this problem. So it may not be disk problems.

            Innodb_buffer_pool_read_requests indicates the the number of logical read requests (read from memory) InnoDB has done.
            Innodb_buffer_pool_reads indicates the number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from the disk (physical reads). This means that read_requests and reads may be different. You should calculate the hit ratio with

            Innodb_buffer_pool_read_requests / (Innodb_buffer_pool_read_requests + Innodb_buffer_pool_reads) * 100

            There seems to be a bug on calculation when buffer pool is loaded.

            jplindst Jan Lindström (Inactive) added a comment - Innodb_buffer_pool_read_requests indicates the the number of logical read requests (read from memory) InnoDB has done. Innodb_buffer_pool_reads indicates the number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from the disk (physical reads). This means that read_requests and reads may be different. You should calculate the hit ratio with Innodb_buffer_pool_read_requests / (Innodb_buffer_pool_read_requests + Innodb_buffer_pool_reads) * 100 There seems to be a bug on calculation when buffer pool is loaded.

            commit 4834d822efe5a812d251f254387b3f80beb9380d
            Author: Jan Lindström <jan.lindstrom@mariadb.com>
            Date: Wed Oct 28 08:42:51 2015 +0200

            MDEV-8932: innodb buffer pool hit rate is less than zero

            In buffer pool read hit rate calculation can lead rate that is
            less than zero.

            jplindst Jan Lindström (Inactive) added a comment - commit 4834d822efe5a812d251f254387b3f80beb9380d Author: Jan Lindström <jan.lindstrom@mariadb.com> Date: Wed Oct 28 08:42:51 2015 +0200 MDEV-8932 : innodb buffer pool hit rate is less than zero In buffer pool read hit rate calculation can lead rate that is less than zero.

            People

              jplindst Jan Lindström (Inactive)
              linzhoukai Zhoukai Lin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.