From: "John A. Sullivan III" <jsullivan@opensourcedevel.com>
To: "Július Bemš" <julius.bems@gmail.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: adding rules - slow
Date: Fri, 27 Jul 2007 17:38:04 -0400 [thread overview]
Message-ID: <1185572284.10031.2.camel@localhost> (raw)
In-Reply-To: <46aa63fb.120b420a.16f8.0c23@mx.google.com>
On Fri, 2007-07-27 at 23:30 +0200, Július Bemš wrote:
> Hi,
>
> When I need to add som rules (in my case 100) to some chain it takes various
> time, depending on the number of existing rules in the chain. So when I add
> 100 rules to empty chain, it takes 1.8sec. If tehere is 1000 rules int the
> chain, it takes 4.5sec and if there is 10000 rules it takes 21sec.
>
> My problem is, that i need to add this rules to chain which contains 20000
> rules in short time. I think, that the way of adding rules into chain is
> very innefective.
>
> Could someone tell me how the adding works internally? What data structures
> are used? Because I need solve this and find the way how to add new rules
> quickly.
>
> Thanks for replies
>
>
We face the same problem on the ISCS project
(http://iscs.sourceforge.net). There, do to micro-perimeter network
security, we frequently generate thousands or tens of thousands of rules
with the click of a mouse.
We handle it by adding rules via iptables-restore rather than iptables.
The load time difference is remarkable. You write your rules into files
with very similar syntax to iptables and then direct them into
iptables-restore, e.g.,
iptables-restore < /etc/PEP/rules.txt
or, if you do not want to overwrite existing rules,
iptables-restore -n < /etc/PEP/runtimerules.txt
Hope this helps - John
--
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan@opensourcedevel.com
Financially sustainable open source development
http://www.opensourcedevel.com
next prev parent reply other threads:[~2007-07-27 21:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-27 21:30 adding rules - slow Július Bemš
2007-07-27 21:38 ` John A. Sullivan III [this message]
2007-07-27 22:31 ` Tom Eastep
2007-08-01 7:24 ` Július Bemš
2007-08-01 7:29 ` Eric Leblond
2007-08-01 7:40 ` Покотиленко Костик
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=1185572284.10031.2.camel@localhost \
--to=jsullivan@opensourcedevel.com \
--cc=julius.bems@gmail.com \
--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.