All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jean-Michel Hemstedt" <jean-michel.hemstedt@alcatel.be>
To: "Jozsef Kadlecsik" <kadlec@blackhole.kfki.hu>
Cc: "Harald Welte" <laforge@gnumonks.org>, <netfilter-devel@lists.samba.org>
Subject: Re: performance issues (nat / conntrack)
Date: Tue, 25 Jun 2002 15:21:56 +0200	[thread overview]
Message-ID: <021a01c21c4b$47b2f2b0$0489cb8a@etbx180> (raw)
In-Reply-To: Pine.LNX.4.33.0206251238390.4927-100000@blackhole.kfki.hu

> > loading a module, doesn't mean using it (lsmod reports it as 'unused'
> > in my tests). So, does it really 'sounds as expected', when you see
> 
> From where do you think that the module usage counter reports how many
> packets/connections are handled (currently? totally?) by the module.
> There is no whatsoever connection!

module usage counter increases when a TARGET needs it (i.e. ipt_REDIRECT).
In this test, no rule was defined, and no target module was loaded.
So I did not expect NAT to process any packet.

> 
> > > > o The cumulative effect should be reconsidered.
> >
> > - I can't explain the last one, but when the table is exhausted
> >   conntrack drops new packets, right? What I noticed is that at that
> >   moment, the cpu load suddenly hit 100%, and the machine did not
> >   recover, unless I killed the load generator
> 
> That is unusual and should be tested further.

I suppose that due to the load, packets are dropped not because of conntrack
but because they simply can't be processed, and thus conntrack misses packets
of existing connections (such as FIN, RST) and can't thus recover due to its 
timeouts.

> 
> > > ? What 'nat table' are  you talking about?  Do you understand how NAT
> > > works and how it interacts with connection tracking?
> >
> > Just to recall my test: I generated an amount of new connections
> > per second passing through a forwarding machine without any iptables
> > module and measured the cpu load/responsiveness and other things...
> > Then while the machine was sustaining this amount of new conn/s, i did
> > 'insmod ip_conntrack [size]', saw the cpu load increasing, and finally
> > just did 'iptables -t nat -L' to load the nat module without any rule,
> > and saw again the cpu load increasing. With 500conn/s, the cpu load went
> > from 10% -> ~50/70% -> 100% (machine unavailable).
> 
> According to your first mail, the machine has 256M RAM and you issued
> 
> insmod ip_conntrack 16384
> 
> That requires 16384*8*~600byte ~= 75MB non-swappable RAM.
> 
> When you issued "iptables -t nat -L", the system tried to reserve plus
> 2x75MB. That's in total pretty near to all your available physical RAM
> and the machine might died in swapping.
> 

exact! 
That's why I looked (but not closely) at swap-in/swap-out in procinfo, 
but didn't notice anything (0 most of the time on 10 sec average). 
But I agree that I was close to the limit, and even over when I tried 32K.
Despite that, nothing so surpising to have so few swaps, since my table
was not full (max 4000 up to 10000 concurrent tuples).

But this raises one additional problem: 
1) the hash index size and the hash total size should be configurable 
separately (get rid of that factor 8, and use a free list for the tuple 
allocation).
2) NAT hash sizes should also be configurable independently from conntrack.
Normally the nat hashes are smaller than conntrack hash, since conntrack
is based on ports, while nat is not.

PS: could anybody redo similar tests so that we can compare the results
    and stop killing the messenger, please? ;o)


> Regards,
> Jozsef
> -
> E-mail  : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu
> WWW-Home: http://www.kfki.hu/~kadlec
> Address : KFKI Research Institute for Particle and Nuclear Physics
>           H-1525 Budapest 114, POB. 49, Hungary
> 
> 
> 
> 

  parent reply	other threads:[~2002-06-25 13:21 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-20 19:48 performance issues (nat / conntrack) Jean-Michel Hemstedt
2002-06-22 16:51 ` Harald Welte
2002-06-23  9:15   ` Jean-Michel Hemstedt
2002-06-25 11:33     ` Jozsef Kadlecsik
2002-06-25 12:47       ` Harald Welte
2002-06-25 14:23         ` Jozsef Kadlecsik
     [not found]         ` <025001c21c50$763fa880$0489cb8a@etbx180>
2002-06-25 16:07           ` Harald Welte
2002-06-25 21:08         ` Jozsef Kadlecsik
2002-06-25 13:21       ` Jean-Michel Hemstedt [this message]
2002-06-25 13:51         ` Harald Welte
2002-06-25 14:33           ` Jozsef Kadlecsik
2002-06-25 14:51           ` Jean-Michel Hemstedt
2002-06-25 16:11             ` Harald Welte
2002-06-25 13:52         ` Patrick Schaaf
2002-06-25 14:53         ` Jozsef Kadlecsik
2002-06-25 15:22           ` Balazs Scheidler
2002-06-25 10:35 ` Jozsef Kadlecsik
2002-06-25 12:42   ` Jean-Michel Hemstedt
2002-06-25 13:50     ` Patrick Schaaf
2002-06-25 19:03       ` Harald Welte
2002-06-25 13:56     ` Alex Bennee
2002-06-25 14:17     ` Jozsef Kadlecsik
2002-06-25 15:13       ` Balazs Scheidler
2002-06-25 19:06         ` Harald Welte
2002-06-26  8:18           ` Balazs Scheidler
2002-06-27  2:21       ` Andrew Smith
2002-06-27 11:24         ` Harald Welte
2002-06-29  5:25           ` Andrew Smith
2002-06-25 19:01     ` Harald Welte
2002-06-25 20:53       ` conntrack DoS Henrik Nordstrom
2002-06-25 21:47         ` Jozsef Kadlecsik
2002-06-25 22:42           ` Henrik Nordstrom
2002-06-27  8:26             ` Jozsef Kadlecsik
     [not found] <20020621132640.2C326472B@lists.samba.org>
2002-06-21 17:35 ` performance issues (nat / conntrack) Don Cohen
2002-06-21 18:26   ` Jean-Michel Hemstedt
2002-06-23  9:14   ` Jean-Michel Hemstedt
2002-06-25 10:38     ` Jozsef Kadlecsik
2002-06-25 11:11       ` Jean-Michel Hemstedt
2002-06-25 11:48         ` Jozsef Kadlecsik
     [not found] <20020623132739.12D52455E@lists.samba.org>
2002-06-24  4:46 ` Don Cohen
2002-06-24  6:06   ` Patrick Schaaf
     [not found]     ` <15638.48245.84830.480715@isis.cs3-inc.com>
2002-06-24  6:48       ` Patrick Schaaf
2002-06-24  6:54         ` Don Cohen
2002-06-24  7:13           ` Patrick Schaaf
2002-06-24 15:18             ` Don Cohen
2002-06-25  2:44               ` Harald Welte
     [not found] <20020625151007.980D14140@lists.samba.org>
2002-06-25 17:00 ` Don Cohen
2002-06-25 21:47   ` Jean-Michel Hemstedt
2002-06-26 14:50     ` Harald Welte
2002-06-26 18:04       ` Jean-Michel Hemstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='021a01c21c4b$47b2f2b0$0489cb8a@etbx180' \
    --to=jean-michel.hemstedt@alcatel.be \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=laforge@gnumonks.org \
    --cc=netfilter-devel@lists.samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.