This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

When should I worry about swap usage?

I've installed two new ASG 220s with HA, IPS, and web and email security on.  For the first few days RAM hovered around 65% with no swap usage.  About 5 days in swap usage suddenly jumped to 10%.  About a week later swap jumped to 20%.  3 days later takes us to today, and my swap usage has jumped to 30%.  Over this time RAM usage has been fairly stable, hovering in the mid to high 60s and occasionally hitting low 70s.

Should I be worried about the increase in swap usage?


This thread was automatically locked due to age.
Parents
  • Sure we can chat about this. First however the difference must be understood between "allocated" swap and swap which is actually being called upon and actively used. This is one of the biggest things that isn't grasped by many.

    For example attached is a box with 1.5GB of ram which i injected massive gigabytes of logfiles into, causing the reporters to work like crazy, and needing some swap (just a few hundred megabytes, which is pretty good considering what I gave it to eat). I attached a screenshot of it.

    Now, long after the job is "done" the swap in webadmin still shows around 430Mb-ish of usage. However, if I go to the command line and use a command like vmstat, I see that for the swap file, there is ZERO paging happening (as indicated by the si and so values under ---swap-  (Attached as well). So while the disk is allocated to swap, its not actively doing anything or costing me performance.

    The key is to get that there is a difference between a block of disk space that the kernel needed at some point to be swap, and swapping which is actually happening right now and slowing down your system. When the system has had to use swap for whatever reason, it now has a nice piece of hard disk that it can keep and use later should swapping be required in the future, call it good planning on behalf of the kernel. 

    I'll post a bit more about swappiness after the fires die down today.
Reply
  • Sure we can chat about this. First however the difference must be understood between "allocated" swap and swap which is actually being called upon and actively used. This is one of the biggest things that isn't grasped by many.

    For example attached is a box with 1.5GB of ram which i injected massive gigabytes of logfiles into, causing the reporters to work like crazy, and needing some swap (just a few hundred megabytes, which is pretty good considering what I gave it to eat). I attached a screenshot of it.

    Now, long after the job is "done" the swap in webadmin still shows around 430Mb-ish of usage. However, if I go to the command line and use a command like vmstat, I see that for the swap file, there is ZERO paging happening (as indicated by the si and so values under ---swap-  (Attached as well). So while the disk is allocated to swap, its not actively doing anything or costing me performance.

    The key is to get that there is a difference between a block of disk space that the kernel needed at some point to be swap, and swapping which is actually happening right now and slowing down your system. When the system has had to use swap for whatever reason, it now has a nice piece of hard disk that it can keep and use later should swapping be required in the future, call it good planning on behalf of the kernel. 

    I'll post a bit more about swappiness after the fires die down today.
Children
No Data