It would be a good practice as a website administrator to regularly check the server load of your website. Ideally the lower the server load, the faster your website serves content to your visitors; the faster you serve content, the faster you can increase sales, website followers, and trust.
Server Load Metrics in Cpanel
Before you begin learning these tips, it would be useful for you to know the server load metrics you need to monitor in Cpanel. To do this:
1.) Login to your Cpanel hosting account.
The following are the important metrics you need to check:
a.) Server Load – This is the load on the server CPU. The lower this figure, the better. What is acceptable varies depending on the number of CPUs your server is using. Below are some rough guidelines to judge if your website server load is normal.
To interpret the data table guide above, every hosting server may use a different number of CPUs. So for example - if your server load readings in Cpanel are 2.37 (4 CPUs), it means your website is experiencing moderate server load. Since 2.37 falls between the 1.65-2.85 range for 4cpus server, this is not yet a problem.
However if your server load data is around 4.51 (2 CPUs), then your website is experiencing high/excessive server loads. It is because 4.51 is beyond 1.9, which is the threshold for a 2 CPUs server. How frequent this happens is also very important. For example: if it reads “consistently” for 3.8 to 4.0 for a 4 CPUs server, then you need to be worry.
If it just happens very rarely, it might be a special event (like having your website featured on a front page of a high traffic website like www.yahoo.com ). Take server load readings during different times of the day, not just on one occasion.
Increasing the number of CPUs is not a permanent solution to all high server load issues. You still need to check your overall website status to make sure no web application has the possibility of abusing your server load.
b.) Memory used – generally as long as it does not stay over 85% all the time, then it is fine. High memory usage can affect server load because whenever your server is short on memory, it uses the swap file, which is essentially hard drive space (similar to the principle of page files in Windows). The more reading and writing tasks the hard drive, the higher the increase in CPU usage, which in turn increases the server load.
c.) tmp space usage (e.g. Disk /dev/sda3 (/tmp)- this is the storage space for temporary files. Sometimes when this runs out of space, a lot of your website features will be seriously affected. As long as it does not stay consistently between the 85% to 100% range, then it is fine. Contact your web host if you see above average usage.
If your website is experiencing high server load issues, I recoomend the following steps:
Reducing Server Load Tip #1: Implement Captcha on Your Website
There are malicious bots (scripts) programmed by spammers to exploit your website's features. For example if you have a useful tool on your website, not only does this attract normal visitors but spammers as well.
If your web application accepts user input and is not captcha protected, spammers can write scripts to exploit it. Once it is exploited, the user of your web application is no longer a human, but a bot. Bots can make thousands of requests in a small amount of time, which in turn increases the server load of your website.
Things you need to do:
1.) Examine all of the pages and features on your website that accept user input.
For PHP, the most recommended captcha solution (which is strong and standard) is Recaptcha: http://code.google.com/apis/recaptcha/docs/php.html
Reducing Server Load Tip #2: Enable Gzip Compression
Gzip compression is very useful for reducing website bandwidth because the information that is transmitted from your server to your users is compressed or significantly reduced in size. Reducing website bandwidth can reduce the transfer times significantly, which in turn reduces server load.
Things you need to do:
1.) Check to see if you have enabled gzip compression. You can use this tool: http://www.whatsmyip.org/http_compression/
2.) Enter your homepage URL as well as one of your inner pages. If you do NOT see a result such as “http://www.example.com is gzipped” then you have not enabled Gzip on your server.
3.) To enable Gzip compression on Apache servers using Cpanel, login to Cpanel and then go to Software/Services. Click “Optimize Website”. For the best results, select “Compress the specified MIME types”, as compressing all of your content can sometimes cause problems in your hosting configuration. Make sure all MIME types on your website are compressed to get the most benefits out of the compression.
blog comments powered by Disqus