CPU Resource Usage
HostGator monitors all CPU usage on Optimized WordPress, Shared, Reseller, Cloud Sites, and VPS plans. The limitations for each of our hosting options are explained in detail below. This article will assist you with being familiar with our resource limits as well as advanced methods for checking CPU usage using using SSH.
CPU Resource Restriction Tool
HostGator has implemented a CPU resource restriction tool in cPanel to inform users of our servers when they are reaching their resource limit as defined by HostGator's Terms of Service. To learn more about this restriction, please refer to the following knowledge base article:
CPU Usage Limits
Here is a list of usage limits based on your plan type:
HostGator allows a maximum of 25% CPU usage limit. You may exceed this limit for no longer than 90 seconds. This limit is enforced per site for your Optimized WordPress account.
This means that each site for your plan is monitored separately.
It is unlikely that you hit the 25% CPU usage as our Optimized WordPress platform includes built in caching and we carefully curate plugins to prevent plugins that cause high and damaging CPU usage from being installed.
Shared servers have the same limit as Optimized WordPress sites, however, this limit is for the entire account and is shared by all sites installed on the same cPanel.
It is unlikely that you hit the 25% CPU usage for 90 seconds at a time, unless your site is script intensive and requires more processing.
Here are some valuable tricks to lessen your CPU usage.
- Reduce your number of banners and ads from other sites.
- Avoid using too many scripts, and do not force html to handle server-side code (like php and shtml).
- Avoid using https protocol as much as possible; encrypting and decrypting communications is noticeably more CPU-intensive than unencrypted communications.
Flash, video, audio, and image files are downloaded to the browser. This uses bandwidth only.
Reseller servers have the same limits as Shared servers, however, the limit is per cPanel, not for the entire reseller package.
However, if you have multiple cPanel accounts contributing to a server problem, we may suspend any of them.
Cloud Sites are a powerful platform for customers who need the freedom to experience bursts of CPU traffic. Cloud Sites allows for bursts of CPU usage that are not possible on a Shared Servers without becoming suspended.
Because HostGator Cloud Sites are a shared platform, they will have their usage limit throttled if they consistently have very high CPU usage, rather than being suspended.
This means that your site will still remain active, even during high demand and throttling until your usage returns to normal levels. The throttle limits are as follows:
- A cPanel may have sustained usage of up to 50% of its resources without ever being throttled.
- A cPanel may use 100% of its purchased CPUs for up to 300 seconds.
- After 300 seconds of 100% usage, the cPanel will be limited to 75%.
- After 300 additional seconds at maximum usage, the cPanel will be limited to 50%.
- After 300 additional seconds at maximum usage, the cPanel will be limited to 25%.
- After 300 seconds of reduced usage all resource limits are reversed in the same order.
A HostGator Cloud Sites package will not be throttled below a limit of 25% CPU usage. While your site may not be suspended, this could prevent a CPU intensive site from functioning correctly.
- Based on our current utilization statistics, these restrictions impact less than 1% of Cloud Sites customers. If higher CPU is required than is available on Cloud Sites, a Dedicated Server is recommended.
You are allowed to use 100% of your CPU resources; however, this is only a portion of the server's total CPU resources. If you are looking for more CPU resources than a Shared Server, you will NOT want to pick VPS; instead, you should choose a Dedicated Server.
Please note that if the container uses resource (e.g., CPU) excessively, this can cause performance issues for other customers on the node and may result in your container being "cooled down" for at least 10 minutes. This means that the server is shut down and only restarted several minutes later. This cycle will continue until the resource issue on your container has been addressed.
You are allowed to use 100% of the server's CPU resources.
A good trick for VPS and Dedicated is to turn off the webstat programs (AWstat) that comes with your cPanel. Note that AWstat and other tracking tools use CPU and MySQL connections. By turning this off, you reduce your CPU usage.
Monitoring CPU Usage with SSH
It is possible to monitor the processes and CPU usage on your server with SSH. To learn how to access your server with SSH, please refer to our article on how to get and use SSH access. There are two tools which you may use to check for processes with high CPU usage on your server, the top command.
Top is a task manager program which is available on HostGator servers that produces an ordered list of running processes that users may sort by preference in order to monitor the health of their server. To run top, please follow these directions:
- Log into your server using SSH.
- From the command line, enter the command top. Example:
email@example.com [~]# topNote: The top command will restrict its search based on the user you log in with. If you are logged in to your server as root and you wish to filter your results to only display processes for a specific user, you may do so using -u when running the command. Example:
root@server [~]# top -u username
- To exit top, please press the q key to return to the command line.
Once top is running, you will see an output that looks similar to this:
op - 15:14:39 up 68 days, 22:57, 2 users, load average: 0.09, 0.02, 0.01 Tasks: 7 total, 1 running, 6 sleeping, 0 stopped, 0 zombie Cpu(s): 3.4%us, 18.0%sy, 34.0%ni, 35.9%id, 7.2%wa, 0.5%hi, 0.9%si, 0.0%st Mem: 65835156k total, 63794700k used, 2040456k free, 2011064k buffers Swap: 6143996k total, 1322776k used, 4821220k free, 46736152k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1646 username 39 19 13276 1088 852 R 0.0 0.0 0:00.05 top 6828 username 39 19 4312 884 556 S 0.0 0.0 0:00.00 man 6832 username 39 19 9248 1084 924 S 0.0 0.0 0:00.00 sh 6833 username 39 19 9248 664 492 S 0.0 0.0 0:00.00 sh
This command has a wide variety of uses and can be implemented with many options. For the purposes of this article, only how to read the process list and how to sort the process list by CPU or Memory usage will be covered here. Here is a list of the columns as they appear by default on HostGator servers and what they mean:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
- PID: The task's unique process ID.
- USER: The username of the task's owner.
- PR: The scheduling priority of the task.
- NI: The nice value of the task, which indicates the priority the server runs the task at.
- VIRT: The total amount of virtual memory used by the task.
- RES: The physical memory a task is using.
- SHR: The amount of shared memory available to a task.
- S: The status of the task. The statuses which a task may use are as follows:
- D = uninterruptible sleep
- R = running
- S = sleeping
- T = stopped by job control signal
- t = stopped by debugger during trace
- Z = zombie
- %CPU: This column displays the CPU usage of running processes and is the most important column to pay attention to when monitoring CPU usage. To sort the list by CPU usage, please press <Shift> + p.
- %MEM: This column displays the Memory usage of running processes. To sort the list by this column, please press <Shift> + m.
- TIME+: This column provides the total CPU time used by the task since it was started. The output is formated as follows:
- Minutes : Seconds . Hundredths Of A Second
- COMMAND: This line displays either the command line used to start a task or the name of the associated program.
This will allow you to check the active processes on your server and identify users that have processes that are using a large amount of CPU resources which may allow you to identify specifically what is is causing issues. This was only a brief introduction to this very useful command, to read it's full documentation please log into SHH and enter the command "man top" like so:
root@server [~]#man top
This will open the full documentation for the top program which may be browsed with the up and down keys. To stop viewing the manual, please press the q key.