From owner-freebsd-net Sun Jul 25 21:42:10 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 83D121526D for ; Sun, 25 Jul 1999 21:42:02 -0700 (PDT) (envelope-from aron@cs.rice.edu) Received: (from aron@localhost) by cs.rice.edu (8.9.0/8.9.0) id XAA11549; Sun, 25 Jul 1999 23:39:26 -0500 (CDT) From: Mohit Aron Message-Id: <199907260439.XAA11549@cs.rice.edu> Subject: Re: FreeBSD tuning for webserver performance To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Sun, 25 Jul 1999 23:39:26 -0500 (CDT) Cc: freebsd-net@freebsd.org In-Reply-To: <199907260053.CAA03166@labinfo.iet.unipi.it> from "Luigi Rizzo" at Jul 26, 99 02:53:01 am 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 > > understand your point about SYN's, and the need to increase the input > queue length (and maybe the out queue) a bit, but you are proposing a > 20fold increase! > Well, actually I found the value of 50 too small for experiments. I've been using the value of 1000 and find no problems with it - however the increase can certainly be lesser. The number should be as large as the maximum burst that a busy webserver is willing to tolerate - the number 50 seems rather small. > But my point is, i assume a fast machine is able to process input > packets (such as SYNs) at wire speed hopefully so there shouldn't be > any significant queueing of these (i'd be glad to be corrected if you > have actual data showing that queues of SYNs do build up). > > > Even on an input burst of this kind, I don't expect that the output queues > > would be flooded because TCP takes quite a while (about 150 usec) to setup the > > connection and respond with a SYN/ACK. Even if the output queues get flooded > > hmm... this is quite a bit of time. how did you measure this and on > what hardware ? > I've measure this on a 300MHz Pentium II running FreeBSD-2.2.6. SYN processing takes about 140 usec. This isn't very surprising considering the amount of state that gets initialized - inpcb, tcpcb, socket, route structure to client etc. If connection establishment overhead takes so much time, the IP queue can certainly overlow with bursts of SYN packets. > > i think this kind of behaviour is very likely as at times (generally when > the window suddenly opens e.g. because of recovered losses) you have a > burst which can even be large (e.g. some 10-20 packets) and your data > are already queued in the socket buffer. > Yes, but I still don't see why you think dropping these packets at the driver is a good idea. The CPU has already expended work to process these packets (computing checksums and initializing all the headers). If anything, this particular problem should be fixed by making sure TCP never sends bursts - rather than dropping packets from such bursts by limiting the interface queues. - Mohit To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message