High CPU use in a Linode server

Dear DHIS2 community,

I am trying learn to setup DHIS2 on a Linode server according to tutorial.The server is mainly used for configuration and testing. Since last 2 weeks the CPU is being used >100%. Seems there are 2 zombie services who may be using the CPU. I have tried rebooting the Linode instance and restarting the docker images but the CPU utilisation is still >100%

Can you please help in identifying the cause for high CPU utilization?

attaching the screenshots of CPU use and top output.

Thanks

You could be having someone using your server as a mine. Happened to me once. I did back up all my apps and databases and deleted the OS I had put, this was Ubuntu, and rebuilt a fresh one, this time with a simple firewall.

But before I deleted it, I exhausted the following post and other posts. If you have time, please try all the steps listed.

Hope this is helpful.

-Moses

2 Likes

Dear Moses,
Thanks for sharing your experience and the resource.

I have tried the Linode page to get an idea what is happening. I had installed without creating a non-root user, so found that there were some unauthorized login attempts.
Now I have disabled root login with a simple firewall.
Tried Longview feature in Linode to get system metric, which shows few Java processes that are taking most of the CPU.

Thanks again

1 Like

It can be normal behavior for java to show up as the top process(es) for DHIS2 if DHIS2 is under moderate to heavy use.

It appears as though you have 2 GB available in your Linode instance; if you are finding the server to be unresponsive, you should consider setting Xms and Xmx to control the Java heap size. If the database is running on the same system, you’ll want to consider leaving enough memory for that as well, and you’ll want to leave some extra for SSH sessions, backup processes, and other maintenance tasks. In general, infrequent high CPU usage isn’t itself a bad thing unless it’s preventing normal use, preventing other applications from functioning, or constantly at full usage.

Heading off-topic a little but keeping with system performance; if you find that you also want to control the database performance as well, check out PGTune. I would recommend using “Mixed” for the DB Type option.

2 Likes

Thanks for the suggestions @alanivey will explore PGTune

1 Like