Category5.TV Community Forum

Full Version: swap to 100%
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
[attachment=16]
Hi,
I've noted that the swap usage on my NEMS server regularly builds up to 100%. Memory usage at the same time is only around 50%...
I have not been able to figure out what might be going on.
Rebooting 'solves' this of course, but some days later it is back at 100%...
Hi baggins,
Not really a "bug" per se, though I could improve the Monitorix reports so it's not so "confusing".

NEMS 1.2.2+ had a focus on reducing SD card writes. As part of this, the swap file was disabled. So, the reports and any memory reporting tool will therefore show your swap as being 100% full... because your swap is essentially 0 bytes capacity.

Hope that helps shed some light on the issue. I'll make some changes to Monitorix so your reports aren't so misleading.

Thanks Smile
Robbie
Hi Robbie,

It's not only the Monitorix reports.

On my NEMS server, the NEMS server itself is monitored with the default profile as provided during the installation.
This means that I get notifications each time swap gets exhausted (even though there is no swap!).
What I don't understand is the fact that since the swap file is disabled, it starts at 0% usage  and then gradually increases to 100% as can be seen on the graph... [Image: huh.gif]

I take it that I better switch of swap monitoring on the NEMS server then?
Yes; that host & service was added as a sample to help get folks started. Now that Swap is disabled though, it will report that swap is full.

In NEMS 1.3 this is already "resolved" for you - but since you know NEMS does not have swap, you should remove that check from the Linux Servers host group in NEMS nCONF.

Have fun!
Is swap really off in 1.3?

[email protected]:~ $ swapon -s
Filename Type Size Used Priority
/var/swap file 102396 4 -1
[email protected]:~ $ free
total used free shared buff/cache available
Mem: 1000312 293904 182088 36912 524320 615768
Swap: 102396 4 102392
[email protected]:~ $
It's supposed to be... did it get re-enabled somehow?
Maybe. But I did not do it.  I just copied v. 1.3 to a SD card and booted on a backup PI. See attached image 1.
Then I ran the INIT and rebooted. See image 2.
I can confirm this.
Brand new install of 1.3, swap at 100%
I put a temporary workaround on my NEMS.  I added "sudo swapoff -a" in the /etc/rc.local file so the change is in place across reboot.



====================
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
sudo swapoff -a
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
exit 0