From owner-freebsd-net Fri Jun 11 16:40: 0 1999 Delivered-To: freebsd-net@freebsd.org Received: from ns1.ibroadcast.net (ns1.ibroadcast.net [207.17.118.2]) by hub.freebsd.org (Postfix) with ESMTP id C282A15467 for ; Fri, 11 Jun 1999 16:39:37 -0700 (PDT) (envelope-from aaron@ibroadcast.net) Received: from storm (soulcrusher.fate.net [209.221.145.3]) by ns1.ibroadcast.net (8.9.3/8.9.3) with SMTP id QAA04594 for ; Fri, 11 Jun 1999 16:31:37 GMT Message-Id: <199906111631.QAA04594@ns1.ibroadcast.net> X-Sender: aaron@mail.ibroadcast.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0.1 Date: Fri, 11 Jun 1999 16:37:11 -0700 To: freebsd-net@freebsd.org From: Aaron Mitchell Subject: Exception Errors in Socket programming Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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