Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jun 1999 16:37:11 -0700
From:      Aaron Mitchell <aaron@ibroadcast.net>
To:        freebsd-net@freebsd.org
Subject:   Exception Errors in Socket programming
Message-ID:  <199906111631.QAA04594@ns1.ibroadcast.net>

next in thread | raw e-mail | index | archive | help

Hello.  I hope I am not posting this question to the wrong place.  Maybe
somoene on this list can enlighten me, as I'm having trouble finding
FreeBSD specific socket information.  Here is my situation,

I am developing a multiplexed IO webserver (select() based, single process)
to serve rather large files over the web (most of them around 5 or 6
megabytes).  I usually have about 300 people simultaneously connected to
the servers during peak times.  When I started this project, I believe I
was using 2.2.6.  I'm currently running 3.2-RELEASE but may still have some
remnants of code that is no longer useful or needed.

The root of my problem seems to be limits in the OS for a single process to
be handling over 200 simultaenous users (usually 2 filedescriptors for each
person, 1 socket and one file).  When I started back in 2.2.6 and 2.2.8
days I had to compile with -DFD_SETSIZE=512 in order for select() to be
able to handle the amount of connections I had on the server.  Since 3.0 It
looks like the default is 1024, but I still run into a problem that I
*THINK* is related to th FD_SETSIZE or possibly select().    Usually
somwhere around 200 or 220 simultaneous connects, all of my connections get
dumped by select().  Every active socket connection gets flagged in the
Error Set by select() and my server drops all of the clients.  It then
rather quickly builds up again as teh users reconnect to the server, but it
is causing some very serious quality of service issues.

In the past I've thrown proceesors at the problem, and it has seemed to
work to an extent.  I used to run all of the servers load balacned across
four machines, but I'd like to eliminate the last of the bugs in the
software, solididy it's networking code, and let it handle more connections
per machine.  I don't think there is any reason why the machine shouldnt be
able to handle 500 or even a thousand simultaneous connections smoothly, my
cpu is rarely below 95% idle.  Any pointers on ways to fix my select()
problems would be greatly appreciated!

Aaron Mitchell
aaron@ibroadcast.net





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906111631.QAA04594>