How to configure Apache with less memory httpd configuration

Apache2 can be configured to handle a decent load of web traffic with a server or VM that has less memory. We can configure Apache on servers less than 1 GB to handle websites like WordPress to handle traffic like 150 requests per min. But this requires tuning of httpd configuration as well as WordPress also.

Apache2 or httpd install on Linux with proper httpd. conf settings we can achieve this.

configure apache web server in Linux for less than 1 GB with decent load handling capability
Default httpd or Apache2 config file is httpd.conf. You can append the following entries.


KeepAlive Off
StartServers 6
MinSpareServers 5
MaxSpareServers 15
ServerLimit 100
MaxClients 100
MaxRequestsPerChild 1000

Next enable gzip compression for Apache webserver. Deflate is the Apache module that handles this compression. In most Linux installations, it is enabled by default.
Append following in httpd config file.

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
ServerSignature Off
ServerTokens Prod

Here I am talking about httpd-2.4.6-97.

At WordPress,cache plugin and CDN usage will help you. WordPress theme with less number of DB connections is also a good contributor for our task.

Published
Categorized as Linux

Leave a comment

Your email address will not be published. Required fields are marked *