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 hitting maxclient - require Assistance for solution |
|
Author |
|
Rasheed_itsme
Joined: 02 Jul 2014 Posts: 12 Location: India
|
Posted: Thu 26 Feb '15 5:23 Post subject: Apache hitting maxclient - require Assistance for solution |
|
|
Hello,
I need assistance in understanding one issue we faced in our environment.
We have an application which has apache, Jboss and DB.
It was running fine but suddenly one day users got accessibility issue.
i checked the child process count and found the count is 65 while we set the maxclient as 64. 64 is more enough as our application will always have less than 40 almost all the time. This issue happens only two times in the last 3 year.
We understood number of parallel connection hitting the apache that is why it reached maxclient. I also confirmed it by seeing the error log with maxcleint reached error.
I restarted the apache. At the time of restarting the apache the process count reduced to normal but in seconds it reached again the max. For testing purpose i increased the maxclient from 64 to 75 and restarted. This time again the count reached 76 and then application not accessible with in seconds. We restarted for several times and after 2 or 3 hours in multiple restart of around 4 times it went normal.
Below is my concern. Could some one please help me in clarifying it.
1.) After we restart also maxclient reached again. If we restart all the connections should reset but in our case after reset also process cont increased and hit the max in seconds. Is that means Many connections are already in queue once we restarted the apache the current 64 concurrent connections only closed but it was filled again by the connections in the queue as soon we restarted ?
2.) Restart will not fix the issue when such a issue occurred , we have to stop and wait for sometime like 5 minutes and give time for all the connections to be closed and then start the apache or what else step we can do if this issue happens again? We can increase the maxclient so that this issue wont happen at all but as i said earlier we are not sure how much concurrent connections occurred at that time to find the new maxclient value as well as the concurrent connections will be always less than 40 through the year except this rare case. So i want the fix for this issue other than increasing the maxclient value.
Kindly please help me in resolving this issue if it occurred. |
|
Back to top |
|
niraj_vara
Joined: 03 Feb 2014 Posts: 6 Location: India
|
Posted: Thu 26 Feb '15 8:34 Post subject: apache max client |
|
|
Hi
increase you maxclient connection by this formula
#########
First find out the largest httpd process, change the httpd to apache2 if that's your thread name.
ps -aylC httpd |grep "httpd" |awk '{print $8'} |sort -n |tail -n 1
You'll get a number like 55687 - divide this number by 1024 to get megabytes - 54.38 MB.
After this stop apache (/etc/init.d/httpd stop or similar).
Then find out the free memory.
free -m |head -n 2 |tail -n 1 |awk '{free=($4); print free}'
You'll get a number like 2561 - this is already in Megabytes.
You can restart Apache now.
The final calculation for MaxClients is the second number divided by the first (free memory divided by max thread size).
eg. 2561/54.38 = 47
So MaxClient would be 47 or 50 is fine |
|
Back to top |
|
Rasheed_itsme
Joined: 02 Jul 2014 Posts: 12 Location: India
|
Posted: Mon 02 Mar '15 9:31 Post subject: |
|
|
Hello,
Thank you for the information. your comment is for to find how much maxclient we can set. I aware of it.
We are not sure how many connections hit a time. And also maximum concurrent connection crossing more than 64 count rarely. We faced this issue only twice in this 3 year. So we cannot allocate all the resource for an issue which comes very rare. And also we cannot guarantee that after giving all the server memory to this apache, it will not cross that maxclient as we are not able to determine how maximum its required.
Rather than increasing the maxclient, i would like to other workaround.
I shared my two questions already. It would be helpful if you help in that workaround.
1.) After we restart also maxclient reached again. If we restart all the connections should reset but in our case after reset also process cont increased and hit the max in seconds. Is that means Many connections are already in queue once we restarted the apache the current 64 concurrent connections only closed but it was filled again by the connections in the queue as soon we restarted ?
2.) Restart will not fix the issue when such a issue occurred , we have to stop and wait for sometime like 5 minutes and give time for all the connections to be closed and then start the apache or what else step we can do if this issue happens again? We can increase the maxclient so that this issue wont happen at all but as i said earlier we are not sure how much concurrent connections occurred at that time to find the new maxclient value as well as the concurrent connections will be always less than 40 through the year except this rare case. So i want the fix for this issue other than increasing the maxclient value. |
|
Back to top |
|
|
|
|
|
|