How to optimize your website to use less server resources

The growth in the popularity of content management systems have thrown a lot of challenge for resource management as these scripts use a lot of server resources and when not properly managed, could result in service disruption.

ou will also want to read:

How to Create a MySQL Database, a User and Delete Database in Cpanel
How to Create a SubDomain in Cpanel
How to Create a Website/Domain Redirect in cPanel
How to force your website url with www or non-www using htaccess
How to Backup My Website in cPanel

For many sites, there are some standard ways of optimizing your site to consume less resources on the server. We will give you some useful recommendations in this tutorial:

1. Check: You can use some free online optimization tool to help you pinpoint what parts of your site may be causing a problem. In many cases, the parts that take the longest to load also take more memory and CPU for the server to serve.

2. Caching: Since PHP and MySQL are server-interpreted languages, the server has to compile every PHP page and process every MySQL query. If you are running a PHP and/or MySQL-driven site, caching can reduce your usage dramatically.

3. Optimize MySQL: As databases grow and with regular use, they gain overhead and may need to be re-indexed. The quickest way to address this is by logging into your cPanel > phpMyAdmin and running the 'optimize' or 'repair' commands against your database. [Instructions] . You also may need to restructure or index your database so your MySQL queries run quickly.

4. Hotlink protection: Hotlinking is more common with sites that serve a lot of images, such as gallery sites. Hotlinking is a term that describes when another site directly links to images on your site, and is generally frowned upon and described as "bandwidth stealing." You can enable hotlink protection in your cPanel, but be sure to include your addon/parked/sub-domains in the 'allow' list so that all your sites function properly.

5. Robots.txt: Search engines and robots can account for a large percentage of a site's traffic, and most of this traffic can be unnecessary so reducing it can save a lot of resources on the server. You don't want to eliminate search engines altogether, but you should restrict them from being able to access directories that don't contain content you need indexed, and you should block unfamiliar bots and spiders that are frequenting your site. You can identify the spiders and bots crawling your site by looking at your AWstats, and restrict their activity using a robots.txt file. You can also block undesired robots by using the IP deny manager in your cPanel.

6. Reducing image size: reducing the size of images loading on your site can reduce resouce usage.

7. Compression: Compression saves bandwidth at the expense of CPU. The amount of bandwidth saved with page compression is minimal at best (usually less than 10%) and since our accounts come with so much bandwidth, it's not worth the extra CPU power consumed by the server compressing your pages before sending them. If you are using compression for your site, we recommend that you disable it.

8. Upgrading
If your site is using a large amount of system resources it is not always indicative of something negative. If you don't receive a lot of traffic and your site is using a lot of CPU and memory, the problem is most likely a scripting issue.

Also read:

How to Reset or Change to a New CPanel Password
How to Set Up and Delete a Cron Job
How to Setup Google Apps MX, CNAME and SPF records
How to upload files to a website
Overview of Quickinstall


How to Optimize a Database Using PhpMyAdmin

Please read these instructions carefully before you begin.

Table should be used if you have deleted a large part of a table or if you have made many changes to a table with variable length rows, such as VARCHAR, TEXT, BLOB or VARBINARY columns.

Deleted rows are maintained in the linked list and insert operations re-use the old row positions.

You can use "Optimize Table" to reclaim unused space and defragment the data file for optimal performance. If a lot of changes have been made to a table, optimizing the table can sometimes significantly improve performance.

Please follow the steps below:

Step 1: Login to phpMyAdmin


cPanel: (Shared, Reseller, SEO, Linux Dedicated, VPS with cPanel)

Login to cPanel
Click on the phpMyAdmin button in the Databases section.

Plesk 10: (Windows Shared, Windows Dedicated, VPS with Plesk)

Login to Plesk
Click on the Websites & Domains tab.
Click on the Databases icon.
Click on the database you want to manage.
Click on the Webadmin icon.

Step 2: Optimize Tables

Select the database you want to optimize from the list in the left column, which should take you to the "structure" tab for the database.
Select the tables you wish to optimize by checking the check box in front of each one, or clicking on Select All if you want to optimize all of them.
On the drop down box that says "with selected..." select "Optimize Table." This will optimize the table and take you to a new screen.

Also read:

PHP Configuration in cPanel
Step by Step Approach to Password Protect a Directory in cPanel
The htaccess file and its uses



