How To Optimize Apache Server Performance On CentOS 7

Apache webserver widely used for website hosting and to make better the performance of Apache server, follow the few points mentioned below. let’s see, how to optimize Apache server performance. We can improve apache web server performance tuning using optimization parameters in Linux.

How To Optimize Apache Server Performance On CentOS 7:

Check Out: Install Varnish Cache To Speed Up Apache Performance

1. Configure MPM Prefork

One of the poor performance of the Apache webserver is having trouble in load the web page and then the MPM module can help you to enhance performance. how to optimise apache

By default, mpm_prefork_module is enabled in Apache.

If mod_deflate enabled, it will display mpm_prefork_module (shared).

There’s some setting for configuration of MPM in httpd.conf.

<IFModule prefork.c>
 StartServers 5
 MinSpareServers 5 
 MaxSpareServers 10
 MaxClients 200
 MaxRequestPerChild 4000

you can change the above values according to your server requirement.

2. KeepAlive

This sets if the server allows more than one request per connection. If you’re getting requests from hundreds of thousands of IP’s at once. So, you should make it “on”. By default, this is disabled.

KeepAlive on

Check Out: Disable HTTP TRACE or TRACK Request In httpd (Apache)

3. MaxKeepAliveRequest

This tells us the maximum number of requests to the server on a TCP connection. If it’s set to 0, an unlimited number of the request will be allowed.

Keep this value high for Apache performance. The recommended value of MaxKeepAliveRequest is 500.

MaxKeepAliveRequest 500

4. KeepAliveTime Out

This is a parameter that defines the number of seconds before closing a connection that means the maximum number of seconds Apache will wait to new request before closing the connection.

KeepAliveTimeOut 5

Check Out: How To Hide Apache Web Server Name

5. DNS lookups

if you enable the hostname lookup in httpd.conf file, so it can slow down the Apache performance because Apache will perform the DNS lookups to the server the request.

By default, it’s not defined.

HostnameLookups off

You’re done. apache web server apache optimization parameters performance tuning linux

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment