Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Peteris Krumins <newsgroups@lf.lv>
To: Chris Wilson <chris@netservers.co.uk>
Cc: Netfilter <netfilter@lists.netfilter.org>
Subject: Re[2]: Interesting problems
Date: Tue, 5 Aug 2003 22:54:28 +0300	[thread overview]
Message-ID: <16160478015.20030805225428@lf.lv> (raw)
In-Reply-To: <Pine.LNX.4.44.0308051025320.21531-100000@localhost>

Tuesday, August 5, 2003, 12:38:13 PM, Chris Wilson wrote:

CW> Hi Peteris,

>>   - there is a computer PII 266, now with 192mb ram, it's running
[...]
>>     `wc -l /proc/net/ip_conntrack' shows around 20000 entries.
>>     A reboot helps.

CW> This does not surprise me at all. You have a very old computer handling an 
CW> enormous amount of traffic and you complain that it's slow? =)

266 isnt that slow, that's only connection tracking, is it (too slow)?

CW> For reference, we have a 350MHz Cyrix machine handling iptables with
CW> stateful inspection for a medium-loaded 2Mb line with maybe 50 users/boxes
CW> behind it, and it has about 3000 connections right now and a load of 0.04.  
CW> 50% of CPU time is used by the System, indicating netfilter.  Perhaps your
CW> users are very busy?

Simple internet users, some are lazy and just downloading stuff from
different edonkies and emules. Some just use net for google.

Most of the entries taking up conntrack table are:
tcp 6 419547 ESTABLISHED src=X dst=Y sport=A dport=B [UNREPLIED] src=Y
dst=X sport=B dport=A use=1 mark=0

They would expire only after 419547 secs that is 4 days, but during those 4
days the table grows 5 times that much entries..

Is there some trick to kill UNREPLIED tcp conntrack entires if there
is no reply after NN seconds.
Also could it be done in software w/o much trouble? Monitoring
conntrack table and removing dead entries like these.
If it's not much trouble i can instruct our programmers instantly to
work on such tool.

CW> When `wc -l /proc/net/ip_conntrack' shows around 20000 entries, and you 
CW> have set the max to 20000, then no more connections can be added and the 
CW> kernel prints the warning you saw.

Yes, i know.

>>     The question is what could i do to avoid the growthy of connection
>>     tracking entries? I guess the entries taking up space are already
>>     established tcp connections which were not properly terminated, so
>>     they are there to timeout.

CW> Terminate some of your users, or tell them not to use the Internet so 
CW> much!

:)

CW> But a better solution would be to get a real powerful box or not use
CW> stateful inspection (or maybe run nf-hipac or BSD's ipf instead of 
CW> iptables, as apparently both are faster).

Stateful inspection is needed to allow only outbound connections. and
inbound only ESTABLISHED,RELATED.

Unfortunately the software using iptables and Linux is being programmed
for half a year. 3 months left to finish the product. Can't change the
platform.

I can instruct our programmers (I am the team leader) to do some work
on iptables connection tracking code and after improvments i could
send it as a patch for current iptables. So connection tracking would
be as efficient as possible. I just need someone to tell me exactly
what is inefficient in conntrack code.


P.Krumins



  parent reply	other threads:[~2003-08-05 19:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 20:41 Interesting problems Peteris Krumins
2003-08-05  9:38 ` Chris Wilson
2003-08-05 10:34   ` tsh
2003-08-05 11:00     ` Chris Wilson
2003-08-05 19:54   ` Peteris Krumins [this message]
2003-08-06 10:03     ` Re[2]: " Chris Wilson
  -- strict thread matches above, loose matches on Subject: below --
2003-08-05 20:09 Daniel Chemko

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=16160478015.20030805225428@lf.lv \
    --to=newsgroups@lf.lv \
    --cc=chris@netservers.co.uk \
    --cc=netfilter@lists.netfilter.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox