• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Apache performance server reached MaxClients setting

erhnam

Basic Pleskian
I have a plesk (7.5.2 box) running with Redhat 9. This machine (Pentium 4 1024 mhz) was running fine for quite a long time. This week one of my sites became very populair and this gives me some troubles. The apache server stops to work and I need to restart it within every 10 minutes. Then apache is up and after 10 minutes its down again. The server log said this:

[error] server reached MaxClients setting, consider raising the MaxClients setting

So I changed the MaxClients from 100 to 256.
This will increase the dying time from 10 minutes till 20 minutes but does not solve the problem. When I check the apache status I see this:

/etc/init.d/httpd status
httpd (pid 5073 5072 5071 5070 5069 5068 5067 5065 5064 5063 5062 5061 5060 5059 5058 5057 5056 5055 5054 5053 5052 5051 5050 5049 5048 5034 5033 5032 5031 5030 5029 5028 5027 5026 5025 5024 5023 5022 5021 5019 5018 5010 5009 5008 5007 5006 5004 5003 5002 4998 4997 4995 4994 4991 4990 4988 4953 4952 4951 4950 4949 4947 4946 4945 4944 4943 4942 4941 4940 4939 4938 4937 4936 4935 4934 4933 4932 4930 4929 4928 4927 4926 4925 4924 4923 4922 4921 etc etc etc

This is my current httpd.conf:

KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15

<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 20
MaxClients 256
MaxRequestsPerChild 1000
</IfModule>

<IfModule worker.c>
StartServers 2
MaxClients 256
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>

Please let me know how I can solve this problem!
 
Do not a Graceful Restart of Apache. The Memory rise up. You must Stop/Start it.

I had the same problem and SW-Soft fixed it with this.
 
Yes but after a restart of the apache webserver the problem is back again after just 15 minutes. Right now apache is restarting every 10 minutes but is not a proper solution.
 
Where do you set the order (graceful or start/stop action)?
 
erhnam - you didn't mention how high your hits are getting. By default, the ServerLimit directive is 256, so if you put 'ServerLimit 500', then you will be able to increase the MaxClients above 256.

You will want to put ServerLimit after 'KeepAliveTimeout 15' and before '<IfModule prefork.c>'

Solving the problem consists of having both limits set for the load which your hardware can safely handle as well as the amount of hits you expect to get.

If the load then jumps higher, you will need to readjust the limits again.

What are the hardware specs of your server?
 
Thanks for your post! You made my day. The specs are:

Pentium 4, 3 Ghz, 1024 Mb RAM.

I raised the number to 500 and now the problem seems to be gone. I'm going to replace the 1024 mem by 2048 in case if 500 limits is not enough.
 
I was going to suggest more ram...:D

I am assuming the CPU is HT, so then the question is did you install the SMP version of RH9?
 
More ram and A.R.T.'s httpd-highfd replace your current httpd build......


-poke
 
Back
Top