cURL / Mailing Lists / curl-users / Single Mail

curl-users

[ curl-Bugs-418860 ] CURL/PHP causes lengthy Apache Keepalive

From: <noreply_at_sourceforge.net>
Date: Wed, 25 Apr 2001 08:54:23 -0700

Bugs item #418860, was updated on 2001-04-25 08:54
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=418860&group_id=976

Category: http
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Hamilton (jazzbo)
Assigned to: Daniel Stenberg (bagder)
Summary: CURL/PHP causes lengthy Apache Keepalive

Initial Comment:
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 = @readfile($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 = @curl_init($adr);
@curl_setopt ($aje_ch, CURLOPT_TIMEOUT, 1);
@curl_setopt ($aje_ch, CURLOPT_MUTE, 1);
@curl_exec ($aje_ch);
@curl_close ($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! :-)

Thanks!

-Dave

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

You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=100976&aid=418860&group_id=976
Received on 2001-04-25