From owner-freebsd-current Sat Oct 14 23:51:25 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id XAA06837 for current-outgoing; Sat, 14 Oct 1995 23:51:25 -0700 Received: from netcom15.netcom.com (bakul@netcom15.netcom.com [192.100.81.128]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id XAA06832 ; Sat, 14 Oct 1995 23:51:23 -0700 Received: from localhost by netcom15.netcom.com (8.6.12/Netcom) id XAA15664; Sat, 14 Oct 1995 23:49:27 -0700 Message-Id: <199510150649.XAA15664@netcom15.netcom.com> To: Terry Lambert cc: bde@zeta.org.au (Bruce Evans), hackers@freefall.freebsd.org, rdm@ic.net, current@freefall.freebsd.org Subject: Re: getdtablesize() broken? In-reply-to: Your message of "Sat, 14 Oct 95 19:14:32 PDT." <199510150214.TAA22230@phaeton.artisoft.com> Date: Sat, 14 Oct 95 23:49:24 -0700 From: Bakul Shah Sender: owner-current@FreeBSD.org Precedence: bulk > The correct limit on the largest number is FD_SETSIZE, as defined in > sys/types.h. IMHO limiting the fdset bitarray size like this *within* the kernel is a mistake. I have an application where I run into this and am forced to use a multi process solution. Imagine a server handling > FD_SETSIZE (i.e. 256) TCP connections to clients -- requests are not all that frequent and each takes just a little bit of time to service so they *can* all be handled by one process easily. A multi process solution gets complicated (need to put shared state in shared memory, use locking etc.) and slower (extra contex switches, lock/unlock time). Using a limit of FD_SETSIZE does not buy you extra protection or anything. RLIMIT_NOFILE is the right limit to check against in kern/sys_generic.c:select(). Mercifully this limit is changeable via sysctl so server machines can up it. NetBSD, FreeBSD, Linux and may be even bsdi (I haven't checked recently) are all guilty here. Small upper limits is another thing that separates PeeCees from serious server machines. Let me say this another way. If I can create N files, I should damn well be able to select() on any one of them. -- bakul