From: Feizhou <feizhou@linuxmail.org>
To: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: David Cannings <lists@edeca.net>, netfilter@lists.netfilter.org
Subject: Re: Is this firewall good enough?
Date: Wed, 09 Jun 2004 21:18:19 +0800 [thread overview]
Message-ID: <40C70E1B.4010001@linuxmail.org> (raw)
In-Reply-To: <Pine.LNX.4.33.0406091242570.6047-100000@blackhole.kfki.hu>
Jozsef Kadlecsik wrote:
> On Wed, 9 Jun 2004, Feizhou wrote:
>
>
>>>>>Is there any good reason not to load connection tracking?
>>>>
>>>>SLOW. It isn't good enough to use on a high traffic server.
>>>
>>>Could you back your claims up with data?
>>
>>What kind of data?
>>
>>I can tell you what I observed.
>>
>>I have two dnscaches running dnscache. Single PIII 800 cpus with 512MB
>>of RAM.
>>
>>One box had the command iptables -t nat -L -n run and that caused
>>ipt_conntrack to be loaded.
>>
>>Instantly queries to that box took over 200ms to return (cached entries)
>>and sometimes timeouts even occured while the other box happily kept
>>return times to under 20ms for cached entries.
>>
>>These are with a RH 2.4.20-20 with XFS patches applied.
>
>
> That *is* data. Make sure there is enough ram in the machines
> for doing both connection tracking and DNS cacheing: conntrack uses
> non-swappable memory.
Ah, that explains why the dnscache on the box what had conntrack loaded
could not use as much memory as the other box. Time to increase the size
of the cache >=)
>
> But I think your case is a special one, where you stress-test connection
> tracking without any benefit. DNS queries are just queries. Request and
> response typically fit into one (UDP) packet, so at the first packet
> conntrack fires up, allocates memory, makes all its book-keeping
> duties, etc, and at the second (response) packet it kicks the connection
> into assured/replied state. Then the entry times out - there'll be no
> other packets belonging to the DNS query.
>
> If there is enough memory, then you have two choices:
>
> - Not to use connection tracking at all. conntrack is not (and I think
> cannot be) optimized for this case.
For a dnscache only box? Definitely not.
> - Use raw table and NOTRACK to skip conntrack for the (UDP) DNS queries
> and still benefit from conntrack for all other connections.
Sorry, but what do you mean by raw table and is NOTRACK a pom patch/module?
>
>
>>>At testing connection tracking we could pump trough two million concurrent
>>>connection at 200000pps rate with opening up 20000 new connection per
>>>second on a dual Xeon PC with Serverworks chipset and Intel copper GE
>>>cards. Best results were achieved by Linux kernel 2.6.x with conntrack
>>>locking and TCP window tracking patches applied and NAPI enabled.
>>>I'd say that's not bad at all.
>>
>>Which tcp window tracking patches?
>
>
> That is the TCP window tracking patch from pom-ng (which play no role at
> all for your UDP DNS queries), but the locking patch improves the
> performance of conntrack.
Hmm, I tried the connlimit patch (which uses conntrack to do its stuff)
on a mail gateway but found it wanting then. Will this help there?
>
>
>>On my mail gateways, I had 2.6.4 with e100 driver and NAPI enabled and
>>that proved to be a disaster. I had to turn NAPI off and also muck
>>around:
>>
>>net.ipv4.tcp_max_syn_backlog = 2048
>>net.ipv4.route.gc_thresh = 65536
>>
>>to keep the box accessible. Otherwise, the kernel would spew dst cache
>>overflow/BUGTRAP errors or oops or even garbage.
>
>
> For high performance servers one does have to tune the kernel. We used the
> e1000 driver with NAPI and there were no problems at all.
Do you get a very high packet rate? Apparently, the problem only shows
up in boxes having to deal with very high packet rates and I had it
without NAPI enabled. NAPI just make it worse/happen more quickly. I can
but guess that you might be using larger payloads other than 1500 with
your Gigabit link.
next prev parent reply other threads:[~2004-06-09 13:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-08 9:14 Is this firewall good enough? Sagara Wijetunga
2004-06-08 9:42 ` Feizhou
2004-06-08 9:57 ` Antony Stone
2004-06-08 15:03 ` Feizhou
2004-06-08 15:23 ` Antony Stone
2004-06-08 20:11 ` Feizhou
2004-06-09 9:48 ` Antony Stone
2004-06-09 10:03 ` Feizhou
2004-06-08 16:17 ` David Cannings
2004-06-08 20:14 ` Feizhou
2004-06-09 9:28 ` Jozsef Kadlecsik
2004-06-09 9:57 ` Feizhou
2004-06-09 11:05 ` Jozsef Kadlecsik
2004-06-09 13:18 ` Feizhou [this message]
2004-06-09 13:23 ` Feizhou
2004-06-09 8:36 ` Sagara Wijetunga
2004-06-08 9:44 ` Rob Sterenborg
2004-06-09 8:14 ` Sagara Wijetunga
2004-06-09 9:56 ` Rob Sterenborg
2004-06-09 15:12 ` Aleksandar Milivojevic
2004-06-09 15:15 ` Aleksandar Milivojevic
2004-06-11 14:24 ` Sagara Wijetunga
2004-06-08 9:55 ` Antony Stone
2004-06-08 12:38 ` Chris Brenton
2004-06-09 7:32 ` Sagara Wijetunga
2004-06-09 13:47 ` Chris Brenton
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=40C70E1B.4010001@linuxmail.org \
--to=feizhou@linuxmail.org \
--cc=kadlec@blackhole.kfki.hu \
--cc=lists@edeca.net \
--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 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.