Optimizing Apache Web Server
To increase the performance of your Apache web server, you can do the following:
- Switch off unnecessary Apache modules to decrease the server resource consumption.
- Set up the Apache restart interval to decrease the number of Apache restarts.
- Choose the Apache restart type: graceful or normal.
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.
Note: 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
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.
Choosing the Apache Restart Type
When you change a website’s hosting settings, the changes take effect only after the Apache restart. You can choose between the Apache normal and graceful restart.
The normal restart immediately kills all Apache processes, which leads to a short downtime for all websites hosted on the server. The graceful restart instructs Apache to gradually replace the existing processes with new ones. This does not affect the websites and no downtime occurs.
To avoid downtime, Apache in Plesk uses the graceful restart by default. If the graceful restart does not work as expected, you can choose the Apache normal restart.
To choose the Apache normal restart:
- Go to Tools & Settings > Apache Web Server (under “General Settings”).
- Clear the “Apache graceful restart” checkbox and then click OK.