Print

SiteGround Tutorials



WebSite Performance Optimization

With the advance of technology, the price for extra CPU, Memory and Network bandwidth units has become negligible. Thus it has become affordable for most hosting providers to maintain very fast and powerful servers.

While the above is true in most cases, some hosts such as SiteGround have gone beyond the industry standards. We are proud to announce that the load on our servers is kept much below the server's capacity. This allows us to support almost every kind of site - from small personal sites to corporative business portals, from simple PHP scripts to huge forums.

Though no matter which your host is and how fast and optimized its servers are, your site may still load slowly. There are many factors, which affect negatively the site performance such as:

Very often it takes just a few steps to make your site load much faster. This could involve enabling cache, removing heavy modules or something else. There are plenty of articles on the net available for just about any web application. According to the application you use, find the correct link below:


Connectivity Problems

In order to troubleshoot such issues you have to check the internet connectivity to your server. Here are some tips:

  • Run ping and traceroute checks. Compare the results with other sites. Usually results with less than 200 ms are fine and do not indicate problems;
  • Try working in your control panel (cPanel, Plesk, Vdeck, etc.);
  • See how fast mails download.

Most shared hosting servers are situated in the USA which is a priority destination for all Internet service providers. You can find where your site is hosted from here.

Connectivity affects greatly your site when on it you have:

  • Flash animations;
  • Big graphics;
  • Huge file downloads.

Application / Development problems

This is probably the most common case for a website being slow. There are many helpful tools for investigating this problem. We recommend this web page analyzer and Firefox's addon called YSlow.

Here is what it includes:

  • Slow / heavy MySQL database queries - such are known to be generated by various popular applications (forums, cms, ecommerce solutions) and custom scripts.

A MySQL query is considered slow and heavy when it is executed for longer than 1 second. Such queries are not common and that's why they are logged for additional troubleshooting. Every host keeps such logs (when there are any) and should provide them upon customer's request.

Once your host provides you with the slow queries log, you will know which MySQL queries are slow. Then you can begin optimizing your code and database. There are many useful resources on the web to get you started but very often this task requires advanced programming skills.

  • Slow inclusion of remote scripts and resources - this is the case when you include RSS feeds, flash animations, banners and others.

When you include remote resources you are already slowing down your site. Sometimes this will have little or no effect (Google Adsense for example), other times it will slow down pages with seconds (RSS news feeds).

A good practice is to make sure that the remote resource is not downloaded for each site visit. For example, if you have a news RSS feed, you should set a cron to download the news each hour and then include it in your page. Generally, any kind of content caching will help in such cases.

Unfortunately, this is not applicable for dynamically loaded content when it is important to have fresh results (gaming servers status queries). In such cases you can do little but to accept this drawback. 

  • Slow inclusion of local scripts and resources - usually this is when your pages are overpopulated with content. Other times there are slow / looping scripts executed, images / animations are loaded incorrectly.

The first case is when a page includes too many articles, chatboxes, weather modules, flash animations, etc. Then, in order your page to load it will execute hundreds of sub-scripts which make many database queries, load content worth megabytes and so on. If you take a look at popular web sites or portals, you will find that most of them are kept as compact as possible. This is because each additional content slows down regardless of how powerful the host server is. This is exactly what we recommend - keep your website as compact as possible. Adding too much content usually just slows down your website and confuses your visitors.

Other times there are just buggy scripts making loops, others which are being closed incorrectly and so on. Slow scripts may also include incorrectly resized graphics or try to preload big flash animations. In such cases it is a good idea to try opening images / flash animations outside of your scripts and see how long it takes them to load.


Incorrect Scalabilty

As we have mentioned earlier, the price for extra CPU, Memory and Network bandwidth units has become neglectable. Though there are still limits and every server has a certain limit to its capacity. Along with that, web applications become more resource demanding by default and their needs grow very fast when the site's popularity increases. Naturally, any server's capacity can be exceeded when the server is overloaded with unstable performance.

Thus, if you have not planned correctly the scalability of your website, there will be slowdowns if not even service interruptions. Estimating the exact needs of your website is very hard because there are no general thruths. For example, no one can estimate how much memory / CPU is needed for a forum with 1000 users. An SMF forum with 1000 users and 100 000 posts may perform as good as a vBulletin forum with 2 000 users and 50 000 posts.

Here is the place to mention an interesting phenomenon called the Slashdot effect. It is observed when a popular website features a smaller one, forwarding an unexpectedly high number of visitors to it. Usually this makes the smaller site totally inaccessible. A similar result can be accomplished by a very agressive marketing campaign.

