lkml.org 
[lkml]   [2001]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Poll and Select not scaling
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/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.041 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site