Intel boxes as multi-user servers

Intel boxes as multi-user servers

Post by Mark A. Dav » Thu, 20 May 1993 21:40:16

>I'll tilt at the windmill and disagree with Peter.
>It is a Personal Computer if I can turn it off and on again and nobody
>including me yells at me.
>It is not a PC if I turn it off and other people come in and yell at me
>or I yell at myself for being a twit.

Correct.  It's as simple as that.

[much more stuff about definitions of "PC's and Workstations deleted]

Let's now continue the discussion of "Intel boxes as multi-user servers"
(if anyone wants to).  Just make sure to say "clone", "PC clone", or "IBM PC
clone" is that is what you mean; otherwise I and others will assume you
mean any machine containing Intel processors......
  | Mark A. Davis    | Lake Taylor Hospital | Norfolk, VA (804)-461-5001x431 |



1. Multi-user server architecture issues

Hello, all.

I am working on a multi-user server that should handle more than 1000
users simultaneously.

In the beginning I had to decide which one of the 2 main methods to
use. The select() / poll() in a single process, OR thread per user
based system.

I went with the select() / poll() cuz I figured, at the servers max
usage, the scheduler will spend more time running than the actual
threads themselves. I know that there is not that much overhead
involved in threads as they do in presses sched.
But anyway.

Ok , here is how I built the foundation.
I have a user() class and an array of pointers to user() class.
In my loop I call select with all users inserted in the read set.

After select returns,  I go through the array one by one and check to
see if the user  has any data to read, if yes I process the data, and
append it to a send buffer for the user, than I check to see if the
user is write ready on socket, if yes I send data, after the send call
I check again if there is any data left in the send buffer,
if yes, I insert user into send set (FD_SET()).
And I go on to the next user. So on and so on until I go through the
whole array.

But now that I look at it, certain users get priority over other users
because they come first in the array before others. It also could
cause problems, not as in (BUGS) but something like this, if
array[n]->user and array[n+5] both returned from select
at the same time, than the array[n]->user gets priority over
array[n+5]->user even though array[n+5]->users data MIGHT have
arrived earlier. In a chat server this would suck.

Another problem I am starting to encounter is the send buffer. Lets
say I have a 500 user chat server. All 500 users are connected. I call
select() with all 500 of them in the set. Sure not all 500 of them
will be ready for reading, but lets say 30 of them are. So according
to the  algorithm on top, when I go through the array and process
data, some data is required to be sent to all users, so I append to
each users send buffer. So until the next select call some of the
users send buffers get to be very huge. I have solved half of this
problem by using dynamic memory. But I figure there has to be a better

I tried to come up with a method to send data to users as soon as they
are processed instead of appending them to a send buffer, BUT you wont
know if the users socket is ready to be written yet, until you call

If anybody has a better way of building a multi-user server
architecture, please post your ideas. Any kind of improvement on the
algorithm above will be appreciated.

2. COX @Home network woes... cable modem ;-(

3. Development of multi-user servers.

4. Upgrade all Linux Certification exams to test knowledge of PROGRAMMING!!

5. Multi-user server architecture issues

6. How to set X11 planes number on a DEC alpha

7. looking for a multi-user server example

8. TV tuner board & Linux?

9. Multi-user chatting server.

10. multi-user: multi-head (monitor), keyboard, mouse, setup?

11. multi-user: multi-head (monitor), USB keyboards and mice?

12. Multi-user vs. Single-user

13. SCO Merge 2 User w/ 3.2r4.2 multi-user license