That's why it is generally wiser to ensure more server resources than your current needs seem to be. This will allow you to develop and grow firmly your online presence while keeping your site stable and fast.

When thinking of scalability you have to take into consideration the provided RAM Memory and CPU units. Generally your options are:


Shared hosting account - provides shared server resources (not strictly predefined) to many websites

Pros:

  • Affordable prices;
  • Ease of use with least technical knowledge required;

Cons:

  • CPU and Memory units are unequally shared by all users;
  • Resource overusage is not tolerated and performance is optimized for the average user;
  • Custom server configurations are not allowed. Such would have effect on all users on the server;



Virtual private server (VPS) - a server is virtually divided into several virtual servers with guaranteed Memory and CPU units

Pros:

  • Dedicated CPU and Memory units;
  • Performance is very flexible. Burst CPU and Memory usage is allowed even though for short periods (less than 5 mins);
  • Easy to upgrade / downgrade between plans;
  • Custom server configurations are allowed;
  • Ease of use - usually website control panels (cPanel) do not differ from those for the shared hosting;

Cons:

  • Higher prices;
  • Virtualization works with software limits which are vulnerable to heavy overloads. If a VPS has very heavy resource overusage the whole VPS node may be affected;

 


 Dedicated servers - preferred by professionals who have better understanding of their sites' needs

Pros:

  • Guaranteed dedicated CPU and Memory units;
  • Custom server configurations are allowed;
  • Full access to the server configuration;
  • Easy Memory upgrades;

Cons:

  • Higher prices;
  • Advanced skills and knowledge are required to take full advantage of the server;
  • No performance flexibility;
  • Hard CPU and Disk upgrades;

How to optimize Joomla 1.0.x

Here are some tips on how to improve the performance of your Joomla 1.0.x website:

  • Enable the caching for Joomla. This will signifficantly improve the performance of your website. You can do that from the Global Configuration menu -> Cache tab;
  • Disable/remove all extensions from your website that  you are not using;
  • Reduce the number of articles which appear on your front page;
  • Optimize your Joomla database by following the instructions in our article on How to optimize a MySQL database;
  • Check that you have not turned on statistics in your administrator backend. The Joomla 1.0.x statistics can create a heavy load on a busy site and should not be used on anything except the smallest, low-traffic sites. For more information on that matter, follow our tutorial on How to disable the statistics extensions in Joomla 1.0.x;
  • If you are using a forum extension, make sure you require from your visitors to register prior searching and posting in your forum. In addition, you should install a CAPTCHA plugin or enable such core functionality if present in order to protect your board from spam bots;
  • Use the PhpMyAdmin tool to check for big tables in your Joomla database. You can then check which extension uses this table and remove it from your website



    Usually, such issues are caused with old forum extensions that are attacked by spam bots. The tables that store the forum posts get filled with spam and become really big. This slows the entire performance of your website. Such tables should be deleted manually using the PhpMyAdmin tool. To delete a table mark the check box left to it and click on the red cross icon. Confirm the changes to permanently erase the table

    Important Make sure you are deleting tables, created by extensions you have already uninstalled from the Joomla back end! If you delete any of the Joomla's core tables this will render your website to be inaccessible!

 

Previous

How to optimize Joomla 1.5.x

There are several things that you can do in order to improve the performance of your Joomla 1.5 website:

  • Enable the Joomla caching system from the admin area > Global Configuration > System. For more information on how to do that you can check this tutorial. Enabling cache will signifficantly improve the performance of your website;
  • Keep the number of extensions as low as possible. Do not install components or plugins you do not actually need;
  • Remove/Unpublish the extensions you are not using;
  • Optimize your Joomla database by following the instructions in our article on How to optimize a MySQL database;
  • Use the phpMyAdmin tool to check for big tables in your Joomla database. You can then check which extension uses this table and remove it from your website.



    Usually issues with big tables are caused by old forum extensions that are attacked by spam bots. The tables that store the forum posts get filled with spam and become really big. This slows the performance of your entire website. Such tables should be deleted manually using the phpMyAdmin tool. To delete a table mark the check box left to it and click on the red cross icon. Confirm the changes to permanently erase the table.

    Important Make sure you are deleting tables created by extensions you have already uninstalled from the Joomla back end! If you delete any of the Joomla's core tables this will probably break your website.

 

  • Reduce the content on your front page. Organize your information into categories and sections. This will reduce the loading time of your website and help your visitors navigate better through your information.

 

