0

We are using apache version 4. Our server we are getting around 8000 concurrent connections. Below is our worker module configuration

<IfModule mpm_worker_module>
    ServerLimit             16
    StartServers             20
    MaxClients                 8000
    MinSpareThreads         512
    MaxSpareThreads        1024
    ThreadsPerChild         64
    MaxRequestWorkers      1024
    MaxConnectionsPerChild 10000
</IfModule>

With the above configuration we are getting below error in apache server error.log

[Mon Nov 12 12:38:58.838952 2018] [mpm_winnt:notice] [pid 3304:tid 480] AH00418: Parent: Created child process 6416
[Mon Nov 12 12:38:59.745235 2018] [jk:warn] [pid 6416:tid 364] No JkLogFile defined in httpd.conf. Using default C:/Apache/logs/mod_jk.log
[Mon Nov 12 12:38:59.917109 2018] [jk:warn] [pid 6416:tid 364] No JkLogFile defined in httpd.conf. Using default C:/Apache/logs/mod_jk.log
[Mon Nov 12 12:38:59.932736 2018] [mpm_winnt:notice] Child: Starting 250 worker threads.
[Mon Nov 12 12:39:06.471238 2018] [mpm_winnt:error]  Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting

After that we changed ThreadsPerChild to 100, after that we are getting below error

[Mon Nov 12 12:47:35.837220 2018] [core:notice] [pid 3304:tid 480] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/ApacheWeb'
[Mon Nov 12 12:47:35.837220 2018] [mpm_winnt:notice] [pid 3304:tid 480] AH00418: Parent: Created child process 9188
[Mon Nov 12 12:47:36.821579 2018] [jk:warn] [pid 9188:tid 368] No JkLogFile defined in httpd.conf. Using default C:/ApacheWeb/logs/mod_jk.log
[Mon Nov 12 12:47:37.102834 2018] [jk:warn] [pid 9188:tid 368] No JkLogFile defined in httpd.conf. Using default C:/ApacheWeb/logs/mod_jk.log
[Mon Nov 12 12:47:37.118481 2018] [mpm_winnt:notice] [pid 9188:tid 368] AH00354: Child: Starting 250 worker threads.
[Mon Nov 12 12:48:02.464408 2018] [mpm_winnt:error] [pid 9188:tid 6488] AH00326: Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
[Mon Nov 12 12:48:10.216397 2018] [mpm_winnt:notice] [pid 7888:tid 364] AH00362: Child: Waiting 30 more seconds for 29 worker threads to finish.
[Mon Nov 12 12:48:43.069214 2018] [mpm_winnt:notice] [pid 7888:tid 364] AH00362: Child: Waiting 0 more seconds for 7 worker threads to finish.
[Mon Nov 12 12:48:43.178567 2018] [mpm_winnt:notice] [pid 7888:tid 364] AH00363: Child: Terminating 7 threads that failed to exit.
[Mon Nov 12 12:48:43.178567 2018] [mpm_winnt:notice] [pid 7888:tid 364] AH00364: Child: All worker threads have exited.
[Mon Nov 12 12:49:37.253636 2018] [mpm_winnt:notice] [pid 9188:tid 368] AH00363: Child: Terminating 243 threads that failed to exit.
[Mon Nov 12 12:49:37.253636 2018] [mpm_winnt:notice] [pid 9188:tid 368] AH00364: Child: All worker threads have exited.

After that we are using the below configuration

<IfModule mpm_worker_module>
    ServerLimit             125
    StartServers            20
    MinSpareThreads         512
    MaxSpareThreads         1024
    ThreadsPerChild         64
    MaxRequestWorkers       8000
    MaxConnectionsPerChild  10000
</IfModule>

Now we are getting below log

[Mon Nov 12 14:29:08.996704 2018] [core:notice] [pid 7124:tid 476] AH00094: Command line: 'C:\\Apache\\bin\\httpd.exe -d C:/Apache'
[Mon Nov 12 14:29:08.996704 2018] [mpm_winnt:notice] [pid 7124:tid 476] AH00418: Parent: Created child process 8708
[Mon Nov 12 14:29:09.981085 2018] [jk:warn] [pid 8708:tid 372] No JkLogFile defined in httpd.conf. Using default C:/Apache/logs/mod_jk.log
[Mon Nov 12 14:29:10.184213 2018] [jk:warn] [pid 8708:tid 372] No JkLogFile defined in httpd.conf. Using default C:/Apache/logs/mod_jk.log
[Mon Nov 12 14:29:10.199837 2018] [mpm_winnt:notice] [pid 8708:tid 372] AH00354: Child: Starting 250 worker threads.
[Mon Nov 12 14:29:43.361221 2018] [mpm_winnt:notice] [pid 5988:tid 372] AH00362: Child: Waiting 30 more seconds for 11 worker threads to finish.
[Mon Nov 12 14:30:00.549960 2018] [mpm_winnt:notice] [pid 5988:tid 372] AH00364: Child: All worker threads have exited.
[Mon Nov 12 14:31:33.959999 2018] [mpm_winnt:notice] [pid 8708:tid 372] AH00358: Child: Process exiting because it reached MaxConnectionsPerChild. Signaling the parent to restart a new child process.
[Mon Nov 12 14:31:33.959999 2018] [mpm_winnt:notice] [pid 7124:tid 476] AH00424: Parent: Received restart signal -- Restarting the server.

We are frequently getting

Child: Process exiting because it reached MaxConnectionsPerChild. Signaling the parent to restart a new child process.

how to resolve this error any help will be greatly appreciated!!!

RealSkeptic
  • 33,993
  • 7
  • 53
  • 79
Selva
  • 1,620
  • 3
  • 33
  • 63
  • That's a notice, not a warning or an error. Why do you want to solve it if it's not an error? – RealSkeptic Nov 12 '18 at 14:19
  • @RealSkeptic, Thanks for the response, its happening on every 5 seconds i studied if the restart happens frequently it will consume more CPU. That s the reason i want to fix it.I just want to make that happen in every 5 minutes like that – Selva Nov 12 '18 at 15:02
  • 1
    Take a look at [this question about MaxConnectionsPerChild](https://stackoverflow.com/q/22732768/4125191). Also, your question really has nothing to do with Java, so I'm removing the Java tag. – RealSkeptic Nov 12 '18 at 15:48
  • Thanks @RealSkeptic for the link. I understood the usage of MaxConnectionsPerChild parameters – Selva Nov 13 '18 at 05:06

1 Answers1

0

You are using a Windows implementation module (mpm_winnt) instead of mpm_worker_module. Try locate the section:

<IfModule mpm_winnt_module>
    ThreadsPerChild        1000
    MaxConnectionsPerChild   20000
 AcceptFilter http None    
    AcceptFilter https None  
</IfModule>

and modify the ThreadsPerChild parameter.

Đinh Hồng Châu
  • 5,300
  • 15
  • 53
  • 90
Len Lin
  • 381
  • 3
  • 5