Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 95053 invoked from network); 6 Jan 2004 15:15:36 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Jan 2004 15:15:36 -0000 Received: (qmail 74433 invoked by uid 500); 6 Jan 2004 15:15:06 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 74391 invoked by uid 500); 6 Jan 2004 15:15:06 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 74348 invoked from network); 6 Jan 2004 15:15:06 -0000 Received: from unknown (HELO netspace.org) (64.61.61.206) by daedalus.apache.org with SMTP; 6 Jan 2004 15:15:06 -0000 Received: from netspace.org (localhost.localdomain [127.0.0.1]) by netspace.org (8.12.10/8.12.10) with ESMTP id i06FEko5028416 for ; Tue, 6 Jan 2004 10:14:46 -0500 Received: (from gs@localhost) by netspace.org (8.12.10/8.12.10/Submit) id i06FEjo2028414 for dev@httpd.apache.org; Tue, 6 Jan 2004 10:14:45 -0500 Date: Tue, 6 Jan 2004 10:14:45 -0500 From: Glenn To: dev@httpd.apache.org Subject: Re: FD_SETSIZE comparison Message-ID: <20040106151445.GA26453@netspace.org> References: <3FFACBFB.9000104@web.turner.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FFACBFB.9000104@web.turner.com> User-Agent: Mutt/1.4.1i X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Tue, Jan 06, 2004 at 09:53:47AM -0500, Brian Akins wrote: > Call me stupid, put why in various places does Apache do things like this: > if (csd >= FD_SETSIZE) { > ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, > "new file descriptor %d is too large; you probably > need " > "to rebuild Apache with a larger FD_SETSIZE " > "(currently %d)", > csd, FD_SETSIZE); > apr_socket_close(sock); > return; > } > > On linux, at least, FD_SETSIZE is fairly low (1024), yet the actually > max file descriptors can be much, much higher (we have thousands per > process with squid). > > Is this just not true elsewhere? Can someone explain? You can use file descriptors up to OPEN_MAX. However, you can only select() on fds < FD_SETSIZE. That is a limitation of select() because of the memory size of the fd_set typedef (based on FD_SETSIZE). It is not a limitation of poll(), or other mechanisms like kqueue, sys_epoll, or /dev/poll. Cheers, Glenn