All of lore.kernel.org
 help / color / mirror / Atom feed
* conntrack table limits
@ 2011-01-25 11:45 Dennis Jacobfeuerborn
  2011-01-25 13:49 ` Remzi AKYÜZ
  0 siblings, 1 reply; 3+ messages in thread
From: Dennis Jacobfeuerborn @ 2011-01-25 11:45 UTC (permalink / raw)
  To: netfilter

Hi,
I'm trying to find out how high I can set conntrack_max on a 2GB 64 bit 
system. On the net I found different ways of calculating this but they seem 
to end up with different results. One forumla tells me that I can fit a 
maximum of 65535 connections into 2GB of RAM but the other says that with 
304 bytes per connection (plus a bit of slab allocation overhead) I can 
easily fit more than a million connections into the table.
Also even with the current limit 65535 and the table having ca. 30.000 
entries I've almost 1.8GB ram free/cached which leads me to believe the 
second way of calculating this is more accurate.
What is the proper way to calculate this?

Regards,
   Dennis

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: conntrack table limits
  2011-01-25 11:45 conntrack table limits Dennis Jacobfeuerborn
@ 2011-01-25 13:49 ` Remzi AKYÜZ
  2011-01-26  2:06   ` Dennis Jacobfeuerborn
  0 siblings, 1 reply; 3+ messages in thread
From: Remzi AKYÜZ @ 2011-01-25 13:49 UTC (permalink / raw)
  To: Dennis Jacobfeuerborn; +Cc: netfilter

/etc/modules
nf_conntrack acct=1 hashsize=1048576

Hashsize calc;

HASHSIZE = CONNTRACK_MAX / 8 = RAMSIZE (in bytes) / 131072 = RAMSIZE (in MegaBytes) * 8
HASHSIZE = CONNTRACK_MAX / 8 = RAMSIZE (in bytes) / 131072 / (x / 32)
x= 32 or 64

CONNTRACK_MAX = HASHSIZE * 8


you can see this
http://antmeetspenguin.blogspot.com/2011/01/high-performance-linux-router.html
page.

On 01/25/2011 01:45 PM, Dennis Jacobfeuerborn wrote:
> Hi,
> I'm trying to find out how high I can set conntrack_max on a 2GB 64 
> bit system. On the net I found different ways of calculating this but 
> they seem to end up with different results. One forumla tells me that 
> I can fit a maximum of 65535 connections into 2GB of RAM but the other 
> says that with 304 bytes per connection (plus a bit of slab allocation 
> overhead) I can easily fit more than a million connections into the 
> table.
> Also even with the current limit 65535 and the table having ca. 30.000 
> entries I've almost 1.8GB ram free/cached which leads me to believe 
> the second way of calculating this is more accurate.
> What is the proper way to calculate this?
>
> Regards,
>   Dennis
> -- 
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: conntrack table limits
  2011-01-25 13:49 ` Remzi AKYÜZ
@ 2011-01-26  2:06   ` Dennis Jacobfeuerborn
  0 siblings, 0 replies; 3+ messages in thread
From: Dennis Jacobfeuerborn @ 2011-01-26  2:06 UTC (permalink / raw)
  To: Remzi AKYÜZ; +Cc: netfilter

On 01/25/2011 02:49 PM, Remzi AKYÃœZ wrote:
> /etc/modules
> nf_conntrack acct=1 hashsize=1048576
>
> Hashsize calc;
>
> HASHSIZE = CONNTRACK_MAX / 8 = RAMSIZE (in bytes) / 131072 = RAMSIZE (in
> MegaBytes) * 8
> HASHSIZE = CONNTRACK_MAX / 8 = RAMSIZE (in bytes) / 131072 / (x / 32)
> x= 32 or 64
>
> CONNTRACK_MAX = HASHSIZE * 8

That makes sense, thanks.

> you can see this
> http://antmeetspenguin.blogspot.com/2011/01/high-performance-linux-router.html
> page.
>
> On 01/25/2011 01:45 PM, Dennis Jacobfeuerborn wrote:
>> Hi,
>> I'm trying to find out how high I can set conntrack_max on a 2GB 64 bit
>> system. On the net I found different ways of calculating this but they
>> seem to end up with different results. One forumla tells me that I can
>> fit a maximum of 65535 connections into 2GB of RAM but the other says
>> that with 304 bytes per connection (plus a bit of slab allocation
>> overhead) I can easily fit more than a million connections into the table.
>> Also even with the current limit 65535 and the table having ca. 30.000
>> entries I've almost 1.8GB ram free/cached which leads me to believe the
>> second way of calculating this is more accurate.
>> What is the proper way to calculate this?
>>
>> Regards,
>> Dennis
>> --
>> To unsubscribe from this list: send the line "unsubscribe netfilter" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-26  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 11:45 conntrack table limits Dennis Jacobfeuerborn
2011-01-25 13:49 ` Remzi AKYÜZ
2011-01-26  2:06   ` Dennis Jacobfeuerborn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.