Re: [hybi] Upgrade Mechanism and HasMat (was Re: Extensibility mechanisms?)

Dave Cridland <dave@cridland.net> Thu, 22 July 2010 14:22 UTC

Return-Path: <dave@cridland.net>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id CC2D33A6767 for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 07:22:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.351
X-Spam-Level:
X-Spam-Status: No, score=-2.351 tagged_above=-999 required=5 tests=[AWL=0.248, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9jIoJyFW+++g for <hybi@core3.amsl.com>; Thu, 22 Jul 2010 07:22:16 -0700 (PDT)
Received: from peirce.dave.cridland.net (peirce.dave.cridland.net [217.155.137.61]) by core3.amsl.com (Postfix) with ESMTP id C92AB3A69DB for <hybi@ietf.org>; Thu, 22 Jul 2010 07:22:15 -0700 (PDT)
Received: from localhost (localhost.localdomain [127.0.0.1]) by peirce.dave.cridland.net (Postfix) with ESMTP id 9E29B116805C; Thu, 22 Jul 2010 15:22:29 +0100 (BST)
X-Virus-Scanned: Debian amavisd-new at peirce.dave.cridland.net
Received: from peirce.dave.cridland.net ([127.0.0.1]) by localhost (localhost.localdomain [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RC3A1JA9nNpI; Thu, 22 Jul 2010 15:22:28 +0100 (BST)
Received: from puncture (puncture [217.155.137.60]) by peirce.dave.cridland.net (Postfix) with ESMTPA id 1EA381168041; Thu, 22 Jul 2010 15:22:28 +0100 (BST)
References: <AANLkTi=ND-FOH8OoD=TCbiyeSZ-h0LhxQBXN5w-2hfvj@mail.gmail.com> <20100722055452.GL7174@1wt.eu> <AANLkTik_rpxo=1OfzHkwpC5soQG_NxvGuZNXx7gdhVTh@mail.gmail.com> <20100722064945.GM7174@1wt.eu> <AANLkTim7AsQGSwLE51uktj=B1vB6roZChAtDoCrE6fFG@mail.gmail.com> <4C47FF71.3050000@ericsson.com> <18E0FF9C-6C51-4602-92E1-E44802D0D8B5@gbiv.com> <4C481C76.1060907@ericsson.com> <20100722121317.GA12582@1wt.eu> <27220.1279801645.011385@puncture> <20100722123317.GC12582@1wt.eu>
In-Reply-To: <20100722123317.GC12582@1wt.eu>
MIME-Version: 1.0
Message-Id: <27220.1279808548.060526@puncture>
Date: Thu, 22 Jul 2010 15:22:28 +0100
From: Dave Cridland <dave@cridland.net>
To: Willy Tarreau <w@1wt.eu>, "Roy T. Fielding" <fielding@gbiv.com>, Server-Initiated HTTP <hybi@ietf.org>, Salvatore Loreto <salvatore.loreto@ericsson.com>
Content-Type: text/plain; delsp="yes"; charset="us-ascii"; format="flowed"
Subject: Re: [hybi] Upgrade Mechanism and HasMat (was Re: Extensibility mechanisms?)
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/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, 22 Jul 2010 14:22:17 -0000

On Thu Jul 22 13:33:17 2010, Willy Tarreau wrote:
> Hi Dave,
> 
> On Thu, Jul 22, 2010 at 01:27:25PM +0100, Dave Cridland wrote:
> > On Thu Jul 22 13:13:17 2010, Willy Tarreau wrote:
> > >The only fear I have right now with the nonce as defined by the  
> WS
> > >draft
> > >is that it makes use of MD5 which comes with a cost. I know at
> > >least one
> > >site dealing with more than 300k concurrent connections at a rate
> > >between
> > >12 and 18k per second (long polling right now), and I think that
> > >computing
> > >MD5 hashes can significantly impact performance at these rates.  
> If
> > >the
> > >goal is to ensure the response header depends on the request
> > >header, we
> > >may reliably make use of cheaper algorithms.
> >
> > I'd assume that an actual server can do faster than my cheap
> > workstation:
> >
> > $ openssl speed md5
> > Doing md5 for 3s on 16 size blocks: 7765276 md5's in 3.00s
> > Doing md5 for 3s on 64 size blocks: 6086328 md5's in 3.00s
> > Doing md5 for 3s on 256 size blocks: 3674140 md5's in 3.00s
> > Doing md5 for 3s on 1024 size blocks: 1420165 md5's in 3.00s
> > Doing md5 for 3s on 8192 size blocks: 212112 md5's in 3.00s
> >
> > FWIW, SHA-1 is only slightly slower. If you had 300k all join at
> > once, then it still seems to be this would be a drop in the ocean  
> in
> > terms of loading.
> 
> Nice, thanks for feeding some useful info here ! So we can assume
> that a correctly sized server will be able to compute at least 2
> million hashes a second, which translates into less than 1% CPU
> overhead at 20000 connections per second.
> 
> 
Well, perhaps a bit worse than that - say 1 million per second, and  
therefore 2%.

Although MD5 has some security weaknesses, its major problem is  
usually that it's too fast - consider how fast it is to exhaustively  
search the unsalted intermediate hash of Digest authentication, for  
instance.

Dave.
-- 
Dave Cridland - mailto:dave@cridland.net - xmpp:dwd@dave.cridland.net
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade