How to reduce the number of executions generated by your website
To achieve a good website performance it is very important to optimize the number of the executions. The most common cause for excessively high number of executions is either something irregular happening to your website that can be addressed and stopped, or in the better case a legitimate peak in your website traffic, which can also be addressed and handled.
What is an execution?
A simple example of an execution is when a visitor opens your website and your index PHP file is loaded. This counts as one execution. The more visitors your website has, the more executions it will generate. Please note that this is valid only for dynamically generated content. If you open a picture or an HTML page a new execution will not be generated on the server. Executions are counted for the following scripting languages - PHP, Perl, Python, Ruby, etc.
Using Awstats to identify irregularities that cause high number of executions
In order to reduce the number of executions generated by your website you have to identify the source of the issue. Sometimes the high number of executions is not created by high number of legitimate visitors and you may be able to lower it by taking some corrective actions. The best way to do this is on a SiteGround hosting account to use the Awstats tool in your cPanel.
There are three sections in Awstats that you can check to identify a possible issue:
The Awstats section Pages-URL (Top 25) provides you with useful information about which part of your website is most viewed. You should check this section to identify the pages that generate the executions. Below we will talk about the most common execution generators:
- Chat/calendar or other modules that refresh their content constantly can generate many executions and you will be able to see the executions in this section. For example, if your site uses a calendar module and you see that the calendar.php script has been accessed many times then it is a good idea to disable this module.
- Application login pages. Very often sites are abused by bots that try to gain administrative access. If you see many requests to your site's admin login page (Joomla! administrator folder, WordPress wp-admin.php, etc.) you can do two things:
- Comments sections. Very often sites are abused by bots that try to post spam comments. If you see many requests to your site's comments section (WordPress wp-comments.php, Joomla! JComments, etc.) then you should add CAPTCHA that will show an image to your visitors before allowing them to post a comment in order to prevent bot’s requests. There are many CAPTCHA extensions for WordPress, Joomla!, Drupal, etc. that you can use to protect your site's comments section/contact forms.
The Awstats Hosts (Top 25) section displays a table of hostnames or IP addresses that have accessed your website. If you recognize an extensive number of visits from a certain IP address or a network, you can block the access to your website from it to prevent a possible DoS attack against your site. For example, if you notice many requests from Chinese IP addresses and your visitors are mainly from Europe then you can block the Chinese IPs to reduce the number of executions. For more details how to block IPs check this article.
Robots/Spiders visitors (Top 25). As you probably know, search engines use bots to index websites on the Internet. Those visits to your website are recorded and shown in this category. Sometimes bots generate too many executions and you need to either block the bots or decrease their crawl rate. If you notice too many requests from certain bots than you can change their crawl rate. The way you set the crawl rate depends on the particular bot. For example, you can modify the crawl rate of the Google bot from your Google Webmasters Tools account.
Using the SuperCacher to handle executions generated by legitimate high traffic
In some cases, however, the number of executions is too high because your site has become too popular or because you've recently launched a new marketing campaign. If this is case then a possible solution is to configure your site to use our SuperCacher service. To reduce the number of executions you need to enable the SuperCacher Dynamic cache feature, that is available for all hosting plans GrowBig and higher. Right now this feature supports WordPress, Joomla! and Drupal websites. Once you enable the Dynamic Cache the SuperCacher will generate cached copies of your site's pages. When a new user attempts to open one of the pages it will be taken from the cache instead of generating a new execution.