From owner-freebsd-questions Sat Oct 27 15:25:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from ren.sasknow.com (ren.sasknow.com [207.195.92.131]) by hub.freebsd.org (Postfix) with ESMTP id 9E60E37B405 for ; Sat, 27 Oct 2001 15:25:51 -0700 (PDT) Received: from localhost (ryan@localhost) by ren.sasknow.com (8.9.3/8.9.3) with ESMTP id QAA75015; Sat, 27 Oct 2001 16:25:50 -0600 (CST) (envelope-from ryan@sasknow.com) Date: Sat, 27 Oct 2001 16:25:50 -0600 (CST) From: Ryan Thompson To: Scott Gerhardt Cc: FreeBSD Subject: Re: Kernel and sysctl settings In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi Scott, Scott Gerhardt wrote to FreeBSD: > Looking for recommendations on kernel and sysctl optimizations. I'm > building a modest server to host HTTP, FTP, SQL and POP3 services. > Running FreeBSD 4.4-Release on a PIII 1GHz with 640MB+ RAM (plan to > keep increasing RAM). I suppose the answer to your questions depends on what sort of load you expect the server to be under, especially in regards to the network. FreeBSD's defaults are already suitable for stability in most network servers, and typically only need tuning for very high-performance servers. HTTP and SQL usually require a lot of file descriptors if you handle many simultaneous connections. FTP and POP3 are not typically very demanding. > net.inet.tcp.sendspace: 16384 (change to 32768) > net.inet.tcp.recvspace: 16384 (change to 32768) 32k is reasonable. You can pretty safely tune things like this, if you don't go overboard, but the performance impact you'll see on a typical "high speed" connection might not even be measurable. Run tests in your particular configuration to determine if this really helps. One thing I'd recommend is enabling RFC1323 extensions.. though, with more recent versions of FreeBSD, this is the default. > Stability 1st and performance 2nd are key factors. Then, in practice, unless you really know what you're doing and have specific reason to do so, it's usually better to leave some things well enough alone, because (pat answer) the defaults are set by FreeBSD experts who really know the internals, AND the defaults are the most widely tested configuration settings. That is not to say that you won't receive some benefit from careful sysctl tweaking, but it is also quite possible to affect a negative impact in the same or other areas of your system. > So far I have recompiled a "stripped down" kernel and added the following > options to the kernel: > maxusers 256 > options NMBCLUSTERS=32768 > > The following links have given me some ideas on what parameters can be > modified to enhance networking and performance: > http://www.enteract.com/~robt/Docs/Articles/ip-stack-tuning.html > > I don't want to start changing the defaults willynilly just because > they can be changed without knowing the impact on performance and > stability. > > Here are a few things I was thinking of changing: > > kern.ipc.somaxconn: 128 (change to 1024, 2048, or 4096) > kern.maxfiles: 8232 (change to 32768 or 65536) > net.inet.tcp.sendspace: 16384 (change to 32768) > net.inet.tcp.recvspace: 16384 (change to 32768) > > vfs.vmiodirenable=1 **What does this do? > > > Stability 1st and performance 2nd are key factors. > > Suggestions welcome please. > > > _________________________________ > > Scott Gerhardt, P.Geo. > Gerhardt Information Technologies > _________________________________ > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > -- Ryan Thompson Network Administrator, Accounts SaskNow Technologies - http://www.sasknow.com #106-380 3120 8th St E - Saskatoon, SK - S7H 0W2 Tel: 306-664-3600 Fax: 306-664-1161 Saskatoon Toll-Free: 877-727-5669 (877-SASKNOW) North America To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message