unexpected Sys CPU and Disk write usage spikes

Please look at this graph: 24 hours: 7 days: As you can see, there are strange unexpected Sys CPU and Disk write usage spikes at random time. There is no special cron jobs. I also remember that some times there was “/usr/bin/python3 /usr/lib/ubuntu-release-upgrader…” process in top of the top command. During this spikes i have to reboot server, this helps. And now, after reboot, i get Could not load list of meta packages: [Errno 12] Cannot allocate memory twice in places, there must be information about pacakges to upgrade.

I have 1024 mb server and same swap file:

                 total       used       free     shared    buffers     cached
Mem:           994        837        156         16          8        167
-/+ buffers/cache:        661        332
Swap:         1023         17       1006

How can i find out the problem of this system load spikes? Thanks.

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.

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.


In order to diagnose the issue, we’d really need to know more about your server.

Please provide:

  • Run uname -a and post the output – feel free to comment out the hostname.
  • Complete List of Packages Installed (by you - i.e. NGINX, PHP-FPM etc)
  • Run top, press shift+m and finally, press c. Take a screenshot and post the URI.

What this will provide us with is, first and foremost, a look at what all you’re running (by looking at the package list), the top processes consuming the most RAM & CPU, and some basic OS information.

From looking at the output of free -m, of your 1GB, you’re physically using 670MB (the used column includes cache, so for actual usage you’d subtract the cache column from usage) and have 156MB free, so something is definitely using the RAM, but your SWAP looks fine (you’re not tearing through RAM, forcing SWAP usage which would almost immediately begin to affect CPU load).

That said, it is possible that you’re running out of RAM from time to time, which would force SWAP usage to prevent a crash (whether it’s MySQL, NGINX or something else). Once you begin to use swap, which spurs disk activity, you begin to utilize more CPU as disk (regardless of whether it’s an SSD, SATA, SCSI/SAS or Flash drive) is always going to be slower than RAM and accessing it will also always be more “expensive” in terms of CPU “cost.”