On Thu, 2008-06-05 at 17:53 +0530, hirantha wrote:
> So now I know the requirement. I expect 300 connections per second and each
> connection keep for 200
> seconds. So my value on the connection hash table should be 16 (2^16=65536)
No. After 200 seconds you will have (300 * 200) = 60000 connections in
the table. This does not mean you need the hash table to be 16 bits!
You'll find long discussions about sizing the hash table in the HOWTO,
but it can be summed up roughly as follows:
The size of the table is the number of *rows* in the table. The rows
have an unlimited (theoretically) number of columns available. The
larger the number of rows, the slower the lookup.
This means lookup performance can be increased by increasing the number
of rows available in the hash, but the tradeoff is that it then takes up
more memory when idle. With the speed of today's processors I'd suggest
that you try working with the default 2^12, 4096 and see what happens.
To answer your other question, you need to recompile the kernel
(actually just the ip_vs module) to make a change to the hash table
size, and then unload and reload the module to apply it. For most people
this necessitates a complete kernel recompile followed by a reboot but
there are more graceful ways to achieve it!