From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Arturo Borrero Gonzalez <arturo@debian.org>
Cc: Netfilter Development Mailing list <netfilter-devel@vger.kernel.org>
Subject: Re: [conntrack-tools PATCH 4/4] conntrackd: introduce RequestResync option
Date: Mon, 8 May 2017 19:47:16 +0200 [thread overview]
Message-ID: <20170508174715.GA21690@salvia> (raw)
In-Reply-To: <CAOkSjBjBMjfx1VHAtH1z+4fV-hzLWp_O7DGwg4sACB+U_vGgzg@mail.gmail.com>
On Tue, May 02, 2017 at 10:18:55AM +0200, Arturo Borrero Gonzalez wrote:
> On 1 May 2017 at 11:13, Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> >>
> >> the ALARM mode requires to commit the external cache instead of the
> >> conns being directly injected into the kernel.
> >
> > You may want to disable the external cache with the alarm mode. The
> > alarm mode only needs the internal cache though, but that shouldn't be
> > much of a problem.
> >
> > With the alarm mode, you will skip spikes in CPU consumption since
> > resync is expensive. With a very large table, this results in some
> > sort of lazy busy polling.
> >
>
> I do the equivalent of this RequestResync by hand (i.e. using conntrackd -n) and
> it seems to work fine, see below.
OK.
> >> I think the new RequestResync method (or whatever other alternative)
> >> provides a good tradeoff between methods and increases general
> >> usefulness of conntrackd.
> >
> > I'm trying to help here if I can give something better ;-)
> >
> > Look, you should at least combine this new RequestResync with
> > CommitTimeout. Even if you don't explicitly request a commit command,
> > this sets the timeout for the entries that are pushed into the kernel.
> >
> > So, if you set:
> >
> > RequestResync 30
> > CommitTimeout 180
> >
> > connections we don't get any information from for 180 seconds will
> > expire.
> >
>
> It seems that CommitTimeout can't be combined with
> DisableExternalCache, see the evaluate() function.
>
> However a patch to enable this seems easy. I guess we could extend a
> bit external_inject_ct_new() to allow reading the commit_timeout
> instead of using 0 (similar to what cache_ct_commit_step() does,
> right?)
>
> I can add a new previous patch to the series to enable this.
>
> > BTW, how are you measuring this improvement? Is that you get less logs
> > error messages that you reported before or so?
> >
>
> What I detect is that after the initial startup/sync, the amount of
> conntracks in each node diverges.
> After 10 minutes, the conntracks in each node are quite different, i.e:
>
> aborrero@node1:~ $ sudo conntrack -C
> 7885
>
> aborrero@node2:~ $ sudo conntrack -C
> 17813
>
> A manual 'conntrackd -n' seems to solve the problem:
>
> aborrero@node1:~ $ sudo conntrackd -n ; sudo conntrack -C
> 18583
>
> aborrero@node2:~ $ sudo conntrackd -n ; sudo conntrack -C
> 18473
>
> I can understand that each node sees different traffic (is a
> multi-master symmetric configuration) but still,
> according to my conntrackd setup, I understand that the numbers
> shouldn't show that big divergence.
>
> Then, in this scenario, if node2 failover to node1, there are 10k
> entries missing in node1, connections that will be presumably lost and
> dropped by the stateful configuration of nftables.
>
> I currently solve this by means of scripts and cron calls which is a
> bit ugly, given how easy could be for conntrackd to resync by himself.
>
> You may ask, what kind of traffic does each node see? In my current
> setup, node1 sees all the IPv4 traffic and node2 sees all the IPv6
> traffic (or reverse). In case of failover, a sigle node can see all
> the traffic.
OK, so there is no assymmetric path at all as node1 sees IPv4 traffic
coming both in original and reply direction.
This is strange, there is probably a more fundamental bug here, I
would like that we're not papering this with a new option.
I'm going to reproduce this in my testbed and get back to you.
next prev parent reply other threads:[~2017-05-08 17:47 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-20 17:28 [conntrack-tools PATCH 1/4] conntrackd: factorice tx_queue functions Arturo Borrero Gonzalez
2017-04-20 17:28 ` [conntrack-tools PATCH 2/4] conntrackd: warn users about queue allocation errors Arturo Borrero Gonzalez
2017-04-25 11:34 ` Pablo Neira Ayuso
2017-04-25 12:40 ` Arturo Borrero Gonzalez
2017-04-25 13:16 ` Pablo Neira Ayuso
2017-05-02 8:34 ` Arturo Borrero Gonzalez
2017-05-02 10:03 ` Pablo Neira Ayuso
2017-05-02 10:09 ` Pablo Neira Ayuso
2017-04-20 17:28 ` [conntrack-tools PATCH 3/4] conntrackd: factorize resync operations Arturo Borrero Gonzalez
2017-05-08 17:52 ` Pablo Neira Ayuso
2017-04-20 17:28 ` [conntrack-tools PATCH 4/4] conntrackd: introduce RequestResync option Arturo Borrero Gonzalez
2017-04-25 11:37 ` Pablo Neira Ayuso
2017-04-25 12:46 ` Arturo Borrero Gonzalez
2017-04-25 13:18 ` Pablo Neira Ayuso
2017-04-26 11:32 ` Arturo Borrero Gonzalez
2017-05-01 9:13 ` Pablo Neira Ayuso
2017-05-02 8:18 ` Arturo Borrero Gonzalez
2017-05-08 17:47 ` Pablo Neira Ayuso [this message]
2017-05-08 17:52 ` [conntrack-tools PATCH 1/4] conntrackd: factorice tx_queue functions Pablo Neira Ayuso
-- strict thread matches above, loose matches on Subject: below --
2017-04-20 16:40 Arturo Borrero Gonzalez
2017-04-20 16:40 ` [conntrack-tools PATCH 4/4] conntrackd: introduce RequestResync option Arturo Borrero Gonzalez
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=20170508174715.GA21690@salvia \
--to=pablo@netfilter.org \
--cc=arturo@debian.org \
--cc=netfilter-devel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).