You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeff Trawick <tr...@gmail.com> on 2014/08/21 22:54:25 UTC
Re: [users@httpd] MaxRequestsPerChild - New child process doesn't
process requests
On Thu, Aug 21, 2014 at 4:39 PM, Vattikuti, Vamsi Krishna Venkata (STSD) <
vamsik@hp.com> wrote:
> Hi,
>
>
>
> We are having an issue with Tomcat application accessing through proxy and
> details are below. Can you please check and share your feedback.
>
>
>
> *Issue:*
>
> We have an application(tomcat) accessed through proxy as below. Also, we
> have MaxRequestsPerChild setting as 100
>
>
>
> Whenever MaxRequestsPerChild reached its limit, a new process is started
> but the application become unresponsive. It seems that new process doesn’t
> service any requests
>
> We have to restart httpd to recover that
>
>
>
>
>
> *Log:*
>
> - Access.log doesn’t show any requests for new child
>
> - Error_log shows that
>
> a) workers are initiated for new process but it didn’t service any
> requests
>
> b)
>
> c) processing has stuck for a minute due to some reason
>
> [Fri Aug 08 16:09:17 2014] [debug] ssl_engine_kernel.c(2118): [client
> 127.0.0.1] Certificate Verification, depth 0 [subject:
> /C=y/ST=y/L=y/O=y/OU=y/CN=y, issuer: /C=y/ST=y/L=y/O=y/OU=y/CN=y, serial:
> xyz]
>
> [Fri Aug 08 16:10:12 2014] [info] [client 10.150.90.25] Connection to
> child 6 established (server *:<port number from client>)
>
>
>
> d) SSL handshake has started but didn’t complete for 4 connections
> related to new process. There are no errors related to ssl
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c start
>
> 707
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c done
>
> 703
>
> $
>
>
>
> *Apache version:*
>
> 2.2.15
>
>
>
>
>
> *Proxy setting:*
>
> SSLProxyEngine On
>
> SSLProxyCipherSuite ALL
>
> SSLProxyMachineCertificateFile /var/ssl/proxy.pem
>
>
>
> proxyPass /app1 https://localhost:<port number>/app1 (Tomcat)
>
>
>
> *Worker configuration:*
>
> KeepAlive On
>
> MaxKeepAliveRequests 100
>
> KeepAliveTimeout 15
>
> <IfModule worker.c>
>
> StartServers 1
>
> MaxClients 25
>
> MinSpareThreads 12
>
> MaxSpareThreads 25
>
> ThreadsPerChild 25
>
> ServerLimit 1
>
> MaxRequestsPerChild 100
>
> MaxMemFree 50
>
> </IfModule>
>
>
>
> Thanks & Regards,
>
> Krishna
>
MaxRequestsPerChild 100 is ridiculously low. What is happening in httpd to
cause you to need that setting?
Anyway...
Once an httpd child process has reached 100 connections, it initiates a
graceful shutdown, which means that instead of aborting current requests it
will instead wait for current requests to finish, then exit.
During the time that it is waiting for current requests to finish, new
connections must be handled by other child processes. BUT you set
ServerLimit to 1 (and other directives such as ThreadsPerChild and
MaxClients are consistent with allowing only one child process), so no
other child process can be created during that time.
Thus, once 100 connections are handled, new clients will be blocked until
existing requests finish.
--/--
My guess: Your Java application takes a long time (maybe forever?) to
handle some requests. MaxRequestsPerChild makes it worse. If the Java
requests are slow and eventually finish, the solution is to keep a steady
set of httpd child processes (having them gracefully exit when there are
slow backend requests can be harmful) and increase the number of httpd
threads/child processes to handle the load.
If some Java requests hang, see how to handle that on the Tomcat side.
Enable server status with ExtendedStatus On and watch what happens --
whether or not certain requests handled by the Java application take a
relatively long time, tieing up some or all of your very limited number of
httpd threads.
--
Born in Roswell... married an alien...
http://emptyhammock.com/
[users@httpd] RE: Websites not loading properly / consistently
Posted by Sharon Zastre <SZ...@dryden.ca>.
Thought I would list a few of the changes that I made to the Apache configuration file httpd.conf. So far these seem to have fixed the issue but time will tell.
•Created a scheduled task to restart the Apache Service daily
•Set the "ServerName" parameter to localhost and port number
•Uncommented "Include conf/extra/httpd-mpm.conf" line to configure the connections to Apache. The settings in this file can be adjusted if needed, for now I have kept the defaults.
•Added the following lines to fix an Asynchronous AcceptEx fail error
"AcceptFilter https none
AcceptFilter http none
EnableSendfile Off
EnableMMAP off"
Hope this can help someone else.
Thanks,
Sharon
-----Original Message-----
From: Sharon Zastre [mailto:SZastre@dryden.ca]
Sent: Friday, August 22, 2014 1:02 PM
To: users@httpd.apache.org
Subject: [users@httpd] Websites not loading properly / consistently
Hello,
I have several sites created, both internal and external. The external sites are proxied out using Apache 2.4.9 OpenSSL 1.0.1g. Some sites are secured while others are not. I notice that the first time that I attempt to access the external sites, often I will need to reload / refresh in order for it to work. Not a big deal if it is just one refresh. But I’m still wondering why this is happening? I believe it is related to Apache since the internal sites load fine. Any ideas for the need to reload the sites?
But the bigger issue is with the external and secure sites. These sites in particular take a long time to load and will often time-out either while trying to load the site or trying to authenticate the user/password. This has become more of an issue over the last week or two.
Now I am not very familiar with Apache so please be gentle. But it seems like requests are taking too long and then hang. When the number of processes becomes too large, then the sites are no longer functional. I have included the httpd-mpm.conf and am testing it out to see if it makes a difference. Wondering how I should adjust the settings to get the best performance. The odd time it will load but it is very inconsistent; which makes it more difficult to troubleshoot. Any suggestions as to what the issue may be or where to look for more info is greatly appreciated.
Error log shows a couple of messages:
- Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
- The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.
Thanks in advance for your help,
Sharon
DISCLAIMER: This communication and any files transmitted with it may contain information that is privileged or confidential and is intended to be for the use of the individual (s) or entity named above. This material may contain confidential or personal information which may be subject to the provisions of the Municipal Freedom of Information & Protection of Privacy Act. If you are not the intended recipient of this communication and any files transmitted with it, any use, review, retransmission, distribution, dissemination, copying, printing, or other use of, or taking of any action in reliance upon this communication, is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete the original and any copy of this e-mail, and any printout thereof, immediately. Finally, the recipient should check this e-mail and any attachments for the presence of viruses. The Dryden Police Services Board and the Corporation of the City of Dryden accepts no liability for any damage caused by any virus transmitted by this email.
B�KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKCB��[��X��ܚX�KK[XZ[
�\�\��][��X��ܚX�P
�\X�K�ܙ�B��܈Y][ۘ[��[X[��K[XZ[
�\�\��Z[
�\X�K�ܙ�B
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
[users@httpd] Websites not loading properly / consistently
Posted by Sharon Zastre <SZ...@dryden.ca>.
Hello,
I have several sites created, both internal and external. The external sites are proxied out using Apache 2.4.9 OpenSSL 1.0.1g. Some sites are secured while others are not. I notice that the first time that I attempt to access the external sites, often I will need to reload / refresh in order for it to work. Not a big deal if it is just one refresh. But I’m still wondering why this is happening? I believe it is related to Apache since the internal sites load fine. Any ideas for the need to reload the sites?
But the bigger issue is with the external and secure sites. These sites in particular take a long time to load and will often time-out either while trying to load the site or trying to authenticate the user/password. This has become more of an issue over the last week or two.
Now I am not very familiar with Apache so please be gentle. But it seems like requests are taking too long and then hang. When the number of processes becomes too large, then the sites are no longer functional. I have included the httpd-mpm.conf and am testing it out to see if it makes a difference. Wondering how I should adjust the settings to get the best performance. The odd time it will load but it is very inconsistent; which makes it more difficult to troubleshoot. Any suggestions as to what the issue may be or where to look for more info is greatly appreciated.
Error log shows a couple of messages:
- Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
- The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.
Thanks in advance for your help,
Sharon
DISCLAIMER: This communication and any files transmitted with it may contain information that is privileged or confidential and is intended to be for the use of the individual (s) or entity named above. This material may contain confidential or personal information which may be subject to the provisions of the Municipal Freedom of Information & Protection of Privacy Act. If you are not the intended recipient of this communication and any files transmitted with it, any use, review, retransmission, distribution, dissemination, copying, printing, or other use of, or taking of any action in reliance upon this communication, is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete the original and any copy of this e-mail, and any printout thereof, immediately. Finally, the recipient should check this e-mail and any attachments for the presence of viruses. The Dryden Police Services Board and the Corporation of the City of Dryden accepts no liability for any damage caused by any virus transmitted by this email.
Re: [users@httpd] MaxRequestsPerChild - New child process doesn't
process requests
Posted by Jeff Trawick <tr...@gmail.com>.
On Fri, Aug 22, 2014 at 3:46 AM, Vattikuti, Vamsi Krishna Venkata (STSD) <
vamsik@hp.com> wrote:
> Hi,
>
>
>
> Thanks for the feedback.
>
>
>
> That tomcat application(monitoring) is invoked through a 3rd party module
> and application remains active in browser for days together, which result
> in memory leak for httpd process. To prevent that leak, that application
> owner has configured MaxRequestsPerChild as 100. I will suggest them to
> increase values of this and other directives.
>
It is likely that you won't find a satisfactory solution as long as you
have memory leaks in httpd and extremely-long-running requests. The leak
needs to be fixed.
I think you will be better off with the prefork MPM until this can be fixed:
* Since you have such a low MaxClients, you're not getting much benefit
from the worker MPM.
* When a prefork child process reaches MaxRequestsPerChild, it can exit
immediately since there are no other active requests in the child process,
and not be stranded forever, consuming resources but not able to accept new
connections.
* If necessary, a person or a monitoring script can kill individual prefork
child processes based on time of active request or memory use, and only
affect a single active request.
If this third-party module also requires exactly one child process, in
addition to leaking memory and requiring child process cleanup, you've hit
double jeopardy. Switch to another line of work.
>
> Regards,
>
> Vamsi.
>
>
>
> *From:* Daniel [mailto:dferradal@gmail.com]
> *Sent:* Friday, August 22, 2014 12:50 PM
>
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] MaxRequestsPerChild - New child process
> doesn't process requests
>
>
>
> What memory leak exactly? You are just proxying to tomcat.
>
>
>
> Increase the number of maxrequestsperchild to a more sensible number, such
> as 10.000 or even higher, so httpd is not constantly renewing childs if you
> have even a minimum load.
>
>
>
> Add more servers to avoid your issue, and try to use more threads too, 50
> at least.
>
>
>
> It seems like you are constraining too much, and apache 2.2.15 with
> mpm_worker can give much much more.
>
>
>
> You will notice performance increasing greatly overall.
>
>
>
>
>
>
>
> 2014-08-22 6:06 GMT+02:00 Vattikuti, Vamsi Krishna Venkata (STSD) <
> vamsik@hp.com>:
>
> Hi Jeff,
>
>
>
> Thanks for quick response. We will check and do the needful
>
>
>
> That 100 is to prevent memory leak.
>
>
>
> Regards,
>
> Krishna.
>
>
>
> *From:* Jeff Trawick [mailto:trawick@gmail.com]
> *Sent:* Friday, August 22, 2014 2:24 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] MaxRequestsPerChild - New child process
> doesn't process requests
>
>
>
> On Thu, Aug 21, 2014 at 4:39 PM, Vattikuti, Vamsi Krishna Venkata (STSD) <
> vamsik@hp.com> wrote:
>
> Hi,
>
>
>
> We are having an issue with Tomcat application accessing through proxy and
> details are below. Can you please check and share your feedback.
>
>
>
> *Issue:*
>
> We have an application(tomcat) accessed through proxy as below. Also, we
> have MaxRequestsPerChild setting as 100
>
>
>
> Whenever MaxRequestsPerChild reached its limit, a new process is started
> but the application become unresponsive. It seems that new process doesn’t
> service any requests
>
> We have to restart httpd to recover that
>
>
>
>
>
> *Log:*
>
> - Access.log doesn’t show any requests for new child
>
> - Error_log shows that
>
> a) workers are initiated for new process but it didn’t service any
> requests
>
> b)
>
> c) processing has stuck for a minute due to some reason
>
> [Fri Aug 08 16:09:17 2014] [debug] ssl_engine_kernel.c(2118): [client
> 127.0.0.1] Certificate Verification, depth 0 [subject:
> /C=y/ST=y/L=y/O=y/OU=y/CN=y, issuer: /C=y/ST=y/L=y/O=y/OU=y/CN=y, serial:
> xyz]
>
> [Fri Aug 08 16:10:12 2014] [info] [client 10.150.90.25] Connection to
> child 6 established (server *:<port number from client>)
>
>
>
> d) SSL handshake has started but didn’t complete for 4 connections
> related to new process. There are no errors related to ssl
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c start
>
> 707
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c done
>
> 703
>
> $
>
>
>
> *Apache version:*
>
> 2.2.15
>
>
>
>
>
> *Proxy setting:*
>
> SSLProxyEngine On
>
> SSLProxyCipherSuite ALL
>
> SSLProxyMachineCertificateFile /var/ssl/proxy.pem
>
>
>
> proxyPass /app1 https://localhost:<port number>/app1 (Tomcat)
>
>
>
> *Worker configuration:*
>
> KeepAlive On
>
> MaxKeepAliveRequests 100
>
> KeepAliveTimeout 15
>
> <IfModule worker.c>
>
> StartServers 1
>
> MaxClients 25
>
> MinSpareThreads 12
>
> MaxSpareThreads 25
>
> ThreadsPerChild 25
>
> ServerLimit 1
>
> MaxRequestsPerChild 100
>
> MaxMemFree 50
>
> </IfModule>
>
>
>
> Thanks & Regards,
>
> Krishna
>
>
> MaxRequestsPerChild 100 is ridiculously low. What is happening in httpd
> to cause you to need that setting?
>
>
>
> Anyway...
>
>
>
> Once an httpd child process has reached 100 connections, it initiates a
> graceful shutdown, which means that instead of aborting current requests it
> will instead wait for current requests to finish, then exit.
>
>
>
> During the time that it is waiting for current requests to finish, new
> connections must be handled by other child processes. BUT you set
> ServerLimit to 1 (and other directives such as ThreadsPerChild and
> MaxClients are consistent with allowing only one child process), so no
> other child process can be created during that time.
>
>
>
> Thus, once 100 connections are handled, new clients will be blocked until
> existing requests finish.
>
>
>
> --/--
>
>
>
> My guess: Your Java application takes a long time (maybe forever?) to
> handle some requests. MaxRequestsPerChild makes it worse. If the Java
> requests are slow and eventually finish, the solution is to keep a steady
> set of httpd child processes (having them gracefully exit when there are
> slow backend requests can be harmful) and increase the number of httpd
> threads/child processes to handle the load.
>
>
>
> If some Java requests hang, see how to handle that on the Tomcat side.
>
>
> Enable server status with ExtendedStatus On and watch what happens --
> whether or not certain requests handled by the Java application take a
> relatively long time, tieing up some or all of your very limited number of
> httpd threads.
>
>
>
> --
>
> Born in Roswell... married an alien...
> http://emptyhammock.com/
>
>
>
>
>
--
Born in Roswell... married an alien...
http://emptyhammock.com/
RE: [users@httpd] MaxRequestsPerChild - New child process doesn't
process requests
Posted by "Vattikuti, Vamsi Krishna Venkata (STSD)" <va...@hp.com>.
Hi,
Thanks for the feedback.
That tomcat application(monitoring) is invoked through a 3rd party module and application remains active in browser for days together, which result in memory leak for httpd process. To prevent that leak, that application owner has configured MaxRequestsPerChild as 100. I will suggest them to increase values of this and other directives.
Regards,
Vamsi.
From: Daniel [mailto:dferradal@gmail.com]
Sent: Friday, August 22, 2014 12:50 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] MaxRequestsPerChild - New child process doesn't process requests
What memory leak exactly? You are just proxying to tomcat.
Increase the number of maxrequestsperchild to a more sensible number, such as 10.000 or even higher, so httpd is not constantly renewing childs if you have even a minimum load.
Add more servers to avoid your issue, and try to use more threads too, 50 at least.
It seems like you are constraining too much, and apache 2.2.15 with mpm_worker can give much much more.
You will notice performance increasing greatly overall.
2014-08-22 6:06 GMT+02:00 Vattikuti, Vamsi Krishna Venkata (STSD) <va...@hp.com>>:
Hi Jeff,
Thanks for quick response. We will check and do the needful
That 100 is to prevent memory leak.
Regards,
Krishna.
From: Jeff Trawick [mailto:trawick@gmail.com<ma...@gmail.com>]
Sent: Friday, August 22, 2014 2:24 AM
To: users@httpd.apache.org<ma...@httpd.apache.org>
Subject: Re: [users@httpd] MaxRequestsPerChild - New child process doesn't process requests
On Thu, Aug 21, 2014 at 4:39 PM, Vattikuti, Vamsi Krishna Venkata (STSD) <va...@hp.com>> wrote:
Hi,
We are having an issue with Tomcat application accessing through proxy and details are below. Can you please check and share your feedback.
Issue:
We have an application(tomcat) accessed through proxy as below. Also, we have MaxRequestsPerChild setting as 100
Whenever MaxRequestsPerChild reached its limit, a new process is started but the application become unresponsive. It seems that new process doesn’t service any requests
We have to restart httpd to recover that
Log:
- Access.log doesn’t show any requests for new child
- Error_log shows that
a) workers are initiated for new process but it didn’t service any requests
b)
c) processing has stuck for a minute due to some reason
[Fri Aug 08 16:09:17 2014] [debug] ssl_engine_kernel.c(2118): [client 127.0.0.1] Certificate Verification, depth 0 [subject: /C=y/ST=y/L=y/O=y/OU=y/CN=y, issuer: /C=y/ST=y/L=y/O=y/OU=y/CN=y, serial: xyz]
[Fri Aug 08 16:10:12 2014] [info] [client 10.150.90.25] Connection to child 6 established (server *:<port number from client>)
d) SSL handshake has started but didn’t complete for 4 connections related to new process. There are no errors related to ssl
$ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c start
707
$ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c done
703
$
Apache version:
2.2.15
Proxy setting:
SSLProxyEngine On
SSLProxyCipherSuite ALL
SSLProxyMachineCertificateFile /var/ssl/proxy.pem
proxyPass /app1 https://localhost:<port number>/app1<https://localhost:%3cport%20number%3e/app1> (Tomcat)
Worker configuration:
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule worker.c>
StartServers 1
MaxClients 25
MinSpareThreads 12
MaxSpareThreads 25
ThreadsPerChild 25
ServerLimit 1
MaxRequestsPerChild 100
MaxMemFree 50
</IfModule>
Thanks & Regards,
Krishna
MaxRequestsPerChild 100 is ridiculously low. What is happening in httpd to cause you to need that setting?
Anyway...
Once an httpd child process has reached 100 connections, it initiates a graceful shutdown, which means that instead of aborting current requests it will instead wait for current requests to finish, then exit.
During the time that it is waiting for current requests to finish, new connections must be handled by other child processes. BUT you set ServerLimit to 1 (and other directives such as ThreadsPerChild and MaxClients are consistent with allowing only one child process), so no other child process can be created during that time.
Thus, once 100 connections are handled, new clients will be blocked until existing requests finish.
--/--
My guess: Your Java application takes a long time (maybe forever?) to handle some requests. MaxRequestsPerChild makes it worse. If the Java requests are slow and eventually finish, the solution is to keep a steady set of httpd child processes (having them gracefully exit when there are slow backend requests can be harmful) and increase the number of httpd threads/child processes to handle the load.
If some Java requests hang, see how to handle that on the Tomcat side.
Enable server status with ExtendedStatus On and watch what happens -- whether or not certain requests handled by the Java application take a relatively long time, tieing up some or all of your very limited number of httpd threads.
--
Born in Roswell... married an alien...
http://emptyhammock.com/
Re: [users@httpd] MaxRequestsPerChild - New child process doesn't
process requests
Posted by Daniel <df...@gmail.com>.
What memory leak exactly? You are just proxying to tomcat.
Increase the number of maxrequestsperchild to a more sensible number, such
as 10.000 or even higher, so httpd is not constantly renewing childs if you
have even a minimum load.
Add more servers to avoid your issue, and try to use more threads too, 50
at least.
It seems like you are constraining too much, and apache 2.2.15 with
mpm_worker can give much much more.
You will notice performance increasing greatly overall.
2014-08-22 6:06 GMT+02:00 Vattikuti, Vamsi Krishna Venkata (STSD) <
vamsik@hp.com>:
> Hi Jeff,
>
>
>
> Thanks for quick response. We will check and do the needful
>
>
>
> That 100 is to prevent memory leak.
>
>
>
> Regards,
>
> Krishna.
>
>
>
> *From:* Jeff Trawick [mailto:trawick@gmail.com]
> *Sent:* Friday, August 22, 2014 2:24 AM
> *To:* users@httpd.apache.org
> *Subject:* Re: [users@httpd] MaxRequestsPerChild - New child process
> doesn't process requests
>
>
>
> On Thu, Aug 21, 2014 at 4:39 PM, Vattikuti, Vamsi Krishna Venkata (STSD) <
> vamsik@hp.com> wrote:
>
> Hi,
>
>
>
> We are having an issue with Tomcat application accessing through proxy and
> details are below. Can you please check and share your feedback.
>
>
>
> *Issue:*
>
> We have an application(tomcat) accessed through proxy as below. Also, we
> have MaxRequestsPerChild setting as 100
>
>
>
> Whenever MaxRequestsPerChild reached its limit, a new process is started
> but the application become unresponsive. It seems that new process doesn’t
> service any requests
>
> We have to restart httpd to recover that
>
>
>
>
>
> *Log:*
>
> - Access.log doesn’t show any requests for new child
>
> - Error_log shows that
>
> a) workers are initiated for new process but it didn’t service any
> requests
>
> b)
>
> c) processing has stuck for a minute due to some reason
>
> [Fri Aug 08 16:09:17 2014] [debug] ssl_engine_kernel.c(2118): [client
> 127.0.0.1] Certificate Verification, depth 0 [subject:
> /C=y/ST=y/L=y/O=y/OU=y/CN=y, issuer: /C=y/ST=y/L=y/O=y/OU=y/CN=y, serial:
> xyz]
>
> [Fri Aug 08 16:10:12 2014] [info] [client 10.150.90.25] Connection to
> child 6 established (server *:<port number from client>)
>
>
>
> d) SSL handshake has started but didn’t complete for 4 connections
> related to new process. There are no errors related to ssl
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c start
>
> 707
>
> $ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c done
>
> 703
>
> $
>
>
>
> *Apache version:*
>
> 2.2.15
>
>
>
>
>
> *Proxy setting:*
>
> SSLProxyEngine On
>
> SSLProxyCipherSuite ALL
>
> SSLProxyMachineCertificateFile /var/ssl/proxy.pem
>
>
>
> proxyPass /app1 https://localhost:<port number>/app1 (Tomcat)
>
>
>
> *Worker configuration:*
>
> KeepAlive On
>
> MaxKeepAliveRequests 100
>
> KeepAliveTimeout 15
>
> <IfModule worker.c>
>
> StartServers 1
>
> MaxClients 25
>
> MinSpareThreads 12
>
> MaxSpareThreads 25
>
> ThreadsPerChild 25
>
> ServerLimit 1
>
> MaxRequestsPerChild 100
>
> MaxMemFree 50
>
> </IfModule>
>
>
>
> Thanks & Regards,
>
> Krishna
>
>
> MaxRequestsPerChild 100 is ridiculously low. What is happening in httpd
> to cause you to need that setting?
>
>
>
> Anyway...
>
>
>
> Once an httpd child process has reached 100 connections, it initiates a
> graceful shutdown, which means that instead of aborting current requests it
> will instead wait for current requests to finish, then exit.
>
>
>
> During the time that it is waiting for current requests to finish, new
> connections must be handled by other child processes. BUT you set
> ServerLimit to 1 (and other directives such as ThreadsPerChild and
> MaxClients are consistent with allowing only one child process), so no
> other child process can be created during that time.
>
>
>
> Thus, once 100 connections are handled, new clients will be blocked until
> existing requests finish.
>
>
>
> --/--
>
>
>
> My guess: Your Java application takes a long time (maybe forever?) to
> handle some requests. MaxRequestsPerChild makes it worse. If the Java
> requests are slow and eventually finish, the solution is to keep a steady
> set of httpd child processes (having them gracefully exit when there are
> slow backend requests can be harmful) and increase the number of httpd
> threads/child processes to handle the load.
>
>
>
> If some Java requests hang, see how to handle that on the Tomcat side.
>
>
> Enable server status with ExtendedStatus On and watch what happens --
> whether or not certain requests handled by the Java application take a
> relatively long time, tieing up some or all of your very limited number of
> httpd threads.
>
>
>
> --
>
> Born in Roswell... married an alien...
> http://emptyhammock.com/
>
>
>
RE: [users@httpd] MaxRequestsPerChild - New child process doesn't
process requests
Posted by "Vattikuti, Vamsi Krishna Venkata (STSD)" <va...@hp.com>.
Hi Jeff,
Thanks for quick response. We will check and do the needful
That 100 is to prevent memory leak.
Regards,
Krishna.
From: Jeff Trawick [mailto:trawick@gmail.com]
Sent: Friday, August 22, 2014 2:24 AM
To: users@httpd.apache.org
Subject: Re: [users@httpd] MaxRequestsPerChild - New child process doesn't process requests
On Thu, Aug 21, 2014 at 4:39 PM, Vattikuti, Vamsi Krishna Venkata (STSD) <va...@hp.com>> wrote:
Hi,
We are having an issue with Tomcat application accessing through proxy and details are below. Can you please check and share your feedback.
Issue:
We have an application(tomcat) accessed through proxy as below. Also, we have MaxRequestsPerChild setting as 100
Whenever MaxRequestsPerChild reached its limit, a new process is started but the application become unresponsive. It seems that new process doesn’t service any requests
We have to restart httpd to recover that
Log:
- Access.log doesn’t show any requests for new child
- Error_log shows that
a) workers are initiated for new process but it didn’t service any requests
b)
c) processing has stuck for a minute due to some reason
[Fri Aug 08 16:09:17 2014] [debug] ssl_engine_kernel.c(2118): [client 127.0.0.1] Certificate Verification, depth 0 [subject: /C=y/ST=y/L=y/O=y/OU=y/CN=y, issuer: /C=y/ST=y/L=y/O=y/OU=y/CN=y, serial: xyz]
[Fri Aug 08 16:10:12 2014] [info] [client 10.150.90.25] Connection to child 6 established (server *:<port number from client>)
d) SSL handshake has started but didn’t complete for 4 connections related to new process. There are no errors related to ssl
$ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c start
707
$ grep -i handshake errorlog.2014-08-08-07_06_44 | grep -c done
703
$
Apache version:
2.2.15
Proxy setting:
SSLProxyEngine On
SSLProxyCipherSuite ALL
SSLProxyMachineCertificateFile /var/ssl/proxy.pem
proxyPass /app1 https://localhost:<port number>/app1<https://localhost:%3cport%20number%3e/app1> (Tomcat)
Worker configuration:
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule worker.c>
StartServers 1
MaxClients 25
MinSpareThreads 12
MaxSpareThreads 25
ThreadsPerChild 25
ServerLimit 1
MaxRequestsPerChild 100
MaxMemFree 50
</IfModule>
Thanks & Regards,
Krishna
MaxRequestsPerChild 100 is ridiculously low. What is happening in httpd to cause you to need that setting?
Anyway...
Once an httpd child process has reached 100 connections, it initiates a graceful shutdown, which means that instead of aborting current requests it will instead wait for current requests to finish, then exit.
During the time that it is waiting for current requests to finish, new connections must be handled by other child processes. BUT you set ServerLimit to 1 (and other directives such as ThreadsPerChild and MaxClients are consistent with allowing only one child process), so no other child process can be created during that time.
Thus, once 100 connections are handled, new clients will be blocked until existing requests finish.
--/--
My guess: Your Java application takes a long time (maybe forever?) to handle some requests. MaxRequestsPerChild makes it worse. If the Java requests are slow and eventually finish, the solution is to keep a steady set of httpd child processes (having them gracefully exit when there are slow backend requests can be harmful) and increase the number of httpd threads/child processes to handle the load.
If some Java requests hang, see how to handle that on the Tomcat side.
Enable server status with ExtendedStatus On and watch what happens -- whether or not certain requests handled by the Java application take a relatively long time, tieing up some or all of your very limited number of httpd threads.
--
Born in Roswell... married an alien...
http://emptyhammock.com/