Debian Bug report logs - #514832
php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.

version graph

Package: php5; Maintainer for php5 is (unknown);

Reported by: giuseppe bonacci <g.bonacci@libero.it>

Date: Wed, 11 Feb 2009 09:57:01 UTC

Severity: normal

Tags: patch, upstream

Found in version php5/5.2.0-8+etch13

Fixed in version 5.2.9.dfsg.1-2

Done: Raphael Geissert <atomo64@gmail.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#514832; Package php5. (Wed, 11 Feb 2009 09:57:04 GMT) (full text, mbox, link).


Acknowledgement sent to giuseppe bonacci <g.bonacci@libero.it>:
New Bug report received and forwarded. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Wed, 11 Feb 2009 09:57:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: giuseppe bonacci <g.bonacci@libero.it>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.
Date: Wed, 11 Feb 2009 10:55:51 +0100
[Message part 1 (text/plain, inline)]
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
[php.curlstream.patch (text/x-c, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#514832; Package php5. (Wed, 11 Feb 2009 17:36:10 GMT) (full text, mbox, link).


Acknowledgement sent to Raphael Geissert <atomo64+debian@gmail.com>:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Wed, 11 Feb 2009 17:36:10 GMT) (full text, mbox, link).


Message #10 received at 514832@bugs.debian.org (full text, mbox, reply):

From: Raphael Geissert <atomo64+debian@gmail.com>
To: giuseppe bonacci <g.bonacci@libero.it>, 514832@bugs.debian.org
Subject: Re: [php-maint] Bug#514832: php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.
Date: Wed, 11 Feb 2009 11:34:00 -0600
2009/2/11 giuseppe bonacci <g.bonacci@libero.it>:
> 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

Although it could be possible that a similar situation happens when
using the standard streams functions it is not caused by this bug in
curl, because curl is not used by fopen/fsockopen and friends.

>
> please see the attached patch.

The patch looks good, thanks! Have you considered reporting this bug
to upstream so that we don't just fix it locally? Please do it, thanks
in advance.

> regards
> g.b.
>

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#514832; Package php5. (Wed, 11 Feb 2009 18:15:06 GMT) (full text, mbox, link).


Acknowledgement sent to g.bonacci@libero.it:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Wed, 11 Feb 2009 18:15:06 GMT) (full text, mbox, link).


Message #15 received at 514832@bugs.debian.org (full text, mbox, reply):

From: g.bonacci@libero.it
To: Raphael Geissert <atomo64+debian@gmail.com>
Subject: Re: [php-maint] Bug#514832: php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.
Date: Wed, 11 Feb 2009 19:10:38 +0100
On Wed, Feb 11, 2009 at 11:34:00AM -0600, Raphael Geissert wrote:
> > I believe this problem is related to http://bugs.php.net/bug.php?id=23258
> 
> Although it could be possible that a similar situation happens when
> using the standard streams functions it is not caused by this bug in
> curl, because curl is not used by fopen/fsockopen and friends.
> 

I'm not very familiar with php, but I believe that libcurl is indeed
used when a url is passed as filename to fopen().

> 
> The patch looks good, thanks! Have you considered reporting this bug
> to upstream so that we don't just fix it locally? Please do it, thanks
> in advance.
> 

hm... I've not tested it very extensively, hence it's advisable to
have upstream check the patch, before applying it locally.  however,
I'd rather avoid duplicating this bug report: would you debian php
developers mind forwarding the patch upstream?  let me know.

regards,
   giuseppe




Information forwarded to debian-bugs-dist@lists.debian.org, Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>:
Bug#514832; Package php5. (Mon, 23 Feb 2009 10:06:11 GMT) (full text, mbox, link).


Acknowledgement sent to g.bonacci@libero.it:
Extra info received and forwarded to list. Copy sent to Debian PHP Maintainers <pkg-php-maint@lists.alioth.debian.org>. (Mon, 23 Feb 2009 10:06:11 GMT) (full text, mbox, link).


Message #20 received at 514832@bugs.debian.org (full text, mbox, reply):

From: g.bonacci@libero.it
To: Raphael Geissert <atomo64+debian@gmail.com>
Subject: Re: Bug#514832: [php-maint] Bug#514832: php5: performance: php_curl_stream_read() unnecessarily sleeps 15 secs under heavy load.
Date: Mon, 23 Feb 2009 10:48:52 +0100
I haven't received any news from debian, so I'm forwarding the report
upstream myself.  (http://bugs.php.net/bug.php?id=47477)

best regards
-- giuseppe




Tags added: pending Request was from Raphael Geissert <atomo64@gmail.com> to control@bugs.debian.org. (Thu, 16 Apr 2009 07:39:04 GMT) (full text, mbox, link).


Reply sent to Raphael Geissert <atomo64@gmail.com>:
You have taken responsibility. (Sat, 25 Apr 2009 17:39:12 GMT) (full text, mbox, link).


Notification sent to giuseppe bonacci <g.bonacci@libero.it>:
Bug acknowledged by developer. (Sat, 25 Apr 2009 17:39:12 GMT) (full text, mbox, link).


Message #27 received at 514832-done@bugs.debian.org (full text, mbox, reply):

From: Raphael Geissert <atomo64@gmail.com>
To: 523179-done@bugs.debian.org, 524163-done@bugs.debian.org, 514832-done@bugs.debian.org
Subject: Bug fixed in php5/5.2.9.dfsg.1-2
Date: Sat, 25 Apr 2009 12:32:49 -0500
Version: 5.2.9.dfsg.1-2

Hi,

Due to a slip while generating the changelog the bug closers were not present 
in the latest upload. Changelog follows:

php5 (5.2.9.dfsg.1-2) unstable; urgency=low 
   [ Mark A. Hershberger ]
   * fix up clean target
 
   [ Thijs Kinkhorst ]
   * Update package sections to match override.
 
   [ Raphael Geissert ]
   * Detect the path to ltmain.sh at build time and set conflicts
     appropriately
   * Add libdb4.7-dev as an ORed build dependency to fix FTBFS
   * Update the Vcs-* fields to reflect the move from svn to git
   * Turn the phpapi dependencies into php5 | phpapi to fix
     installability issues
   * Bump Standards-Version to 3.8.1, no change needed
   * Fix a typo in the code: s/adress/address
   * Add a set of lintian overrides for some FP spelling-error-in-binary
   * Avoid a useless 15 seconds sleep on php_curl_stream_read under heavy
     load
 
   [ Sean Finney ]
   * update our libtool patching to be a little cleaner and smarter
   * cleanup some of the phpize "cleanup" code in debian/rules
   * slightly refined way for supporting old/new libtool dirs

 -- Sean Finney <seanius@debian.org>  Thu, 23 Apr 2009 21:13:03 +0200

Cheers,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 24 May 2009 07:29:54 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 01:25:37 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.