From: Davy Durham <pubaddr2@davyandbeth.com>
To: linux-kernel@vger.kernel.org
Subject: select() efficiency
Date: Fri, 22 Jul 2005 16:18:46 -0500 [thread overview]
Message-ID: <42E162B6.2000602@davyandbeth.com> (raw)
Please forgive and redirect me if this is not the right place to ask
this question:
I'm looking to write a sort of messaging system that would take input
from any number of entities that "register" with it.. it would then
route the messages to outputs and so forth..
I'm guessing that the messaging system would be a single process on the
machine..
So, I'm considering making the means of input to the system be a unix
socket. An entity would connect to the socket as it's means of
inputting messages into the system.
However, lets suppose that 1000+ entities connect to that socket.. this
would require the message system's loop to be adding 1000+ file
descriptures to an fd_set and call select() every time it loops around
to check for any messages.
So, my question is: how efficient would things be, doing selects() very
often on 1000+ file descriptors? I'm not aware of max size for an
fd_set.. (I do know that NT is limited to 64 handles.. but that's really
beside the point unless I look at porting someday)
Should I go another route?
The system is meant to rapidly route messages ASAP.. so it would be a
bad idea to say write them to a file and poll the file or something like
that...
Another thought was to use a system-wide mutex and write to a named
pipe, but the socket method seems more appealing to me in design... and
I didn't know if it was pretty much equivalent either way since either I
will do the work of dealing with 1000+ things or the kernel will.
Thanks,
Davy
next reply other threads:[~2005-07-22 21:20 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 21:18 Davy Durham [this message]
2005-07-22 21:24 ` select() efficiency bert hubert
2005-08-23 9:49 ` select() efficiency / epoll Davy Durham
2005-08-23 18:24 ` bert hubert
2005-08-23 11:01 ` Davy Durham
2005-08-23 11:25 ` Davy Durham
2005-08-23 19:12 ` Willy Tarreau
2005-08-23 11:24 ` Davy Durham
2005-08-23 19:45 ` Willy Tarreau
2005-08-23 11:55 ` Davy Durham
2005-08-23 20:20 ` Willy Tarreau
2005-08-23 23:21 ` Davide Libenzi
2005-08-23 17:08 ` Davy Durham
2005-08-24 5:09 ` Davide Libenzi
2005-08-23 22:35 ` Davy Durham
2005-08-23 19:30 ` Jari Sundell
2005-08-23 11:53 ` Davy Durham
2005-08-23 20:42 ` Jari Sundell
2005-08-23 17:11 ` Davy Durham
2005-08-23 17:40 ` Davy Durham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42E162B6.2000602@davyandbeth.com \
--to=pubaddr2@davyandbeth.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox