Optimizing Apache Web Server

To increase the performance of your Apache web server, you can employ the following practices:

  • Switching on and off Apache modules allows decreasing the server resource consumption by using only Apache modules that you really need for proper functioning of websites on your server.
  • Running Apache with piped logs increases the website density on the server.
  • Setting up the Apache restart interval allows you to decrease the number of Apache restarts.

Next in this section:

Switching On and Off Apache Modules

Running Apache with Piped Logs

Setting Up the Apache Restart Interval

 

Switching On and Off Apache Modules

You can switch off the Apache web server modules that are not critical to hosting services in Tools & Settings > Apache Web Server. This will allow you to reduce server resources consumption (for example, get the smaller RAM footprint that is critical to VPS) and, as a result, provide for more hosting customers on a server.

Note that some modules are interdependent and can be switched off (on) only when the modules they depend on are off (on). For example, the cache module depends on disk_cache, file_cache, and mem_cache modules. This means that you cannot switch off the cache until its three dependent modules are off.

Caution: This feature is for advanced users only. Toggle modules only if you completely understand the consequences of your actions. Note that some modifications may reduce Apache performance or even lead to it becoming inoperable. In addition, these changes may affect certain Plesk functions. For example, if you turn off mod_perl or mod_php, the Perl and PHP scripts (including webmail) will stop working on websites. This may cause a situation in which you offer a feature that does not work in a service plan.

Depending on your operating system, the following Apache modules are always enabled:

Debian or Ubuntu:

  • env
  • auth_digest
  • authn_file
  • authz_host
  • authz_user
  • actions
  • alias
  • dav
  • dav_fs
  • mime
  • ssl

Redhat or CentOS:

  • env
  • auth_digest
  • authn_file
  • authz_host
  • authz_user
  • actions
  • alias
  • autoindex
  • dav
  • dir
  • log_config
  • mime
  • negotiation
  • setenvif
  • ssl

SUSE:

  • env
  • auth_digest
  • authn_file
  • authz_host
  • authz_user
  • actions
  • alias
  • dav
  • dir
  • log_config
 

Running Apache with Piped Logs

If you are going to host more than 300 domains or web sites on your server, we recommend that you switch on the support for piped logs in the Apache web server. By default, Apache restarts when it needs to process log files, for example, rotate them. When the number of websites on your server is about 300 or more, this will slow down the server because of frequent Apache restarts. If you switch on the support for piped logs, Apache will write error and access logs through a pipe to another process instead of direct writing to log files. This lets Apache work without restarting every time it processes the logs.

You can switch on the support for piped logs using the Tools & Settings > Apache Web Server > Piped Logs option.

Note: If you host more than 256 websites on your server, the ulimit value in the nginx configuration will be adjusted automatically.

 

 

Setting Up the Apache Restart Interval

When users perform operations with domains and subdomains (such as creating, removing, or changing their configurations), the changes take effect only after the restart of Apache.

If you want to avoid too many Apache restarts, you can set a fixed interval of time in which Plesk should restart Apache. Note that if the interval is 0 seconds, Apache restarts immediately after each change. It is recommended to always set this interval to more than 0 seconds, especially if users perform a lot of operations with domains and subdomains through Plesk.

If during the specified interval of time no changes were made with domains, Apache will not restart.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Automated website copying in Plesk 12

Log in to the Plesk Control Panel Go to the Websites & Domains and click the name of the...

How to set up custom nameservers in Plesk

Once your domain has been created in Plesk you will need to configure the DNS settings for your...

Logging In to Plesk

To log in to Plesk, open your web browser and open the following address:...

Plesk Editions

Starting from Plesk 12, you can choose from four Plesk editions that have features mostly used by...

Plesk Users

Plesk is a web hosting control panel that targets three user groups: Administrators. These...