Skip to content
Vectel

Server is slow and swap is constantly in use

With swap thrashing the system spends more time paging than working. A memory leak or simply too little RAM is usually the cause.

support/performance/linux-swap-thrashingsteps: 4

Try this first

  1. Check free -h and look at swap-used versus available memory
  2. Run vmstat 1 and watch the si and so columns, high is bad
  3. Use smem or ps_mem for real memory usage per process
  4. Lower vm.swappiness to 10 if it is app spikes causing it

When to bring us in

For chronic shortage: scale RAM vertically or split the workload across more hosts.

See also

Was this helpful?

None of the above fits?

Describe your situation below. We pass your input plus the steps you already saw to our AI and return tailored next-step advice. If it's too risky to DIY, we'll say so.

Who are you?

For the AI question we need your email and company, so we can follow up if the AI gets stuck, and to prevent abuse.

Limited to 2 questions per hour and 5 per day, kept lean so the AI stays useful. For more, contacting us directly works better for you and us.

Or skip the DIY entirely

Our Managed IT clients do not look these things up. One point of contact, a fixed monthly price, resolved within working hours.