Re: Allowing more than 64k connections and heavily optimize bind(0) time.
From: Evgeniy Polyakov <hidden>
Date: 2008-12-26 08:31:11
Attachments
- bind_time.png [image/png] 38816 bytes
From: Evgeniy Polyakov <hidden>
Date: 2008-12-26 08:31:11
On Wed, Dec 24, 2008 at 10:09:26PM +0300, Evgeniy Polyakov (zbr@ioremap.net) wrote:
With simple extension to the binding mechanism, which allows to bind more than 64k sockets (or smaller amount, depending on sysctl parameters), we have to traverse the whole bind hash table to find out empty bucket. And while it is not a problem for example for 32k connections, bind() completion time grows exponentially (since after each successful binding we have to traverse one bucket more to find empty one) even if we start each time from random offset inside the hash table. So, when hash table is full, and we want to add another socket, we have to traverse the whole table no matter what, so effectivelly this will be the worst case performance and it will be constant. Attached picture shows bind() time depending on number of already bound sockets.
Really attached. -- Evgeniy Polyakov