Previous

How to optimize Drupal

There are several steps that you should follow in order to improve the performance of your Drupal-based website:

First, you should enable the caching system of your Drupal application. In order to do this, login as administrator and go to the Administer -> Site Configuration -> Performance menu. In it, set the values of Caching Mode to "Normal" and Block Cache to "Enabled". Then, click on the "Save configuration" button at the bottom of the page.

Next, you can disable all the modules/blocks that you are not actually using. To do this, go to the Administer -> Site Building -> Modules menu. Note that the enabled modules have a check in the "Enabled" column. Remove this check for all the modules you want to disable and then click on the "Save configuration" button at the bottom of the screen.

Finally, you should optimize your Drupal database. For more information on that matter, please refer to our article on How to optimize a MySQL database.

In addition, you can try reducing the content you are displaying on your front page. Too much links/images/scripts on your main page can signifficantly increase the time your website needs to load.

 

Previous

How to optimize WordPress

Here are some tips on how to improve the performance of your WordPress blog:

  • Reduce the number of posts on the front page of your blog
  • Install anti-spam plugins in order to prevent spam-bot from creating load on the server.
  • Optimize your WordPress database. You can do this using a plugin like this one or directly through the PhpMyAdmin tool in your cPanel.
  • Install a caching plugin such as WP-Cache or WP Super Cache.
  • Decrease the number of external and internal links on your pages. Leave only the most important ones.

 

Previous

How to optimize phpBB2

This tutorial will show you how to optimize your phpBB2 forum. You may also take a look at our Converting from phpBB2 to phpBB3 tutorial. We recommend upgrading to phpBB3 because the new version offers many new features and enhanced security.

 How to optimize your phpBB2 forum

There are several things you can do to optimize the performance of your phpBB2-based message board.

Make sure your phpBB2 forum is upgraded to the last version of the branch - 2.0.23. You can downlad the official installation/upgrade package from the phpBB official website.

You should do everything possible to prevent spam bots from registering and posting in your forum. If spam bots manage to register and start posting spam topics/replies, this will signifficantly increase the size of your forum database. This, in turn, will slow down your entire forum.

To prevent your forum from being overrun by spam bots, you should log in to your forum's admin area and click on the "Configuration" link in the left menu. There set the following settings:

  • Enable Visual Confirmation - Yes: This will enable CAPTCHA for users who want to register in your forum;
  • Flood Interval - set this option to at least 60 seconds. It defines the number of seconds a user must wait before posting again;
  • Search Flood Interval - set this option to at least 60 seconds. It defines the number of seconds a user must wait between search requests;
  • Enable Forum Pruning - Yes. This option will enable the pruning functionality of the phpBB2 forum. This means that you will be able to delete old topics if there is no reply in them for some period of time.

Disable the search function for guests and allow it only for registered users. Information on how to do this can be found in this article.

Do not add extra mods unless you really need them. Many forum plugins cause high server load and increase the size of your database.

If you have a large forum with thousands of members, you could try implementing the tweaks described in this topic.

Optimize your phpBB database by following the instructions in our article on How to optimize a MySQL database.

 

Previous

 


How to optimize phpBB3

This tutorial will show you how to improve the performance of your phpBB3 forum.

How to optimize your phpBB3 forum

Keep your application up to date. It is important to upgrade your forum when a new version is released. Latest application versions contain important bug and security fixes.

Disable the search function for guests and allow it only for registered users. Instructions how to do this can be found here. This will block attacks that use your forum's search option.

Do not add extra mods unless you really need them. Adding many mods to your forum can signifficantly increase the size of its database and thus cause high server load. You should use only mods that you actually need.

Protect your forum against spam bots. If your forum is attacked by spam bots, thousands of topics and posts can be added to it in a very short period of time.  This will greatly increase the size of your phpBB database, which in turn will slow down your forum.

To prevent your forum from being overrun by spam bots, you can make the following changes to your forum's configuration:

Enable the visual confirmation for new users. You can do this from the "Visual confirmation settings" menu under the "General" tab in your forum's admin area. In this menu set the following settings as follows:

  • Enable visual confirmation for registrations: Enabled - By enabling CAPTCHA in your forum you will require new users to enter a random code matching a displayed image. This will prevent mass registration of spam bots. 
  • Enable visual confirmation for guest postings: Enabled - This will require from your guests to enter a code matching a displayed image before posting. By doing this you can allow normal visitors to post without registration but block spam bots from posting in your board.
  • GD CAPTCHA: Yes - Set this option to yes in order to use the newest CAPTCHA that phpBB3 supports.
  • GD CAPTCHA foreground noise: Yes - This will make the image even harder for bots to recognize as text.
  • GD CAPTCHA background noise x-axis: 9
    GD CAPTCHA background noise y-axis: 11 - From the experience we have gathered supporting thousands of phpBB3 forums, those are the best values to have a secure CAPTCHA image. This is the perfect balance between a recognizable by humans and at the same time hard for bots image.

