Re: [hybi] permessage-deflate performance tuning statistics

Adam Rice <ricea@google.com> Thu, 17 October 2013 06:53 UTC

Return-Path: <ricea@google.com>
X-Original-To: hybi@ietfa.amsl.com
Delivered-To: hybi@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 340C411E80FA for <hybi@ietfa.amsl.com>; Wed, 16 Oct 2013 23:53:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NO_RELAYS=-0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDGOs1dkNQAB for <hybi@ietfa.amsl.com>; Wed, 16 Oct 2013 23:53:39 -0700 (PDT)
Received: from mail-oa0-x22c.google.com (mail-oa0-x22c.google.com [IPv6:2607:f8b0:4003:c02::22c]) by ietfa.amsl.com (Postfix) with ESMTP id 4F13611E80E6 for <hybi@ietf.org>; Wed, 16 Oct 2013 23:53:36 -0700 (PDT)
Received: by mail-oa0-f44.google.com with SMTP id l20so1356426oag.17 for <hybi@ietf.org>; Wed, 16 Oct 2013 23:53:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=QhK+cM7EIPXaSqF5qRiBc6Q3xMsF1JmFl+61/EaFCH8=; b=GlFB054ccyXPb45paO0BNFvUGtPnZgkMeymVCJkPLM4DFcOhXlsTFJHTTqcJ5eJR8V iSjnRp8bIkEI+XF8DWepgdxqAsBueZ03TJ682AL5HTBGUSPzOl7hWDV51WcDE4Pt/EQ8 O06VkRpxyxCPDiEvMn8IVW/9qqLk3iWdm5Z6rwvPFByEwVECK9fCCy262GvsAoGz01Tp wpejrb0COfIOONDaCNAdW/eWCJKtXfpwkuHNCd2nl7scjK0AxQARIyOE0akD7iENkVSZ Mz+9jhpQb2N0pHP6tspVr2GZ3GFDNW5Ji1BJ+R8gbo1Gf6YXMTSc4WyNz/AlLBm8eOfT 0y3A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=QhK+cM7EIPXaSqF5qRiBc6Q3xMsF1JmFl+61/EaFCH8=; b=awqyj3TvSm/SQCsU6eZm+efdqVFty4OpYx6I6pMZ2YMjamtTfh02YmpcaJKqP4vOA8 ffTLdSQBQoMmYwgGn2tesJZ/F3JY/UbicnaPl62N0IDKGJGHE1UqMDJRUuMF0Y+NED7w mVfQFWSdxeaauEWnbnbaSYKzTUbySs9IP83O33JfauSOossm9TsTfH7j2c4At7eL2jk4 BIraWBm32NGmCtl3oWjyGtaRm/xVeEts9DNRqtl3h6gVHyFY9Slt6n/+sv2gxjTf7QoC EcDqQskH6JUJy7JqfQOdHENeCRE+NZdTjbmJREwaKRxBqdhTHmDi3bDMfWZM/e3y5SwT acUA==
X-Gm-Message-State: ALoCoQmCynrIuoYLklZx5DI2/x3YnTo6V0XJgRjskpwtTJhui5hnp2ggYwDUeU2yU9JkqlORtyMKodcPJUcc7cGFgeRvB3W3FuGIr2GLksH5H+ECVzkfhbXJ7g84RtCf5vhN5QOPMvASGVWw1Vgs1X52ch4iNdBtAXGDq8zgsGu/vkV3oIipVLz5mS9c9xD3d6VvtPQ5VVxY
MIME-Version: 1.0
X-Received: by 10.182.129.201 with SMTP id ny9mr11610879obb.0.1381992815760; Wed, 16 Oct 2013 23:53:35 -0700 (PDT)
Received: by 10.182.39.36 with HTTP; Wed, 16 Oct 2013 23:53:35 -0700 (PDT)
In-Reply-To: <64654145-6171-47C8-B990-D11F34E8B67B@zaphoyd.com>
References: <FD138330-7D7E-4450-B4F5-64551F92F26D@zaphoyd.com> <CAG4zZZBFVoYt7RLir_EZ+brW_heThO7D-CdQxWc4gicZBG2fCA@mail.gmail.com> <64654145-6171-47C8-B990-D11F34E8B67B@zaphoyd.com>
Date: Thu, 17 Oct 2013 15:53:35 +0900
Message-ID: <CAHixhFqH4V8GUay6cXpAvnRtH00=JXAQQfvnW+qwu5Mf-4fyjQ@mail.gmail.com>
From: Adam Rice <ricea@google.com>
To: Peter Thorson <webmaster@zaphoyd.com>
Content-Type: multipart/alternative; boundary="089e015366b4ddad0f04e8ea4667"
Cc: "hybi@ietf.org" <hybi@ietf.org>
Subject: Re: [hybi] permessage-deflate performance tuning statistics
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 17 Oct 2013 06:53:40 -0000

Very interesting results, thank you!

On 16 October 2013 05:50, Peter Thorson <webmaster@zaphoyd.com> wrote:
>
> For cases without context takeover it would get more complicated, do you
> retain context between fragments? If so that negates all of the memory
> benefits of no-context-takeover… This needs to be clarified in the
> permessage-compress draft spec.
>

Context *is* retained between frames. This is the meaning of "permessage"
in "permessage-compression". The wording in the spec could maybe be
clearer. I was confused about this myself for a long time.

The consequence is that you are not guaranteed to need less compression
contexts than connections, unless you know something about the traffic you
are handling. Specifically, if you know all your messages will be smaller
than the size of the compression context, then you know you can save memory
by only keeping one compression context around. So a browser or a proxy
cannot be certain to benefit from no-content-takeover, but a server can
usefully use it on applications where it makes sense.


> It would definitely be worth experimenting with a connection that
> multiplexes small messages with large ones, say for the example case where
> you are delivering new documents over the WebSocket connection as we'll as
> small updates. Getting some tests with binary/compressed data intermixed
> would also be useful it sounds. Does anyone have any sample data for such a
> connection?
>
>
An interesting property of valid UTF-8 data is that given a sufficiently
large quantity, it is always compressible. Binary data, on the other hand,
is quite likely to have had compression applied to it already and be
incompressible by a generic algorithm like deflate. So a WebSocket with a
mixture of text and binary messages is challenging to compress effectively
and efficiently.

Thanks,
Adam Rice