#27814 [Com]: Multiple small packets send for HTTP request

From: Date: Fri, 07 Mar 2008 00:01:19 +0000
Subject: #27814 [Com]: Multiple small packets send for HTTP request
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123011@lists.php.net to get a copy of this message
ID: 27814 Comment by: a dot u dot savchuk at gmail dot com Reported By: Olaf at XCC dot TMFWeb dot NL Status: Assigned Bug Type: Feature/Change Request Operating System: * PHP Version: 5.1* Assigned To: wez New Comment: Problem still exists. tcpdump shows during execution test example that 'GET ...' and 'Host ...' are sent by multiple packets: --------- 000110 IP (tos 0x0, ttl 64, id 62602, offset 0, flags [DF], proto 6, length: 68) x.x.x.x.42720 > 69.147.83.197.80: P [tcp sum ok] 1:17(16) ack 1 win 1460 <nop,nop,timestamp 339227911 3473916863> E..D..@.@... . FE.S....P.....,.D........... .85.....GET / HTTP/1.0 101682 IP (tos 0x0, ttl 57, id 8438, offset 0, flags [DF], proto 6, length: 52) 69.147.83.197.80 > x.x.x.x.42720: . [tcp sum ok] 1:1(0) ack 17 win 33296 <nop,nop,timestamp 3473916965 339227911> E..4 .@.9.sTE.S. . F.P...,.D........,z..... ...%.85. 000024 IP (tos 0x0, ttl 64, id 62603, offset 0, flags [DF], proto 6, length: 69) x.x.x.x.42720 > 69.147.83.197.80: P [tcp sum ok] 17:34(17) ack 1 win 1460 <nop,nop,timestamp 339227937 3473916965> E..E..@.@... . FE.S....P.....,.D........... .85!...%Host: php.net 013718 IP (tos 0x0, ttl 57, id 61609, offset 0, flags [DF], proto 6, length: 1500) 69.147.83.197.80 > x.x.x.x.42720: . 1: 1449(1448) ack 34 win 33304 <nop,nop,timestamp 3473916977 339227937> E.....@.9...E.S. . F.P...,.D........,_..... ...1.85!HTTP/1.1 200 OK D ate: Fri, 07 --------- Previous Comments: ------------------------------------------------------------------------ [2005-07-29 18:21:26] sniper@php.net Still considering after over a year or is this fixed by now? (should this actually be a feature request?) ------------------------------------------------------------------------ [2004-04-19 06:38:09] pollita@php.net It's too late for the 5.0 branch (which is in final RC stage), but it's under consideration for the 5.1 branch. ------------------------------------------------------------------------ [2004-04-19 03:02:02] OvdSpek at LIACS dot NL Will a buffer be added? ------------------------------------------------------------------------ [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: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

« previous php.bugs (#123011) next »