[PHP-DEV] Bug #10673 Updated: CURL/PHP causes lengthy Apache Keepalive From: dave <email protected>
Date: 06/26/01

ID: 10673
User Update by: dave <email protected>
Status: Open
Bug Type: cURL related
Operating system: Linux
PHP Version: 4.0.6
Description: CURL/PHP causes lengthy Apache Keepalive

Same problem still exists with CURL 7.8 and PHP 4.0.6.

Any more ideas?

Previous Comments:
---------------------------------------------------------------------------

[2001-06-22 12:46:58] sniper <email protected>
Updated version.

---------------------------------------------------------------------------

[2001-06-05 17:27:51] dave <email protected>
Ok, I updated to curl-7.8-pre4 and PHP-4.0.6RC2 and tested
with the same results. :-(

Anything else I should try?
-Dave

---------------------------------------------------------------------------

[2001-06-03 17:49:32] sniper <email protected>
First of all, try the latest release candidate for PHP 4.0.6:

http://www.php.net/~andi/php-4.0.6RC2.tar.gz

Note: You have to get the latest and greatest Curl
from CVS to get this work.

--Jani

---------------------------------------------------------------------------

[2001-05-04 13:31:59] dave <email protected>
Greetings. I have Apache/1.3.14 (Unix) running with
PHP/4.0.4pl1 installed as a module and CURL 7.7.1 added to
that. Our web sites need to fetch a request from a remote
ad server in real-time as each page is generated. If $adr
is the request, I used to use:

$success =  <email protected>($adr);

But then I found CURL and saw that is (a) was more robust
and (b) seems to be more efficient than readfile. So I now
use CURL in he following way:

$aje_ch =  <email protected>($adr);
 <email protected> ($aje_ch, CURLOPT_TIMEOUT, 1);
 <email protected> ($aje_ch, CURLOPT_MUTE, 1);
 <email protected> ($aje_ch);
 <email protected> ($aje_ch);

This works great, except that if I have "Keepalive on" in
my Apache configuration file, the httpd server sits in
keepalive state for FAR longer when using CURL than it does
when using readfile. In the course of 2 or 3 hours, my
server would normally be at about 150 httpd processes
running at any given point in time. But when using CURL, it
jumps to 650 httpd processes, with the lions share (99%) of
those sitting in the keepalive state for very long. It
seems like the CURL requests are causing Apache to set its
Keepalive timeout to something much higher than it should
be. Setting "keepalive off" in Apache's conf file works
around this problem, but decreases server efficiency. I'd
love to solve this problem.

Please help! :-)

For the record, this was posted to the cURL bug tracker
over on SourceForge
(http://sourceforge.net/tracker/?func=detail&atid=100976&ai
d=418860&group_id=976), and we went through quite a few
gyrations with no success. Specifically, we tried
disabling KeepAlive on the REMOTE server to see if that had
any affect, and it did not. It seems not to matter what we
request from, rather that any requests using
PHP/cURL/Apache result in the LOCAL Apache bloating out of
control with KeepAlive requests. Reverting back to
readfile() based requests solves this problem but, well,
cURL is better. ;-)

All help would be appreciated, and I am available and
willing to test anything on our servers.

Thanks!

-Dave

---------------------------------------------------------------------------

Full Bug description available at: http://bugs.php.net/?id=10673

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>