From owner-freebsd-hackers Mon Nov 13 12:01:00 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id MAA23491 for hackers-outgoing; Mon, 13 Nov 1995 12:01:00 -0800 Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id MAA23441 for ; Mon, 13 Nov 1995 12:00:27 -0800 Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id VAA01171; Mon, 13 Nov 1995 21:00:45 +0100 From: Luigi Rizzo Message-Id: <199511132000.VAA01171@labinfo.iet.unipi.it> Subject: TIME_WAIT and linear chain of TCPCBs (was: ...beat a WEB server to death) To: hackers@freebsd.org, luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Mon, 13 Nov 1995 21:00:44 +0100 (MET) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 1592 Sender: owner-hackers@freebsd.org Precedence: bulk There are two phenomenons which might disturb performance on a busy http or gopher server. I would like to know how FreeBSD deals with them * TIME_WAIT: a connection should remain in the TIME_WAIT status for 2MSL. According to the spec this is 4 minutes, although I believe 4.4Lite uses a shorter value (1minute ?). As J.Mogul points out in his paper "The case for Persistent-Connection HTTP", http://ftp.digital.com/~mogul/sigcomm95.ps, a busy server might end up with many thousands of connections in the time wait state, consuming a large amount of memory; * TCPCB caching when an incoming segment arrives, the pertinent tcpcb must be located. I believe that 4.4Lite uses a linear chain of tcpcbs, with possibly a pointer to recently used ones. On a busy server, both the arrangement and the cache are not very effective. Someone in the literature (I forget whom, but Stevens' book "TCP/IP illustrated" tells more on this) suggested the use of a hash table. I believe a busy HTTP server using 4.4Lite code can become very inefficient in demuxing incoming TCP segments for the above two reasons. Does -current code include any improvement to the code ? Luigi ==================================================================== Luigi Rizzo Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it Universita' di Pisa tel: +39-50-568533 via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 http://www.iet.unipi.it/~luigi/ ====================================================================