From owner-freebsd-questions@FreeBSD.ORG Thu Oct 19 15:24:43 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 455E716A412 for ; Thu, 19 Oct 2006 15:24:43 +0000 (UTC) (envelope-from ke.han@redstarling.com) Received: from smtp104.biz.mail.mud.yahoo.com (smtp104.biz.mail.mud.yahoo.com [68.142.200.252]) by mx1.FreeBSD.org (Postfix) with SMTP id C95A043D78 for ; Thu, 19 Oct 2006 15:24:42 +0000 (GMT) (envelope-from ke.han@redstarling.com) Received: (qmail 84806 invoked from network); 19 Oct 2006 15:24:42 -0000 Received: from unknown (HELO ?192.168.1.20?) (ke.han@redstarling.com@218.79.209.77 with plain) by smtp104.biz.mail.mud.yahoo.com with SMTP; 19 Oct 2006 15:24:41 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-Id: Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: freebsd-questions Questions list From: ke han Date: Thu, 19 Oct 2006 23:24:30 +0800 X-Mailer: Apple Mail (2.752.3) Subject: FreeBSD 6.1 max sockets X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Oct 2006 15:24:43 -0000 I am writing a socket server deamon in C++ on FreeBSD 6.1 (or 6.2 if this matters to your answer). What this does is accept many sockets and does a little work with each. Each socket has low traffic but stay connected for long periods. All these sockets get accepted through one public ip:port (if this matters). So my desire is two things: 1 - good event handling for knowing which sockets have new data. I assume kqueue is the way to go here? 2 - I need to know what my limits are on max number of sockets. If my system is a 64-bit install on a server with 8GB RAM, I need to know how many sockets I can handle. Also, what options do I have to tune this? socket buffer size? Any kernel parameters needed to tune? thanks, ke han