*BSD News Article 58205


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.uoknor.edu!news.ualr.edu!medusa.k12.ar.us!newsfeeder.gi.net!newsfeed.internetmci.com!swrinde!elroy.jpl.nasa.gov!lll-winken.llnl.gov!venus.sun.com!uk-usenet.uk.sun.com!sungy!usenet
From: Casper.Dik@Holland.Sun.COM (Casper H.S. Dik - Network Security Engineer)
Newsgroups: comp.unix.bsd.bsdi.misc,comp.unix.advocacy
Subject: Re: multiple httpds vs threads vs ... (was BSDI Vs. NT...)
Date: 27 Dec 1995 14:40:37 GMT
Organization: Sun Microsystems, Netherlands
Lines: 39
Message-ID: <4brlt5$8un@sungy.Germany.Sun.COM>
References: <taxfree.3.00C439A1@primenet.com> <4be592$6tb@madeline.ins.cwru.edu> <4bhfmp$gei@Mars.mcs.com> <DK5Crs.I77@metrics.com> <4bmsjp$7lv@elf.bsdi.com> <bakulDK7u6M.LrM@netcom.com>
NNTP-Posting-Host: aft-ms.holland.sun.com
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:1854 comp.unix.advocacy:12673

bakul@netcom.com (Bakul Shah) writes:

>number of portability bugs.  I was also surprised to find that
>NT's select() implementation can handle many more fds than BSDi,
>SunOS, Solaris, NetBSD, FreeBSD, Linux etc.  Only IRIX did better
>(haven't yet tested a number of other UNIX machines).  For OSes
>where I have the source I can recompile the kernel with bigger
>FDSET_SIZE but they really should be doing dynamic allocation.

That's not correct.  Most modern implementations allow you to redefine
FDSET_SIZE to anything you please by defining FDSET_SIZE before including
the header that usually defines it (the header defines FDSET_SIZE only
if not previously defined).

However, this only goes to show that select() is really broken and the
only reason that it scaled beyond one int's worth of fds was because arrays
of integers and one integer by reference use the same calling sequence.
System V Poll() is much better in that respect, as it gives the application
full control over how many fds you use.  The set-size is yours to specifiy.
(And poll allows to select for more than just read/write/exception).

Some OSes do have a limit on the number of filedescriptors per process.
(SunOS 4.x has a limit of 256)

And it's impossible to just raise that limit on the OSes that allow it;
there's to much legacy code out there that gets confused in the presence of
large numebrs of filedescriptors or that uses for 0 to max close(fd).

If there's one disadvantage Unix has is the amount of legacy code that uses
algorithms that don't scale in the presence of abundant resources.
But for an httpd that's being newly developed, that's not a problem,
as you get to chose the algorithm and set the descriptor limits.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
not be quoted back to Sun support as "but Casper Dik says".