Uploaded image for project: 'Percona Toolkit'
  1. Percona Toolkit
  2. PT-716

LP #1641635: pt-summary reports wrong memory size

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • None
    • 3.3.1
    • None
    • Yes
    • Yes
    • 1

    Description

      User impact:

      • Data about memory provided by pt-summary are not reliable and this complicates and confuses troubleshooting¬†

      Original reports:

      **Reported in Launchpad by Tibor Korocz last update 22-11-2016 19:38:12

      Hi,

      On a server with 256G memory pt-summary reports 2.5G of memory. See results below:

      1. free -m
        total used free shared buffers cached
        Mem: 258207 256696 1510 383 463 32271
        -/+ buffers/cache: 223961 34245
        Swap: 16383 39 16344
      1. free -mh
        total used free shared buffers cached
        Mem: 252G 251G 1.0G 505M 463M 31G
        -/+ buffers/cache: 218G 33G
        Swap: 15G 39M 15G
      1. cat /proc/meminfo
        MemTotal: 264404376 kB
        MemFree: 1231712 kB
        Buffers: 474832 kB
        Cached: 33537260 kB
        SwapCached: 2824 kB
        Active: 225141140 kB
        Inactive: 34971456 kB

      Pt-summary:

      1. Memory #####################################################
        Total | 2.5G
        Free | 1.7G
        Used | physical = 2.5G, swap allocated = 1.6G, swap used = 39.9M, virtual = 2.5G
        Shared | 244.0k
        Buffers | 436.0M
        Caches | 3.1G

      Checking the code :
      https://github.com/percona/percona-toolkit/blob/2.2/bin/pt-summary#L1171

      We can see pt-summary use `free -b`:

      free -b
      total used free shared buffers cached
      Mem: 2707500810 2700511313 698949632 233472 486223872 3480769740
      -/+ buffers/cache: 2347572101 3599287091
      Swap: 1717986508 41594880 1713827020

      And here we are:

      2707500810 bytes is 2.5G.

      Not sure this is a bug in the tool or not, but we might can check `meminfo`
      results also and if they are not the same, show a warning or something.

      Thanks,
      Tibi

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lpjirasync lpjirasync (Inactive)
              Votes:
              8 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 10 minutes
                  10m

                  Smart Checklist