LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: how to change the default size of hash table?

To: He Weitao <hewt@xxxxxxxxxx>
Subject: Re: how to change the default size of hash table?
Cc: Wensong Zhang <wensong@xxxxxxxxxxxx>, Ratz <ratz@xxxxxx>, lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 31 Mar 2000 08:07:25 +0300 (EEST)
        Hello,

On Fri, 31 Mar 2000, He Weitao wrote:

> >
> > >
> > > can I  make such a conclusion?
> > > If there is enough mem, then the parameter can be set to more than 2^20?
> > >
> >
> > Yup.
> >
> > BTW, 2^20 is not a small number, it is one million. What your application
> > is? it needs that big table. ;-)
> >
> > Thanks,
> >
> > Wensong
> >
> 
> I would like to make such a calculation:
>     there are 1000 people online, everyone open 5 connections in hash table,
> and every connection last for 360s(the default ppc time), then the size is:
> 1000x5x360=1,800,000.
> that means only 1000 people can be online at the same time if it is 2^20?
>     Is that right? I wish I am wrong. ;-)

        With CONFIG_IP_MASQUERADE_VS_TAB_BITS we specify not the max
number of the entries (connections in your case) but the number of the
rows in a hash table. This table has columns which are unlimited. You can
set your table to 256 rows and to have 1,800,000 connections in
7000 columns average. But the lookup is slower. The lookup function
chooses one row using hash function and starts to search all these
7000 entries for match. So, by increasing the number of rows we want
to speedup the lookup. There is _no_ connection limit. It depends on the
free memory. Try to tune the number of rows in this way that the
columns will not exceed 16 (average), for example. It is not fatal if
the columns are more (average) but if your CPU is fast enough this is not
a problem.


Regards

--
Julian Anastasov <uli@xxxxxxxxxxxxxxxxxxxxxx>

<Prev in Thread] Current Thread [Next in Thread>