Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 16093 invoked from network); 21 Aug 2009 08:23:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Aug 2009 08:23:08 -0000 Received: (qmail 85282 invoked by uid 500); 21 Aug 2009 08:23:29 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 85208 invoked by uid 500); 21 Aug 2009 08:23:29 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 85199 invoked by uid 99); 21 Aug 2009 08:23:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 08:23:29 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of alex.stapleton@gmail.com designates 209.85.218.208 as permitted sender) Received: from [209.85.218.208] (HELO mail-bw0-f208.google.com) (209.85.218.208) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2009 08:23:21 +0000 Received: by bwz4 with SMTP id 4so340345bwz.24 for ; Fri, 21 Aug 2009 01:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=1lKLwTgEfw7DIoIp/3EUBRSGQW1mn2r+qkoAarlRw9E=; b=v3cE3w+NM2taqu/DOjv793u9xHVtM2AwrTbW1gT8Iq+e8gL/M4sV8Xtc7cqO2b8PA9 wdP4Jget73Wcc9IzyrAj5jgo8JWW3K72RIGs9eQJzfpQk9OtxTgUHAw0/qZQRcdmgcLF sCORrg1+yKfh8EHP/YT2AA0NNyVw2yisoMjpo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Agcu8TE6KXt2y+we3+0POYPRMO8d/9z+RcRRIhd2mohYQCMqd7eBc64OXSP4eFBsQ2 H8mrzx1ct+IyYwK83A6nwt1/5jd29F/eZJkBkxw/cEmkC1izLxl12V0EARIxipATCESN xohLhfQ9vqenWtxpjusVlELezAg+j1YqJ7hRE= MIME-Version: 1.0 Received: by 10.102.170.12 with SMTP id s12mr350038mue.12.1250842979573; Fri, 21 Aug 2009 01:22:59 -0700 (PDT) In-Reply-To: <3ad3168b0908210106l1e066ed8p3f46505e803f1084@mail.gmail.com> References: <3ad3168b0908190953u599afdd8gc47d932e364256b4@mail.gmail.com> <3ad3168b0908200201s39365d97h25ad1ed7d22dbf4a@mail.gmail.com> <3ad3168b0908210106l1e066ed8p3f46505e803f1084@mail.gmail.com> Date: Fri, 21 Aug 2009 09:22:59 +0100 Message-ID: <3ad3168b0908210122rafd9007j368d1e528c0b74e4@mail.gmail.com> Subject: Re: mod_ssl and Transfer-Encoding: chunked wastes ~58 bytes per chunk. From: Alex Stapleton To: dev@httpd.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 2009/8/21 Alex Stapleton : > 2009/8/20 Roy T. Fielding : >> On Aug 20, 2009, at 2:01 AM, Alex Stapleton wrote: >>> >>> 2009/8/19 Roy T. Fielding : >>>> >>>> On Aug 19, 2009, at 9:53 AM, Alex Stapleton wrote: >>>> >>>>> (This has been cross posted to users@. I apologise if this mail isn't >>>>> relevant to the dev list.) >>>>> >>>>> First some background. We use Apache HTTPD 2.0 over a high-latency, >>>>> high packet loss GPRS WAN. The cost per byte is tangible. We use SSL. >>>>> We also use Transfer-Encoding: chunked sometimes. This is a machine >>>>> monitoring application. We are using iframe streaming to push real >>>>> time data to operators browsers. >>>>> >>>>> I have noticed after much faffing around with wireshark that httpd >>>>> will transmit 3 Application Data fragments for each chunk in a chunke= d >>>>> HTTP stream. The fragments are the HTTP chunk size, the chunk data, >>>>> and then a CRLF. All fragments in an SSL session are rounded to the >>>>> length of the ciphers block size. This results in the 4+2 bytes for >>>>> the chunk frame ending up being 64 bytes of data over TCP. A waste of >>>>> 58 bytes per chunk in this case. >>>> >>>> That's odd -- we don't do this with non-SSL writes (last I checked). >>>> Perhaps we are relying on a TCP cork for the non-SSL case? >>>> What is your operating system and platform? >>> >>> I initially discovered this issue on a fairly old Ubuntu 6 machine >>> running httpd 2.0.55-4ubuntu4.1. I have since recreated it on my OS X >>> 10.5 iMac using httpd 2.0.64 from MacPorts. I suppose I should also >>> point out that I am using PHP 5.2.9 to generate the chunked data. If >>> there's a way of doing chunked output using "plain" Apache let me know >>> and I can test that too if needed. >> >> Er, have you tested it with 2.2.x? =C2=A0The likelihood of us making any >> non-security changes to the 2.0.x branch is extremely small. > > I have tested with 2.2.11 from MacPorts on my iMac and it also > exhibits this behaviour. I'll try and do a 2.2.13 build to test with > :) Confirmed on 2.2.13. >> Apache does chunked output by default if no content-length is >> provided and the client says it is HTTP/1.1. >> >> ....Roy >> >> >