Optimization Recommendations for Popular Content Management Systems

WordPress

1. Select your WordPress theme carefully. Get a fast and well coded WordPress theme.
2. Install a Caching Plugin: The second most effective way to improve your site’s load times is to install a caching plugin. As soon as you install a plugin like W3 Total Cache or WP Super Cache, you’ll be able to tell that your site loads faster.
3. Enable GZIP compression on your WordPress installation.
4. Optimize your database:You can optimize your WordPress MySQL database directly from PHPMyAdmin, or by using a plugin like WP-Optimize or WP-DBManager.These plugins are capable of deleting all your pending spam comments, trashed posts, auto-saved drafts, post revisions to name a few. They can also perform general MySQL database optimization queries without you having to access PHPMyAdmin.
5. Optimize your images:Images constitute a largge portion of most websites and website speed have been found to increase tremendously with well optimied images. There are a few ways you can optimize your uploaded images.First of all, you should specify the maximum image dimensions for thumbnail, medium, and large sized images. That means, if you upload an image 1024px wide, and your content area is only 604px wide, normally the image will be scaled down using CSS. When you specify the maximum width of your ‘large’ images as 604px, it’ll then display the pre-resized, 604px wide image, which will be significantly smaller in size.


Joomla

Joomla is the net most popular CMS after WordPress. Like other CMSs, Joomla also needs to be optimized for speed and performance. Here are simple steps to optimize Joomla website:

1. Enable caching: You should make sure that caching is enabled in Global Configuration and in the pluging manager.
2. Optimize your images and be sure that you save them in web formats.
3. Turn on GZip compression in Global Configuration
4. Make sure to optimize your template CSS and JS files
5. Disable everything you do not need- components, modules and plugins and every other thing not needed.
6. Regularly optimize your database. This can be done manually in phpMyAdmin or with the use of a plugin.



Magento Optimiation

To optimize a Magento website, you follow this guide:

1. Run on the latest version: It is very important that you are always running the latest version of Magento as updates generally contain bug fixes and performance improvements.
2. Implement Caching: Caching is fundamental for every Content Management System. YYou may want to combining NGINX + APC + Memcache + Varnish caching. Magento comes with a built-in caching module as well, but 3rd party solutions seem to achieve better results. Make sure all Cache Types are enabled by navigating to “System” ? “Cache Management”.
3. Enable GZip Compression: Gzip compresses web pages and stylesheets at the server level before sending them over to the browser.
4. Implement Expire Headers in htaccess: Expire headers tell the browser whether they should request a file from the server or grab it from the browser’s cache.
5. Enable Flat Catalog:
Navigate to “Stores” ? “Configuration” ? “Catalog.”
Under “Storefront” change “Use Flat Catalog Category” and “Use Flat Catalog Product” to “Yes.”

Click on “Save Config.”
Clear the cache. The recommended way to do this is to delete everything from the /var/cache directory. You can also do it by navigating to “System” ? “Cache Management” and clicking on “Flush Cache Storage” which is equivalent to deleting all the cache.


6. Optimie Your Images: On average 56 percent of a website’s page size is made up of images. Optimizing your images can dramatically increase the speed of your pages as this decreases their download times. You can compress them before uploading them using a tool like PhotoShop or use extensions that can auto-optimize them. For Magento version 2 users, the following extension is good.

TinyPNG Extension

There are other fine etensions you will review and consider.

Drupal Optimization

These these simple and basic steps to improve your Drupal website:

1. Enable clean urls
2.
Don't forget that Caching is fundamental. Get some SEO modules and put the into active use: Redirect, Metatag,XML Sitemap. Please learn more about the modules you choose to apply before you activate them

  • 49 Users Found This Useful
Was this answer helpful?

Related Articles

I have a full backup of account through cPanel. How do I restore it?

It is recommended that you maintain healthy backup of your website and possibly download the...

How To Create, Edit, and Delete a File in cPanel Using File Manager

This tutorial will be useful for you to understand how to create a file, edit a file or delete...

How to Create and Manage a MySQL Database

Create MySQL Database and User via cPanel The MySQL Database Wizard is another useful tool...

How do I create and remove an Addon Domain?

An add-on domain is a separate domain name that you add to your web hosting subscription with...

How to Set Up and Delete a Cron Job

A cron job allows you to run a certain command at times set by the job. For example, you could...