Error server ran out of threads to serve requests and too many connections

Hi Team,
I am having two applications (1 java and 1 php). Both applications using same mysql database server. There are some configuration settings are done in apache and mysql. For java application there are hardly 5 users using the application. PHP site used by visitors.
In PHP, for every query execution DB connection is opened and closed. mysqli () and mysqli_close();
Also enabled general log.
I also have enabled httpd-mpm. 150 changed to 64.
<IfModule mpm_winnt_module> ThreadsPerChild 64 MaxConnectionsPerChild 0 </IfModule>
and
<IfModule mpm_netware_module> ThreadStackSize 65536 StartThreads 250 MinSpareThreads 25 MaxSpareThreads 250 MaxThreads 1000 MaxConnectionsPerChild 0 </IfModule>

I checked the status using
show status like '%onn%'; and show status like '%thread%';
The connections value goes beyond 8500, Threads created 5342 and threads running 1001.

And all applications stops working
I checked apache error log:

[mpm_winnt:error] [pid 9632:tid 2196] AH00326: Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting

[mpm_winnt:notice] [pid 9632:tid 460] AH00364: Child: All worker threads have exited.

I guess there are some configuration changes that I need to do. But not getting any idea.

Could you please help me. I am searching for solution from last couple of weeks.

Thanks

Are you running apache under windows?

Yes.

All these applications (Java - tomcat 6.0.44), WAMP 2.5 are hosted on Azure Windows server 2012.

I am also getting error “too many connections”

Hi All,

Any help… to give me pointers.

Does your httpd.conf file have the include line uncommented?

# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf

Yes. And here are the values

<IfModule mpm_worker_module> StartServers 3 MinSpareThreads 75 MaxSpareThreads 250 ThreadsPerChild 25 MaxRequestWorkers 400 MaxConnectionsPerChild 0 </IfModule>

<IfModule mpm_winnt_module> ThreadsPerChild 64 MaxConnectionsPerChild 10000 </IfModule>

Going by

I would consider tweaking up the 64

To what?

Sorry,but I have absolutely no idea what it would need to be.

And I don’t know what possible impact there might be in other areas by upping it.

But seeing as the message said to consider doing it, I think doing so a sane amount should be safe.
i.e. I wouldn’t jump straight away to 99999999999999 or anything like that.

I guess to be safe you should wait until someone that has experience with changing it chimes in.
If you’re impatient I think doubling it would be a safe start.
Then if things fail again be sure to scrutinize the log’s numbers for clues as to how much of a difference the change made, if any.

Hey
Looks like you need to increase your MaxThreads config parameter from 1000 to 2000 for the start, and look how it’s going on.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.