Knowledgebase

KnowledgebaseCloud/VPSCloud HostingFile Management
Back to File Management

How To Troubleshoot A Slow Website


This article is for cPanel Accounts. Determine where your account is with this guide.

If your website is running slowly, there are a few things that you can try. From cPanel itself, some basic logs might be useful. These are all found in the Logs area. Things like the Raw Access Logs, the Error Logs, and Resource Usage are the main things to check.

Most of our shared hosting accounts need to remain below 1% of server resource usage. Our shared servers use a tool called CloudLinux to automatically [and manually when needed] restrict sites that are continually abusing server resources.

If you would like to see what kind of CPU load is on the server connect via SSH and run:

cat /proc/loadavg
You will receive output like:
0.26 0.22 0.27 1/488 366822

The first three numbers are the CPU load average for 1, 5, and 15-minute averages. This will give you some idea of what the CPU load looks like. This number should remain somewhere under 10 on average. The load is related to the number of cores on the server so you can check the number of cores with:

grep 'model name' /proc/cpuinfo | wc -l
You will receive output in a number like:
16

So if a server has 16 cores then you should not see issues [related to CPU load] until it is over 16. If the CPU load is over the number of cores on the server then the CPU is queued up and jobs are not able to get through as quickly as they may need -- thus slowdown and timeouts may start to occur.

CPU isn't the only thing that can affect server load, however. Several factors can cause server load spikes. Load can consist of both CPU and Memory [aka RAM] usage. So if the CPU load is low, and your site is slow, you can also run commands like:

ps au

This will show you what processes are running for your user that might be causing a slowdown. Things like cronjobs that aren't finishing promptly or PHP scripts that take up a lot of memory or take too long to run can cause site-loading issues.

You will also want to check out the MySQL load. I recommend connecting through SSH, but you will need to log in to each user name to see what the load is for their particular database(s). The login command looks like this:

mysql -u cpanelusername_dbusername -p
When you hit enter it will ask for your password. Nothing is displayed in the password line while you type.

Once in you can use the command "show processlist;" minus the quotes to see what is running. If there are a lot of database connections that will prevent everyone from getting through right away -- some visitors may be waiting for an open database connection.

You can also run MySQL database maintenance through PHPMyAdmin. Connect to your specific database, scroll to the bottom to select "Check All" and then from the dropdown menu select items like Check, Repair, Optimize, or Analyze to perform such functions on your database(s) in an attempt to improve performance or check for problems.

If you've gone through a few of these things and you are still seeing issues, contact Tech Support and we can investigate further for either account or server issues.



Related Articles

Am I Responsible For Monitoring My Bandwidth Usage
Can I Add My Own CGI Scripts
Can I Point My Primary Domain To A Sub-folder
Can I Reset My Website Files
Can I Use A .htpasswd File In My Account

Can’t Find what you need?

No worries, Our experts are here to help.