Troubleshooting High Processor Load on your server

Understanding CPU usage is important for overall system-performance measurement. A high Processor Load or Utilization on nodes can be a nightmare for Node owners. Sometimes the Load on Your server can be due to high traffic on your website which is Good News. In that case, you need to Simply Upgrade your server to the next level to resolve the issue.

However, In some cases, the CPU utilization is caused by other factors which you need to Troubleshoot. let’s take a look at how we identify the real reason for the Nodes high CPU usage and fix it.

Impacts of High Usage on E2E Nodes

Whenever the CPU usage Goes high on your server, The Server and Website hosted on it will ultimately become Slow or Sometimes there is a chance of the Server getting Crash when the Load is too high.

That’s why we Provide real-time Monitoring options for all our Nodes. You can configure Alerts for your Nodes where the Load or CPU utilization of your server Increases above a certain Percentage an Alert will be received on your registered Email-id. We highly recommend you to Configure this alert to avoid any issues.

Causes of High CPU utilization or Processor Load.

We often face the issue of resources Problems on Servers. As mentioned earlier, This can be due to high traffic on your Websites. It that is not the case, Let’s now check the common reasons that cause high CPU usage in Nodes.

  • Incorrect Service Level Configuration

Often, CPU usage Problems are faced due to errors in service level configurations. The Services Should be Finely tuned and Optimized before deploying in Production Servers. The Services Should be configured taking into consideration all external and internal environments. When there are Multiple Processes of the Same service, It can lead to High CPU usage.

  • Inadequate Server Resources

Insufficient Resources on Your Node can also trigger High CPU usage. The Resource allocation of your node should always be proportional to the amount of Usage.

  • Poorly configured Applications

Poorly Configured Application may also cause high CPU usage. For instance, having a Backup Process running at the Peak time when your server resources are already using its full capacity may cause your server a High Utilization. Similarly, you need sure that all Cron Jobs are not run simultaneously and should be run at an appropriate time to make sure the Utilization is normal.

How to Fix High CPU usage

There are numerous ways of monitoring system load average few are uptime -> which shows how long the system has been running, number of users together with load averages:

../../_images/cpu.png

The numbers are read from left to right, and the output above means that:

load average over the last 1 minute is 0.18
load average over the last 5 minutes is 0.07
load average over the last 15 minutes is 0.02
High load averages imply that a system is overloaded; many processes are waiting for CPU time.

Top -> which shows the top running process which is consuming more CPU or RAM

top
../../_images/cpu1.png

With the above command, you will be able to look at top consuming Processes and Take necessary actions.

The ps command reports a snapshot of a system’s currently running processes. If you want to List the details of a specific process, You can use the below command. For example to check MySQL Process consumption. You can grep Mysql from the Ps command which will display the Process ID and Processes running.

ps -ef | grep mysql

Similarly, If you want to gracefully stop a running process which has been causing a high utilization on your server, You can use The syntax for the pkill command is as follows

pkill processname

for example,

pkill mysql

To kill a particular process, You can use the Process id

kill -9 pid