Ticket #119 (closed task: fixed)

Opened 6 years ago

Last modified 7 months ago

Memory plugin computes wrong apps.value on EM64T linux kernel

Reported by: lars at linpro no Assigned to: janl
Priority: high Milestone:
Component: plugins Version: 1.2.0
Severity: minor Keywords: memory
Cc:

Description

The memory plugin displays wrong apps memory on a EM64T linux kernel:

shell# munin-run memory
slab.value 19378176
swap_cache.value 0
page_tables.value 1720320
vmalloc_used.value 273412096
apps.value -151425024         <<<------ This is wrong
free.value 1777823744
buffers.value 62410752
cached.value 120373248
swap.value 0
committed.value 1112686592
mapped.value 119115776
active.value 193667072
inactive.value 94326784

shell# uname -r
2.6.8-11-em64t-p4-smp

shell# cat /proc/meminfo
MemTotal:      2054388 kB
MemFree:       1733732 kB
Buffers:         61440 kB
Cached:         120868 kB
SwapCached:          0 kB
Active:         189948 kB
Inactive:        93612 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:      2054388 kB
LowFree:       1733732 kB
SwapTotal:     3903784 kB
SwapFree:      3903784 kB
Dirty:            1028 kB
Writeback:           0 kB
Mapped:         114920 kB
Slab:            19084 kB
Committed_AS:  1093108 kB
PageTables:       1660 kB
VmallocTotal: 536870911 kB
VmallocUsed:    267004 kB

shell# tail -n 21 /proc/cpuinfo 
processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      :                   Intel(R) Xeon(TM) CPU 3.40GHz
stepping        : 3
cpu MHz         : 3400.239
cache size      : 0 KB
physical id     : 3
siblings        : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca 
cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall lm 
pni monitor ds_cpl tm2 cid cmpxchg16b
bogomips        : 6782.97
clflush size    : 64
cache_alignment : 128
address sizes   : 36 bits physical, 48 bits virtual
power management:

In the plugin, the following computation give the wrong result:

print "apps.value ", $mems{'MemTotal'}
        -$mems{'MemFree'}
        -$mems{'Buffers'}
        -$mems{'Cached'}
        -$mems{'SwapCached'}
        -$mems{'Slab'}
        -$mems{'PageTables'}
        -$mems{'VmallocUsed'}
        ,"\n";

The plugin worked fine with the old kernel (which was compiled for 686: 2.6.8-2-686-smp).

Attachments

munin-memory-day.png (16.2 kB) - added by lars at linpro.no on 02/22/06 18:48:46.
The graph before and after new kernel
munin-t-memory-day.png (16.7 kB) - added by lars at linpro.no on 02/23/06 09:30:16.
The same host as posted before (the next day)
munin-p-memory-day.png (15.4 kB) - added by lars at linpro.no on 02/23/06 09:32:04.
Graph booted with em64t kernel yesterday. 6 GB memory commited and increasing.

Change History

02/22/06 18:48:46 changed by lars at linpro.no

  • attachment munin-memory-day.png added.

The graph before and after new kernel

02/23/06 09:30:16 changed by lars at linpro.no

  • attachment munin-t-memory-day.png added.

The same host as posted before (the next day)

02/23/06 09:32:04 changed by lars at linpro.no

  • attachment munin-p-memory-day.png added.

Graph booted with em64t kernel yesterday. 6 GB memory commited and increasing.

03/08/06 09:41:53 changed by bjorn

  • summary changed from Memory plugin compute wrong apps.value on EM64T linux kernel to Memory plugin computes wrong apps.value on EM64T linux kernel.

This also applies to AMD 64bit kernels. Haven't tested with latest-and-greatest yet, though.

$ uname -a Linux donald 2.6.15 #1 Fri Jan 6 17:43:10 CET 2006 x86_64 GNU/Linux

$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 15 model : 47 model name : AMD Athlon(tm) 64 Processor 3500+ stepping : 2 cpu MHz : 2211.371 cache size : 512 KB fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni lahf_lm bogomips : 4427.37 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 40 bits physical, 48 bits virtual power management: ts fid vid ttp tm stc

# munin-run memory slab.value 407457792 swap_cache.value 0 page_tables.value 7958528 vmalloc_used.value 269598720 apps.value -110067712 <------- free.value 43753472 buffers.value 252964864 cached.value 1235300352 swap.value 57344 committed.value 1149820928 mapped.value 176209920 active.value 539652096 inactive.value 1093386240

03/08/06 10:02:01 changed by anonymous

  • version deleted.

04/07/06 00:38:46 changed by jmtapio@verkkotelakka.net

I am beginning to think that VmallocUsed and SwapCache should not be included in total memory (i.e. stacked and deducted for apps).

I took them out of the stack and the apps formula and I started getting reasonable results from my EMT64T server: http://refraktori.verkkotelakka.net/munin/reflektori/reflektori-memory.html

This was on Linux 2.6.15.1 x86_64.

I have also seen unusual apps value on 2.6.7-1-386 i686 with this meminfo:

 MemTotal:        62396 kB
 MemFree:          2416 kB
 Buffers:           484 kB
 Cached:           7052 kB
 SwapCached:      43136 kB
 Active:          51120 kB
 Inactive:          464 kB
 HighTotal:           0 kB
 HighFree:            0 kB
 LowTotal:        62396 kB
 LowFree:          2416 kB
 SwapTotal:      781160 kB
 SwapFree:       689132 kB
 Dirty:              20 kB
 Writeback:           0 kB
 Mapped:          47412 kB
 Slab:             5488 kB
 Committed_AS:   146776 kB
 PageTables:        568 kB
 VmallocTotal:   974768 kB
 VmallocUsed:      2092 kB
 VmallocChunk:   972432 kB

With official munin the apps value is usually about 2MB but with my patch it rises nearly to 50 MB (which is what I expected since there is a Bind recursor instance). Also with my patch the stack reaches 150 MB which is what 64 MB real + 90 MB swap should be. Earlier the stack reached to only about 110 MB because of the extra SwapCache deduction.

Linux proc documentation and my experiences seem to imply that SwapCache contains resident application data.

My patch is here: http://www.verkkotelakka.net/~jmtapio/munin-memory.patch

06/22/06 21:50:26 changed by janl

  • cc deleted.
  • owner changed from jo to janl.
  • status changed from new to assigned.

I'm testing the plugin without Vmalloctotal on a 32 bit machine to see if the result is also reasonable there.

Nicolai

08/30/06 03:07:08 changed by janl

  • status changed from assigned to closed.
  • resolution set to fixed.

apps.value seems entirely sane with the Vmalloc removed from the equation.

10/27/11 11:13:11 changed by syouheartqulda1981

Anyone who loves motion pictures is prone to love film downloads, too. The actual fact is that this pattern is becoming an enormous one and it's nice for individuals who want to create massive collections without having to dole out high dollar or premium home space to do so. How to download from vimeo are actually out there legally from all sorts of massive movie studios and even tv networks, as well. A video assortment created digitally has a number of benefits over regular disk purchases, too. The most important perks of video downloads involve the storage issues and pricing. However, why? Video downloads are typically a few dollars or more less than a regular DVD buy as a result of there is no such thing as a packaging points to contend with. Plus, there's the easy truth supply is not a difficulty either. Because the companies that sell downloads save on shipping and the film studios save on packaging, they'll cross on a few of these financial savings directly to buyers. In regard to storage, it's a easy fact of space. It's a whole lot easier to retailer films on a pc drive or a backup drive than it is to carry 100 videos in a room. There isn't any want for shelf after shelf or tons of DVD towers when a group is created via video download. Management of films and television downloads generally is a entire lot easier, too. It is fairly easy to create folders on the computer to retailer films by style and it's an entire lot quicker, too. Video downloads are becoming the favorites of many for a purpose beyond storage or pricing. This cause is variety. The very fact is the sorts of downloads out there will be literally mind boggling. Let's look at what kinds of video downloads may be discovered legally: Hit motion pictures Nearly every new film that hits the theaters will end up in a authorized download format shortly after release. This means there's no have to run to the video store, or worse, pay prime dollar at a theater to see a brand new release. Television programs Vimeo tube downloads As the movie studios soar on the bandwagon, so too are the television studios. Hit reveals from all decades could be discovered by the season or by the episode by way of video download.Classics Because the film obtain business becomes extra in style, many studios are video by their catalogues and offering downloads of their older movies. From the classics of the 1920s to holiday favorites of the 1980s, they'll all be discovered through video download. And, if a title cannot be discovered proper now, it's seemingly it is going to be added quickly as each major movie studio falls into place providing downloads via various completely different sites. Video downloads present their users with an on demand side, value financial savings and storage problem discount that common DVD buys cannot. As this new format turns into increasingly accepted, it's becoming the method of selection for getting and watching movies. Authentic works There are tons of places to get video downloads from newbie or little known creators. These movies won't have the financial backing of a few of the major motion pictures in history, however that does not mean there isn't some good entertainment out there. Indie works are getting an entire new viewers thanks to video downloads and the Internet.