swap to 100%

Found something amiss in NEMS? Confirm first that you are running the latest version, and then post your bug report here.
Post Reply
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

swap to 100%

Post by baggins »

NEMS_swap.png
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%...
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: swap to 100%

Post by Robbie Ferguson »

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 :)
Robbie
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: swap to 100%

Post by baggins »

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

I take it that I better switch of swap monitoring on the NEMS server then?
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: swap to 100%

Post by Robbie Ferguson »

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!
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
User avatar
kd4pyr
Junior Member
Posts: 28
Joined: Wed Jul 05, 2017 4:56 pm

RE: swap to 100%

Post by kd4pyr »

Is swap really off in 1.3?

kd4pyr@NEMS:~ $ swapon -s
Filename Type Size Used Priority
/var/swap file 102396 4 -1
kd4pyr@NEMS:~ $ free
total used free shared buff/cache available
Mem: 1000312 293904 182088 36912 524320 615768
Swap: 102396 4 102392
kd4pyr@NEMS:~ $
Rick
User avatar
Robbie Ferguson
Posting Freak
Posts: 835
Joined: Wed Mar 07, 2012 3:23 pm
Location: Ontario, Canada
Contact:

RE: swap to 100%

Post by Robbie Ferguson »

It's supposed to be... did it get re-enabled somehow?
Robbie Ferguson // The Bald Nerd

Did I help you out? Appreciate what I do? Please consider saying thanks:
User avatar
kd4pyr
Junior Member
Posts: 28
Joined: Wed Jul 05, 2017 4:56 pm

RE: swap to 100%

Post by kd4pyr »

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.
Attachments
Screenshot2.png
Screenshot1.png
Rick
baggins
Member
Posts: 50
Joined: Tue Oct 03, 2017 4:46 am

RE: swap to 100%

Post by baggins »

I can confirm this.
Brand new install of 1.3, swap at 100%
User avatar
kd4pyr
Junior Member
Posts: 28
Joined: Wed Jul 05, 2017 4:56 pm

RE: swap to 100%

Post by kd4pyr »

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
Rick
Post Reply