From: butesa at freenet dot de Operating system: Ubuntu 12.04 x64 PHP version: 5.5.3 Package: HTTP related Bug Type: Bug Bug description:HTTP wrapper is very slow with protocol_version 1.1
Description: ------------ Loading a website with the http wrapper takes very long if protocol_version is set to 1.1. The time it takes depends on the timeout. On some servers the problem doesn't occur. I tested also on Ubuntu 10.04 (PHP 5.3.2-1ubuntu4.19) and Ubuntu 12.04 (PHP 5.3.10-1ubuntu3.7), both 64bit. Test script: --------------- <?php $url = 'http://www.google.de/intl/de/policies/?fg=1'; foreach(array(1.0,1.1) as $proto) { for ($timeout = 1; $timeout < 60; $timeout+=10) { $st = microtime(true); $opt = array( 'http' => array( 'timeout' => $timeout, 'protocol_version' => $proto, ), ); $context = stream_context_create($opt); $content = file_get_contents($url,false,$context); printf("%2d %.1f %f %s\n", $timeout, $proto, microtime(true) - $st, md5($content)); } } ?> Expected result: ---------------- The request takes the same time, no matter what timeout and protocol_version is set. Actual result: -------------- Output of the test script: For $url='http://www.google.de/intl/de/policies/?fg=1': 1 1.0 0.279102 60bf7bc72d2a06b337c8a8464e0f9e66 11 1.0 0.277956 60bf7bc72d2a06b337c8a8464e0f9e66 21 1.0 0.283753 60bf7bc72d2a06b337c8a8464e0f9e66 31 1.0 0.285862 60bf7bc72d2a06b337c8a8464e0f9e66 41 1.0 0.277894 60bf7bc72d2a06b337c8a8464e0f9e66 51 1.0 0.285653 60bf7bc72d2a06b337c8a8464e0f9e66 1 1.1 2.284301 60bf7bc72d2a06b337c8a8464e0f9e66 11 1.1 22.305424 60bf7bc72d2a06b337c8a8464e0f9e66 21 1.1 42.309270 60bf7bc72d2a06b337c8a8464e0f9e66 31 1.1 62.355997 60bf7bc72d2a06b337c8a8464e0f9e66 41 1.1 82.360794 60bf7bc72d2a06b337c8a8464e0f9e66 51 1.1 102.379933 60bf7bc72d2a06b337c8a8464e0f9e66 For $url='http://www.example.com': 1 1.0 0.491382 09b9c392dc1f6e914cea287cb6be34b0 11 1.0 0.426191 09b9c392dc1f6e914cea287cb6be34b0 21 1.0 0.428513 09b9c392dc1f6e914cea287cb6be34b0 31 1.0 0.423852 09b9c392dc1f6e914cea287cb6be34b0 41 1.0 0.423751 09b9c392dc1f6e914cea287cb6be34b0 51 1.0 0.431590 09b9c392dc1f6e914cea287cb6be34b0 1 1.1 1.420486 09b9c392dc1f6e914cea287cb6be34b0 11 1.1 6.143113 09b9c392dc1f6e914cea287cb6be34b0 21 1.1 5.994384 09b9c392dc1f6e914cea287cb6be34b0 31 1.1 5.991940 09b9c392dc1f6e914cea287cb6be34b0 41 1.1 6.012121 09b9c392dc1f6e914cea287cb6be34b0 51 1.1 6.007920 09b9c392dc1f6e914cea287cb6be34b0 For $url='http://www.php.net': 1 1.0 1.673016 2dcc6fe85b335205a35d9980a9095735 11 1.0 1.935555 2dcc6fe85b335205a35d9980a9095735 21 1.0 1.648235 2dcc6fe85b335205a35d9980a9095735 31 1.0 1.637566 2dcc6fe85b335205a35d9980a9095735 41 1.0 1.633473 2dcc6fe85b335205a35d9980a9095735 51 1.0 1.718051 2dcc6fe85b335205a35d9980a9095735 1 1.1 1.647803 2dcc6fe85b335205a35d9980a9095735 11 1.1 1.863799 2dcc6fe85b335205a35d9980a9095735 21 1.1 1.673567 2dcc6fe85b335205a35d9980a9095735 31 1.1 1.651704 2dcc6fe85b335205a35d9980a9095735 41 1.1 1.657976 2dcc6fe85b335205a35d9980a9095735 51 1.1 1.635651 2dcc6fe85b335205a35d9980a9095735 -- Edit bug report at https://bugs.php.net/bug.php?id=65634&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65634&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65634&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65634&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65634&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65634&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65634&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65634&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65634&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65634&r=support Expected behavior: https://bugs.php.net/fix.php?id=65634&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65634&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65634&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65634&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65634&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65634&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65634&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65634&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65634&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65634&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65634&r=mysqlcfg