Optimize your phpBB database by following the instructions in our article on How to optimize a MySQL database.

 

Previous

 


How to optimize vBulletin

Here are some tips on how to improve the performance of your vBulletin forum:

 

Previous

How to optimize Zen Cart

To improve the performance of your Zen Cart-based website, you can make these changes:

  • Turn off Category Counts from the Zen Cart Admin area > Config > My Store > Show Category Counts.
  • Reduce the number of products shown on your main page.
  • Optimize your osCommerce database.
  • Keep the number of additional contributions as low as possible. Install only the most necessary ones.

 

Previous

How to optimize osCommerce

In order to improve the performance of your osCommerce-based website, you can make these changes:

  • Reduce the number of products shown on your main page.
  • Optimize your osCommerce database.
  • Keep the number of additional contributions as low as possible. Install only the most necessary ones.
  • Disable all default osCommerce features you are not using.
  • Keep the number of external links as low as possible.

 

Previous

How to optimize e107

To improve the performance of your e107 website, you can make the following changes:

  • Enable caching for your e107. You do this from the Admin area > Settings > Cache. Once there, you should check Cache data saved to disk file and click Set cache status to save the change.
  • Keep the number of active plugins as low as possible. Use only the plugins you really need.
  • Optimize your e107 database
  • Decrease the number of external and internal links on your pages. Leave only the most important ones.

 

Previous

How to optimize SugarCRM

SugarCRM is the world's leading provider of commercial open source customer relationship management (CRM) software. Sugar easily adapts to any business environment by offering a flexible, cost-effective solution to your needs.

By default, its loading time is above average. You can, however, further improve the performance of the application by making the following changes in its configuration:

  • Drop the absolute totals from List Views by adding  'disable_count_query' = true;  to your SugarCRM's config.php file.
  • Alternatively, you can create a file config_override.php and add $sugar_config['disable_count_query'] = true; to it.
  • Disable Automatic query repetition on to config_override by adding $sugar_config['save_query'] = 'populate_only'; to config_override.php.
  • Disable Client IP verification by adding $sugar_config["verify_client_ip"] = false; to config_override.php.
  • Disable VCR control by adding $sugar_config['disable_vcr'] = true; to config_override.php
  • Hide unused subpanels by adding these lines to config_override.php: $sugar_config['hide_subpanels'] = true; and $sugar_config['hide_subpanels_on_login'] = true;
  • Enable slow query logging by logging in to your SugarCRM as admin and going to Admin > System Settings. Once there, check the box next to Log slow queries. and then optimize your SugarCRM database.

 

Previous

 


How to optimize Mambo

Here are some tips on how to improve the performance of your Mambo website:

  • Enable the caching for Mambo. This will signifficantly improve the performance of your website. You can do that from the Mambo admin area > Global Configuration menu > Cache tab;
  • Disable/remove all extensions from your website that  you are not using;
  • Reduce the number of articles which appear on your front page;
  • Optimize your Mambo database by following the instructions in our article on How to optimize a MySQL database;
  • Make sure you have not turned on the statistics in your Mambo administrator backend. Mambo statistics can create a heavy load on a busy site and should not be used on anything except small, low-traffic sites. You can disable the statistics from the Mambo admin area > Global Configuration menu > Statistics tab;
  • If you are using a forum extension, make sure you require from your visitors to register prior to searching and posting in your forum. In addition, you should install/enable a CAPTCHA functionality in order to protect your board from spam bots;
  • Use the phpMyAdmin tool to check for big tables in your Mambo database. You can then check which extension uses this table and remove it from your website;

Usually, such issues are caused by old forum extensions that are attacked by spam bots. The tables that store the forum posts get filled with spam and become really big. This slows the performance of your entire website. Such tables should be deleted manually using the phpMyAdmin tool. To delete a table, mark the check box left to it and click on the red cross icon. Confirm the changes to permanently erase the table;

 

 

Important Make sure you are deleting tables created by extensions you have already uninstalled from the Mambo backend! If you delete any of Mambo's core tables this will break your website's functionality!