Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Odd resource exhaustion issue -- Apache, PHP, Oracle 10g

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-04, 15:36
rayvd rayvd is offline
Registered User
 
Join Date: Aug 2004
Posts: 7
Odd resource exhaustion issue -- Apache, PHP, Oracle 10g

We have a RHES3 server set up running Apache 2.0.52 w/ PHP 4.3.9 compiled against the Oracle 10g client library. The system functions properly, but slowly but surely the memory usage on each httpd thread inches up until all memory and swap on the box are used. If you restart Apache, all the used memory is released and the system continues functioning normally.

We've noticed that doing a netstat -tupan shows a *lot* of TIME_WAIT items, making it seem like some sort of keep-alive thing was causing connections to stay open and not release their resources. Adding KeepAlive Off to httpd.conf didn't seem to fix this problem.

What *does* work for us (kinda kludgy) is to set MaxRequestsPerChild in httpd.conf to 50 or so. This kills a child after it processes 50 requests and thus frees the resources it was using. So this keeps us up and running without relying on a cron job to restart Apache every 20 minutes or so.

While this works, it seems like we shouldn't need to be doing this. :-) I'm trying to figure out if there are any problems with RHES3, PHP, Apache or the Oracle 10g libraries that could potentially cause this problem. If we can rule this out then it's most likely a problem with the PHP scripts being called. Note that we have three RHES3 servers running this exact same configuration and all of them exhibit this problem--it's just that this server is by far the busiest so the problem pops up much more frequently.

Here are the relevant configuration options:

Apache
./configure \
--prefix=/usr/local/apache2 \
--enable-ssl \
--enable-so \
--enable-rewrite=shared \
--enable-expires \
--enable-info \
--enable-deflate \
--with-ssl=/usr

PHP
'./configure' \
'--with-oci8=/u01/app/oracle/product/10.1.0/client_1' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--enable-track-vars' \
'--enable-calendar' \
'--enable-sigchild' \
"$@"

Not going to attach all of httpd.conf, but here are the prefork config options we're using:

StartServers 15
MinSpareServers 5
MaxSpareServers 10
MaxClients 256
MaxRequestsPerChild 50

Thanks for any insight.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On