From owner-freebsd-net Wed Jul 7 20:23:17 1999 Delivered-To: freebsd-net@freebsd.org Received: from cs.rice.edu (cs.rice.edu [128.42.1.30]) by hub.freebsd.org (Postfix) with ESMTP id 86C2314BD0 for ; Wed, 7 Jul 1999 20:23:10 -0700 (PDT) (envelope-from aron@cs.rice.edu) Received: (from aron@localhost) by cs.rice.edu (8.9.0/8.9.0) id WAA26783; Wed, 7 Jul 1999 22:23:08 -0500 (CDT) From: Mohit Aron Message-Id: <199907080323.WAA26783@cs.rice.edu> Subject: Re: paper on improving webserver performance To: julian@whistle.com (Julian Elischer) Date: Wed, 7 Jul 1999 22:23:07 -0500 (CDT) Cc: freebsd-net@freebsd.org In-Reply-To: from "Julian Elischer" at Jul 7, 99 08:13:38 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > It's definitly interesting. > The comment about having compared against timer wheels is especially > interesting given that Garrett has been working on replacing the TCP > timers with timer wheels... > > maybe he has some tricks up his sleave that win back some of the > difference... > Perhaps the following would help. My implementation of timing wheels was well optimized. To continue TCP to use integer variables, only a single event was inserted into the timing wheel corresponding to all the TCP timers. This event corresponded to the time that the earliest timer needed to fire. Further, this event wasn't cancelled even if the TCP timers were. Thus TCP would set and unset its timers by simply changing the integer variables. When the handler for the timing wheel event fired, it checked all the TCP timers and took corresponding action. After the action was taken for every timer, another event was inserted into the timing wheel that corrsponding to the next earliest TCP timer that needed to fire. To speed up the implementation further, the event inserted into the timing wheel was allocated with the tcpcb structure - so there aren't any malloc or free operations going on after the tcpcb structure is allocated. Inspite of the above, the timing wheel still proved to be a little more costly than the list based implementation. However, the timing wheel solution might be the way to go if the clock granularity were to be made finer than 500ms. - Mohit To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message