On Wed, 10 Jan 2001, Dan Kegel wrote:
> select() is usually limited to 1024 file descriptors
oh hey, this limit is only a libc limit these days. you can do this:
#define MY_FD_SETSIZE (16384)
typedef struct {
__fd_mask __fds_bits[MY_FD_SETSIZE / __NFDBITS];
} my_fd_set;
#define MY_FD_ZERO(_f) (memset((_f), 0, sizeof(my_fd_set)))
and do select()s of 16384 descriptors.
> poll() is a slightly better choice. However, although
> it can handle 30000 file descriptors, the performance sucks;
> see http://www.kegel.com/dkftpbench/Poller_bench.html#results
poll() stops working at 16384 file descriptors (as of 2.2.14-foo original
redhat 6.2 kernel). at least that's where i think it is, maybe it's
32768. it's limited by the maximum kmalloc() size of 128k. this is
somewhat unfortunate. even though we know it'll stop performing well.
-dean
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:32 EST