Question

CPU and RAM at 100% making droplet unusable

I have a droplet that I’ve been using for years to develop on, using the Cloud9 browser based IDE.

Ubuntu 16.04.6; droplet: Basic / 2 GB / 2 vCPUs

Recently whenever I open the IDE my CPU and ram shoot all the way up and I can’t do anything.

“kswapd0” is always using a lot of CPU

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 34 root 20 0 0 0 0 R 86.2 0.0 23:58.92 kswapd0 1331 mongodb 20 0 1569300 69732 0 S 8.9 3.4 2:13.68 mongod 1364 do-agent 20 0 761656 5356 0 S 7.9 0.3 0:17.46 do-agent 9281 root 20 0 25036 4556 1660 R 7.9 0.2 0:02.03 lsb_release 9339 root 20 0 24584 3552 1140 D 6.6 0.2 0:01.36 lsb_release 2225 root 20 0 2085900 1.156g 0 R 5.9 59.2 4:56.69 node 2737 root 20 0 975528 107704 360 R 5.2 5.3 0:37.65 node 1571 root 20 0 2109816 92096 0 R 4.3 4.5 1:23.70 node /home/losp 1578 root 20 0 743092 17068 0 R 4.3 0.8 0:35.52 node /home/losp 2006 root 20 0 11416 1180 800 S 3.0 0.1 0:41.36 bash 1 root 20 0 37656 3112 1440 R 2.6 0.2 0:02.15 systemd 9367 root 20 0 92676 2524 1608 S 2.6 0.1 0:00.63 sshd 9405 root 20 0 59124 296 0 R 2.3 0.0 0:00.07 sshd 1731 root 20 0 93140 2900 1664 S 1.6 0.1 0:15.02 sshd 1410 root 20 0 277084 712 0 R 1.3 0.0 0:00.07 polkitd 1370 message+ 20 0 42896 1704 1212 R 1.0 0.1 0:00.09 dbus-daemon 4 root 20 0 0 0 0 S 0.3 0.0 0:02.78 kworker/0:0 687 root 20 0 29736 2308 1972 S 0.3 0.1 0:00.22 systemd-journal 1348 root 20 0 274580 760 16 S 0.3 0.0 0:00.52 accounts-daemon 1389 root 20 0 28540 1072 768 R 0.3 0.1 0:00.03 systemd-logind 1545 nginx 10 -10 196376 6788 384 S 0.3 0.3 0:04.95 nginx 3457 root 20 0 40524 2204 1532 R 0.3 0.1 0:04.63 top

what do i do, how do i diagnose this


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

Hello @skeddtemp

Researching on this kswapd0, manages virtual memory and may be having issues due to moving processes to SWAP too frequently, causing CPU spikes and decreased system performance.

I recommend tweaking your SWAP Settings if you haven’t done this yet. This should improve the performance of the droplet.

References

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

https://kb.lc/01.how_to/kswapd0/

Hope that this helps!

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.