Monitoring Cpu Usage: Surpass Hosting For Better Server Performance

how to monitor server cpu usage surpass hosting

Monitoring server CPU usage is essential for maintaining optimal server performance and ensuring no disruptions to online services. High CPU usage can lead to poor application performance and even server failure. By tracking CPU utilisation, administrators can identify issues and optimise code to improve efficiency. This is particularly important for shared hosting services, where high CPU usage by one user can impact other users. Tools such as Retrace APM provide a comprehensive view of server performance, helping to identify problems before they become critical.

Characteristics Values
CPU usage The percentage of time the CPU is being used to complete its tasks
CPU states Idle, busy, or waiting for I/O
CPU usage value calculation The sum of the percentage of CPU usage of individual CPUs
Causes of high CPU usage Processes with high CPU requirements, background processes, malware, unoptimized code
Fixes for high CPU usage System restart, end background processes, deal with startup processes, use anti-malware, optimize code, upgrade CPU resources
CPU resource A limited resource with a set number of processors per server
CPU monitoring tools Task Manager, Resource Monitor, Process Explorer, top command, Retrace APM
CPU metrics CPU process count, CPU thread count, CPU % interrupt time, memory usage, server uptime, disk activity, page file usage, context switching, time synchronization, handle usage, process activities, network activity

shundigital

How to monitor CPU usage on a Cloudways platform

To monitor CPU usage on a Cloudways platform, log in and click on the 'Servers' tab from the top menu bar. Choose your target server, then click on the 'Monitoring' option from the left menu bar to load the server usage information.

The 'Summary' and 'Details' tabs are the most important components as they contain all server resource utilisation statistics and graphs. The Summary tab presents a quick summary of the utilisation of four major server resources, which are updated at defined intervals. The Details tab provides more in-depth information.

Under the 'CPU Monitoring Section', you will see the CPU utilisation recorded recently, which is updated automatically every five minutes. To understand the CPU consumption over a desired period, refer to the Details tab of the monitoring page.

The Idle CPU metric displays the volume of idle/free CPU or CPU consumption. A lower number on this graph indicates higher CPU consumption, and if your numbers are consistently at 20% or less, you should consider upgrading your server.

If your idle CPU percentage is below 10-20%, or if you are running low on server resources, you can upscale the server on the Cloudways Platform.

shundigital

How to monitor CPU usage with SSH

Monitoring CPU usage is essential to ensure optimal server performance and prevent hardware damage from overheating. One way to monitor CPU usage is through the Secure Shell (SSH) network protocol, which provides administrators with secure remote access to a computer.

To monitor CPU usage via SSH, the "top" command is typically used to check memory and CPU usage per process. This command reports total memory usage and can be used to monitor overall CPU usage. It is frequently used in daily system administration tasks.

$ top

This command will display the CPU usage percentage, which indicates how much the processor is working. CPU usage varies based on the types of tasks being performed.

By monitoring CPU usage via SSH, administrators can identify high CPU utilisation and take steps to optimise performance or increase resources if needed.

In addition to CPU usage, SSH can also be used to monitor other hardware resources, such as RAM usage, disk space, and the number of running processes. This comprehensive monitoring provides valuable insights into system performance and resource utilisation.

shundigital

How to identify the cause of high CPU usage

High CPU usage can be caused by various factors, and it is important to identify the root cause to implement effective solutions. Here are some common causes and methods to identify and address high CPU usage:

  • Processes with High CPU Requirement: Some programs, such as high-end video games or specific applications, require a significant amount of CPU resources. Running such programs on a low-specification system can lead to high CPU usage. To mitigate this, consider upgrading your CPU resources or optimising the code for better efficiency.
  • Background Processes: Both system and application processes can run in the background, consuming CPU resources even when not actively used. To manage this, periodically review and end any unnecessary background processes. Additionally, disable any autostart processes that are not essential.
  • Malware: Malware can cause high CPU usage, especially when performing malicious actions such as data transfer. Utilise anti-malware software to identify and remove malware from your system.
  • Unoptimised Code: Custom code running on servers can lead to high CPU usage if it is not optimised. Unoptimised loops and recursion are common culprits. Review and optimise the code to reduce CPU usage.
  • Server Configuration: The configuration of your server can impact CPU usage. For example, turning off webstat programs (AWstat) that come with your cPanel can help reduce CPU usage.
  • Resource-Intensive Scripts: Certain scripts or plugins can be resource-intensive, leading to high CPU usage. Review the scripts running on your server and consider optimising or replacing them with more efficient alternatives.
  • Environmental Factors: For on-site servers, ensure that the temperature and power supply are within the recommended range. Consistently high temperatures could indicate a fan problem or other hardware issues.
  • Memory Utilisation: High memory utilisation can impact CPU usage. Monitor the memory usage of your server, including available free memory and rates at which pages are written to free up physical memory space.
  • Disk Activity: Keep an eye on disk activity metrics such as disk busy time, input/output operations, disk read/write times, and disk queue length. High values in these metrics could indicate that your disk is struggling to handle the workload.
  • Page Swapping: Page swapping occurs when your server runs out of working memory, and it is not recommended as it reduces response time. If you notice high page swapping, consider provisioning more memory for your server.
  • Context Switching: Extensive context switching can consume significant CPU resources. Monitor context switches, and address any issues related to running multiple busy processes or application bugs that increase context switching.
  • Network Activity: Monitor network activity to identify possible bottlenecks or hardware failures. If the bandwidth usage is nearing the maximum speed of the network interface, it could indicate a potential issue.

