#27814 [Asn]: Multiple small packets send for HTTP request
| From: | Olaf at XCC dot TMFWeb dot NL | Date: | Fri, 02 Apr 2004 19:51:33 +0000 |
| Subject: | #27814 [Asn]: Multiple small packets send for HTTP request | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-57407@lists.php.net to get a copy of this message | ||
ID: 27814
User updated by: Olaf at XCC dot TMFWeb dot NL
Reported By: Olaf at XCC dot TMFWeb dot NL
Status: Assigned
Bug Type: Performance problem
Operating System: Linux, Windows XP, 2003
PHP Version: 5.0
Assigned To: wez
New Comment:
iliaa, are you talking about ob_start()?
I'm not talking about the output traffic between PHP script/server and
browser/client, but about the input traffic between script/server and
php.net generated by file_get_contents().
Previous Comments:
------------------------------------------------------------------------
[2004-03-31 18:04:36] iliaa@php.net
------------------------------------------------------------------------
[2004-03-31 17:55:02] wez@php.net
You're correct; there is no write buffering for the http
request.
------------------------------------------------------------------------
[2004-03-31 14:49:43] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Turn on output buffering.
------------------------------------------------------------------------
[2004-03-31 14:48:37] Olaf at XCC dot TMFWeb dot NL
Description:
------------
This code sends two packets, one of 16 bytes and one of 17 bytes.
I guess this is caused by multiple calls to php_stream_write in
http_fopen_wrapper.c: php_stream_url_wrap_http_ex
Preparing the entire request in one buffer and sending it via one call
should produce less packets (and be faster).
Reproduce code:
---------------
<?php
echo strlen(file_get_contents("http://php.net/"));
?>
Expected result:
----------------
One packet of 33 bytes.
Actual result:
--------------
Two packets.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27814&edit=1