Question

Process kswapd0 triggers 100% CPU usage

Hi,

I installed the Docker Droplet of DO and loaded a modest docker-compose service. After a week of working ok and uninterrupted for 8 days.

Suddenly cpu fired up to 100% usage and I couldnt access the droplet. After reboot and password reset, I launched the process again and the same happed in a couple of hours.

The second time, I could enter to the droplet and doesn’t seems to be a hack on the machine. The process using the cpu was the kswapd0 and this is a known issue with the memory swap management but not very clearly solved in Ubuntu machines.

Furthermore, this is not really a machine, and I don’t know (and probably I don’t need to know) how is configured.

As this maybe is an trouble shared with other users I ask for some recommendation. Thanks in advance, Willy Pregliasco


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

Just for the record: finally I the rebuild the project with the new swap configuration and everything it is going smoothing and with a 0.65% of CPU.

I learned that when the project runs low in memory, the operatives system can get corrupted and a fresh new start is a good advice.

Thanks for the help. See you in next troubleshot !

Willy

Bobby Iliev
Site Moderator
Site Moderator badge
April 1, 2020

Hi there @willypregliasco,

It sounds like that you might not have enough RAM and the processes are moved to SWAP too frequently which could cause the high CPU load.

There are a few options that you can configure that will have an impact on your system’s performance when dealing with swap.

What I could suggest is tweaking your SWAP settings as described in this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04#tweak-your-swap-settings

Let me know how it goes!

If you are still facing the problem, can you share how much RAM you and how much SWAP space you’ve got as well? You can do that with this command here:

  1. free -m

Hope that this helps! Regards, Bobby

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Get our biweekly newsletter

    Sign up for Infrastructure as a Newsletter.

    Hollie's Hub for Good

    Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

    Become a contributor

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    Welcome to the developer cloud

    DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

    Learn more
    DigitalOcean Cloud Control Panel