By monitoring these areas and implementing appropriate solutions, you can effectively manage high CPU usage and ensure optimal server performance.

shundigital

How to monitor CPU usage in cPanel

Monitoring your server's CPU usage is crucial to ensure your online presence is running smoothly. Here's a detailed guide on how to monitor CPU usage in cPanel:

Understanding Resource Usage:

When your account requests the server to perform tasks such as connecting to a database, running scripts, or sending emails, it utilises resources from the server's CPUs and the hard drive. The CPU resource is limited, and going over your allocated limit can result in warnings or even temporary account suspension. Therefore, it's important to monitor your CPU usage and make changes if necessary.

Locating CPU Usage in cPanel:

To view your CPU usage in cPanel, follow these steps:

  • Log in to your website's cPanel.
  • For a quick view, scroll down the right-hand sidebar until you see "CPU Usage."
  • For more detailed information, scroll down to the "Metrics" section and click on "Resource Usage." This will provide data on the resources your account is utilising.
  • If you have VPS or dedicated server hosting, you can also SSH directly into the server to access more detailed usage information.

Managing High Resource Usage:

If you find yourself nearing or exceeding your CPU limit, there are several steps you can take:

  • Review the articles and guides provided by your hosting service to understand common causes and solutions for high resource usage.
  • Contact the support department for further assistance in identifying and resolving issues.
  • Consider upgrading your hosting plan if you consistently hit resource limits.
  • Optimise your website's code, use caching strategies, and optimise images to reduce resource usage.
  • Limit plugins and modules, regularly optimise your database, and use a Content Delivery Network (CDN) to distribute content delivery.

By following these steps, you can effectively monitor and manage your CPU usage in cPanel, ensuring your website runs efficiently and smoothly.

shundigital

How to monitor CPU usage on Windows

Monitoring your CPU usage is a great way to identify performance issues and can inform hardware upgrades or software adjustments. Here is a step-by-step guide on how to monitor CPU usage on Windows:

Using the Task Manager:

  • Open the Task Manager by pressing Ctrl + Shift + Esc on your keyboard.
  • Go to the "Performance" tab. Here, you will see a graph displaying your CPU usage. If your computer is running high CPU usage, the chart will be primarily red.
  • To identify which applications are using the most CPU, go to the "Processes" tab. From here, you can sort the processes by CPU usage to determine which process is causing high usage.
  • If you wish to end a process, right-click on it and select "End Task".

Using the System Tray:

Check the bottom right corner of your screen (the system tray) for a small icon that indicates the amount of used and available CPU.

Using the Command Prompt:

  • Open the Command Prompt by opening the Start menu, typing "cmd", and selecting it.
  • Once the Command Prompt is open, type "wmic cpu get loadpercentage" and press Enter. This will display the current CPU usage as a percentage.

Using Third-Party Tools:

Third-party tools such as Process Explorer, Task Manager Deluxe, and CPU-Z can provide more detailed information about CPU usage. They can also help identify which programs and processes are using the most CPU.

Using Resource Monitor:

  • Search for "Resource Monitor" and open it.
  • Select the "CPU" tab to view the processor's usage, including how much of the CPU is available and what is running.
  • Right-clicking on an entry will allow you to search for information online or end the process.

Using Performance Monitor:

  • Open the Search bar from the taskbar and type "Performance Monitor".
  • Select the "Performance Monitor" tab to see the CPU performing in real time.
  • To add a counter and keep track of an app's performance, select the green "Add" button.
  • In the left-hand list under "Select counter from the computer", locate the app you wish to track.
  • Select the app and choose "Add" at the bottom.
  • The entry will appear on the right. Select "OK", and it will appear in the Performance Monitor with its own corresponding colour.

Frequently asked questions

CPU usage is the percentage of time the CPU is being used to complete its tasks. CPUs can be in three states: idle, busy, or waiting for I/O. CPU usage is the measure of the CPU when it’s in a non-idle state.

There can be various reasons for high CPU usage. Some common causes include processes with high CPU requirements, background processes, malware, unoptimized code, and more.

There are a few ways to monitor CPU usage. You can use built-in tools like Task Manager or Resource Monitor on Windows, or top on Linux. You can also use third-party monitoring tools like Retrace or Scalyr, which offer more advanced features and analytics.

If your CPU usage is high, there are a few things you can try. First, identify the processes that are using the most CPU resources and see if they can be optimized or reduced. You can also try restarting your system, ending unnecessary processes, or upgrading your CPU resources.

Monitoring CPU usage can help you identify performance issues, understand your server's resource usage, and optimize your code. It can also help you ensure your server is running smoothly and prevent disruptions to your business.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment