[LWN Logo]
[Timeline]
Date:	Sat, 21 Oct 2000 23:34:46 -0700
From:	Dan Kegel <dank@alumni.caltech.edu>
Subject: Linux's implementation of poll() not scalable?
To:	linux-kernel@vger.kernel.org

I ran a benchmark to see how long a call to poll() takes
as you increase the number of idle fd's it has to wade through.
I used socketpair() to generate the fd's.

Under Solaris 7, when the number of idle sockets was increased from 
100 to 10000, the time to check for active sockets with poll() 
increased by a factor of only 6.5.  That's a sublinear increase in time, 
pretty spiffy.

Under Linux 2.2.14 [or 2.4.0-test1-pre4], when the number of idle sockets 
was increased from  100 to 10000, the time to check for active sockets 
with poll() increased by a factor of 493 [or 300, respectively].
This is terribly, horribly bad scaling behavior, since the time
required appears to increase three times faster than the number of sockets.

Detailed measurements and the source code used to make them
are available at http://www.kegel.com/dkftpbench/Poller_bench.html

Please, somebody point out my mistake.  Linux can't be this bad!
- Dan
-
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/