We have a server that at least once a week will suffer from very sluggish performance. Memory will go into swap by about 10-15GB and the server has 36GB of RAM.

My question is can i find either when the server went into swap or what caused it to go into swap.

I have a feeling there is a single processes that is causing the issue but when i check the process list it all seems normal. The server is already into Swap at this point though.

  • This is personal opinion, but 15gb of swap is WAY too much. With that much swap (compared to amount of physical RAM), you are extremely unlikely to use it all without major thrashing issues (such as what you are seeing). With preemptive swapping (vm.swappiness > 0), memory that isn't being used will get swapped out. But with 36gb of RAM, you are extremely unlikely to have 15gb of idle memory that can be swapped. I'd highly recommend dropping this down to a few GB at most. But it's up to you whether you'd prefer to have an extremely slow system, or the OOM killer to step in and whack things. – Patrick Apr 12 '17 at 3:31

This seems like a good article to detail about swapiness:


But I wonder if poor performance is due to swapping or "something else".

Swapping because programs have a "working set" which changes over time, and the idea is to swapout the "unneeded pages".

A system "starts swapping" when the existing ram isn't large enough.

Slugishness may indicate the run queue is getting too high (the number of processes which want to run) -- if the memory load is a function of users/programs, more users will want to run more programs (and it may be coincidental swapping occurs when the system is slow).

This also looks pretty good:


(I never knew about the glances command -- always learning something new)

These should point you at tools to help diagnose your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.