[php-maint] Bug#514832: php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.

giuseppe bonacci g.bonacci at libero.it
Wed Feb 11 09:55:51 UTC 2009


Package: php5
Version: 5.2.0-8+etch13
Severity: normal
Tags: patch, upstream


php_curl_stream_read() in ext/curl/streams.c always calls select() after
firing up a connection.  however, when the php client is under heavy
load, the server might have already responded, and the last call to
curl_multi_perform() before entering the loop might have received all
the data and closed the connection.  at this point, curl_multi_fdset()
in the loop returns maxfs == -1, and the following select turns into a
pointless 15 sec sleep. 

I believe this problem is related to http://bugs.php.net/bug.php?id=23258

please see the attached patch.
regards
g.b.

-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.18-6-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages php5 depends on:
ii  libapache2-mod-php5       5.2.0-8+etch13 server-side, HTML-embedded scripti
ii  php5-common               5.2.0-8+etch13 Common files for packages built fr

php5 recommends no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: php.curlstream.patch
Type: text/x-c
Size: 1083 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20090211/91a25bb0/attachment.bin 


More information about the pkg-php-maint mailing list