Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Mark Zealey <netdev@markandruth.co.uk>
Cc: netdev@vger.kernel.org
Subject: Re: UDP multi-core performance on a single socket and SO_REUSEPORT
Date: Fri, 04 Jan 2013 11:37:18 -0800	[thread overview]
Message-ID: <1357328238.1678.2189.camel@edumazet-glaptop> (raw)
In-Reply-To: <50E72493.4050406@markandruth.co.uk>

On Fri, 2013-01-04 at 18:50 +0000, Mark Zealey wrote:
> I have written two small test scripts now which can be found at 
> http://mark.zealey.org/uploads/ - one launches 16 listening threads for 
> a single UDP socket, the other needs to be run as
> 
> for i in `seq 16`; do ./udp_test_client & done
> 
> On my test server (32-core), stock kernel 3.7.1, 90% of the time is 
> spent in the kernel waiting on spinlocks. Perf output:

Mark

We know the scalability issue of using a single socket and many threads.

The send path was somehow fixed to not require socket lock.

But the receive path uses a single receive_queue, protected by a
spinlock.

SO_REUSEPORT would be nice, but had known issues.

af_packet fanout implementation was nicer.
You could try :

1) Use af_packet FANOUT instead of UDP sockets

2) rewrite SO_REUSEPORT to use a FANOUT like implementation

3) Extend UDP sockets to be able to use a configurable number of receive
queues instead of a single one.

  reply	other threads:[~2013-01-04 19:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 10:01 UDP multi-core performance on a single socket and SO_REUSEPORT Mark Zealey
2013-01-04 18:50 ` Mark Zealey
2013-01-04 19:37   ` Eric Dumazet [this message]
2013-01-04 20:47     ` Tom Herbert
2013-01-04 21:46       ` Mark Zealey

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=1357328238.1678.2189.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@markandruth.co.uk \
    --cc=netdev@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