All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Ryan Johnston <ryan@mediapixel.co.nz>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: netlink multi-thread / libmnl / nfq
Date: Tue, 2 Jun 2015 23:22:41 +0200	[thread overview]
Message-ID: <20150602212241.GB11015@breakpoint.cc> (raw)
In-Reply-To: <CAJ0j+bpNqDJZTcbU-4wHcmNT8=28U3jJ5ftu-OpbpfZJjAjBxg@mail.gmail.com>

Ryan Johnston <ryan@mediapixel.co.nz> wrote:
> When creating a multi-threaded NFQ/Netlink application, should I have
> multiple threads with fd sockets connected to the kernel, or do I have
> one socket with multiple thread loops to read the socket?

Its up to you.

> If I am to have many threaded fd sockets connected to kernel's
> netlink, is there any performance loss by having too many?

For best performance use multiple queues, e.g. manually via iptables
-m cpu ...  -j NFQUEUE, or via iptables .. NFQUEUE --queue-balance 0:x,
then run one process or thread for each queue.

One thread per queue model is implemented in suricata ids for example.

  reply	other threads:[~2015-06-02 21:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 21:17 netlink multi-thread / libmnl / nfq Ryan Johnston
2015-06-02 21:22 ` Florian Westphal [this message]
2015-06-02 21:55   ` Ryan Johnston
2015-06-02 22:23     ` Florian Westphal
2015-06-02 22:25       ` Ryan Johnston

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=20150602212241.GB11015@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=ryan@mediapixel.co.nz \
    /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.