Optimizing Apache Web Server
To increase the performance of your Apache web server, you can do the following:
- 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.
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.
Depending on your operating system, the following Apache modules are always enabled:
Debian or Ubuntu:
Redhat or CentOS:
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.
When you use this option, both HTTP and HTTPS traffic is logged to the
access_log file. Daily Maintenance task analyzes it and creates two
access_ssl_log.processed. Web statistics is counted based on these
If it is needed to analyze HTTPS and HTTP traffic separately, use the following commands:
grep https access_log
grep http access_log
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.