Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: apache performance issues |
|
Author |
|
djxtc
Joined: 24 Mar 2018 Posts: 2 Location: UK, London
|
Posted: Wed 12 May '21 0:06 Post subject: apache performance issues |
|
|
im having severe issues on a server running apache 2.4.6 on centos.
Im running in prefork mode and during high load i can see the processes running in centos are very high and within just a couple of minutes a lot of httpd processes are started.
I have these values configured for prefork
StartServers 40
MinSpareServers 25
MaxSpareServers 100
ServerLimit 600
MaxRequestWorkers 500
MaxConnectionsPerChild 500
KeepAliveTimeout 2
Hardware resources are ok, CPU and MEM are low usage. I cant see any errors in apache log either, clients suddenly cant connect and receive timeout errors.
Any ideas on what might be wrong or needs to be tuned? |
|
Back to top |
|
tangent Moderator
Joined: 16 Aug 2020 Posts: 348 Location: UK
|
Posted: Wed 12 May '21 21:47 Post subject: |
|
|
Is there a specific reason you're using pre-fork over worker or event MPM's?
The latter two are more efficient under high loads. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 12 May '21 21:50 Post subject: |
|
|
Disable the apache status module that is a great boost.
Use worker or event mpm (Both don't run with mod_php, but you can use mod_fcgid for PHP).
Disable DNS lookups.
Enable mod_h(ttp)2 if you can.
Enable and configure mod_deflate.
Quote: | MaxConnectionsPerChild 500 |
Why do you kill a child that often? Every 500 requests the parent process will kill a child process and create a new one. That takes time and resources. |
|
Back to top |
|
|
|
|
|
|