Browse Source

Correct ram_in_use alarm calculation on FreeBSD (#4363)

* There is no "cached" dimension on FreeBSD, use "cache" instead

* Account "buffers" as used memory. As buffers by default don't shrink
much under pressure.

* Account "inactive" as free memory. As pages from inactive list could be
cleared and become free as soon as somebody request more memory from
kernel.

* Sign CLA
Vladislav Movchan 6 years ago
parent
commit
8eaf5d0de5
2 changed files with 2 additions and 1 deletions
  1. 1 0
      CONTRIBUTORS.md
  2. 1 1
      conf.d/health.d/ram.conf

+ 1 - 0
CONTRIBUTORS.md

@@ -118,3 +118,4 @@ username|name|email (optional)
 @jonfairbanks|Jon Fairbanks
 @pjz|Paul Jimenez|pj@place.org
 @jgrossiord|Julien Grossiord|julien@grossiord.net
+@vladmovchan|Vladyslav Movchan|vladislav.movchan@gmail.com

+ 1 - 1
conf.d/health.d/ram.conf

@@ -41,7 +41,7 @@ alarm: ram_in_use
    on: system.ram
    os: freebsd
 hosts: *
- calc: (($active + $wired) - $used_ram_to_ignore) * 100 / (($active + $wired) - $used_ram_to_ignore + $cached + $free)
+ calc: ($active + $wired + $buffers - $used_ram_to_ignore) * 100 / ($active + $wired + $buffers - $used_ram_to_ignore + $cache + $free + $inactive)
 units: %
 every: 10s
  warn: $this > (($status >= $WARNING)  ? (80) : (90))