ru en
Help
Print version

Recommendations for hosting RAM reduced consumption

Contents

1. General information
2. Memory reduced consumption options
2.1 Disable unused Apache web server modules and extensions of PHP
2.2 Analyze website log files
2.3 Check scripts running with outside servers
2.4 Analyze website scripts running and requests to MySQL database
2.5 Analyze website layout
 

1. General information

The main resource on R01 hosting affecting website operation is the memory allocated for the processes on virtual web server. The allocated memory limit is set as per plan.

To ensure hosted website stable operation, memory consumption shall be in the limits set by the plan.

Hosting memory allocation graph is available in section "Web server" → "Resources usage" of the hosting control panel. The memory graph is updated every 5 minutes.

 

If memory graph (blue line) reaches and exceeds the limitations of the RAM allocated for this plan (orange line), there may be unstable operation, partial or full unavailability of websites, whereas the server does not have enough resources to process incoming requests and run scripts.

2. Memory reduced consumption options

2.1. Disable unused modules of Apache web server and PHP module extensions

In hosting control panel you can manage configuration of your Apache web server and PHP module.

Each enabled module will increase RAM consumption, so it is important to enable only those which are required for website operation. The list of website modules required for website operation can be clarified from the website developers or referred to in the appropriate CMS guidelines.

The following Apache modules are enabled on hosting by default: auth_module, cgi, realip_module, rewrite_module, autoindex_module, env_module, expires_module.

Check whether you have the following enabled Apache modules and disable them. Major

PHP and MySQL operated websites do not require them. It can be done in section "Web server" → "Modules management" of the hosting control panel. To view the full list of modules it is required to click on block "Advanced" in the bottom of the page

  • FastCGI  is required if you independently install software on hosting, operating as FastCGI server.
  • gzip_module  is required, if you configure gzip compression. Apart from enabling module the compression in file .htaccess shall be additionally configured. Disable the module, if you do not use this functionality.
  • mime_magic_module  enables web server to identify mime types of files, for majority of websites standard mime_module would be enough.
  • Perl  same as mod_perl, is required for operation of perl scripts specially composed for mod_perl. To launch perl scripts in most cases CGI module is used.
  • proxy_module  is required, if you intend to configure proxy of requests through apache web server.
  • bandwidth_module, usertrack_module, speling_module, limitipconn_module these modules consume low memory, but most websites do not require their functionality, thus they can be disabled too.

Management of PHP module extensions is carried out in section "Web server" → "Modules management" of the hosting control panel as per instruction:

We recommend first of all to check the following PHP module extensions, probably part of them is not required for your website operation:

  • Eaccelerator, APC  cache data in RAM, thus more RAM is required for this. Virtual hosting has not enough RAM for efficient operation of these modules.
  • mysql, mysqli, pdo_mysql — modules for operation with MySQL database, website usually requires one of them, thus unused modules may be disabled.
  • imagick, gd — modules for graphics operation, if website supports gd library, it is better to use it, whereas it consumes less memory.
  • imap  enables to work with mail servers via imap protocol, most websites do not require this option.
  • dba, sqlite, pgsql, pdo_sqlite, pdo_pgsql — modules for operation with the respective DBMS. Most websites use MySQL DBMS, these modules may be disabled.

If you are not sure, whether this or that module is required for website operation, their operation may be analyzed by disabling them one by one and checking correctness of websites operation.

2.2. Analyze website log files

Hosting directory of each website your_domain/logs stores log files to address website. Please, check, which addresses were made to the website at the moments of high memory consumption.

Website indexing by search engines, especially a number of them at a time, website visit increase causes higher memory consumption.

Some search engines enable to reduce intensity of requests of their robots per time limit. The information about these settings is available in documentation for these search engines.

2.3. Check website scripts running with outside servers

If your website receives data from outside servers, low speed or unavailability may affect your website operation.

The lower speed of the outside server is, the more time processes consume in RAM Apache.

2.4. Analyze website scripts operation and requests to MySQL database

Scripts optimization shall be targeted to minimization of RAM and time consumed for script running. Those data which update rarely should be cached.

We recommend to consult website developers as regards optimization of SQL requests. The quicker server executes database requests, the quicker web server receives all the required data, generates response to the client and releases the memory.

To view the requests to the database occurred at addressing the website and time of their execution you may use PHPMyAdmin interface, tab "Processes".

Optimization of requests to DB shall be brought to the following results:

  • all requests use indexes for data selection,
  • the use of temporary files and filesort operations is minimized.

All these data for each of these requests can be done through command EXPLAIN:

2.5. Analyze website layout

We recommend to optimize website layout by reducing number of uploaded items.

The less is the amount of requests to the server, the lower is the total processing time of requests and number of launched web server processes and, consequently, the lower is memory consumption.

Copyright © 2000-2024 Registrar R01
Information: info@r01.ru
Support: support@r01.ru
Office: 1 Bolshoy Gnezdnikovsky Lane, building 2, Moscow (Tverskaya metro station, entrance No. 9, Voznesensky business center)