qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Nir Soffer <nirsof@gmail.com>
To: Eric Blake <eblake@redhat.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Daniel Berrange" <berrange@redhat.com>,
	"Richard Jones" <rjones@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v3 2/2] io: Increase unix socket buffers on Linux
Date: Thu, 1 May 2025 00:02:24 +0300	[thread overview]
Message-ID: <8F7E5FA2-FB65-467D-8AF6-606F0EFB5963@gmail.com> (raw)
In-Reply-To: <ttbupbckoby7agbxdpwrnnkigahb7w4bsujjiz3o5kefyjrkgc@a6xmrs6fcwp5>


> On 29 Apr 2025, at 0:37, Eric Blake <eblake@redhat.com> wrote:
> 
> On Sun, Apr 27, 2025 at 07:50:29PM +0300, Nir Soffer wrote:
>> Like macOS we have similar issue on Linux. For TCP socket the send
>> buffer size is 2626560 bytes (~2.5 MiB) and we get good performance.
>> However for unix socket the default and maximum buffer size is 212992
>> bytes (208 KiB) and we see poor performance when using one NBD
>> connection, up to 4 times slower than macOS on the same machine.
>> 
> 
>> +++ b/io/channel-socket.c
>> @@ -39,12 +39,13 @@
>> #define SOCKET_MAX_FDS 16
>> 
>> /*
>> - * Testing shows that 2m send buffer gives best throuput and lowest cpu usage.
>> - * Changing the receive buffer size has no effect on performance.
>> + * Testing shows that 2m send buffer is optimal. Changing the receive buffer
>> + * size has no effect on performance.
>> + * On Linux we need to increase net.core.wmem_max to make this effective.
> 
> How can we reliably inform the user of the need to tweak this setting?

Maybe log a warning (or debug message) if net.core.wmem_max is too small?

For example libkrun does this:
https://github.com/containers/libkrun/blob/main/src/devices/src/virtio/net/gvproxy.rs#L70

If we document this some users that read the docs can tune their system in a better way.

What is the best place to document this?

> Is it worth a bug report to the Linux kernel folks asking them to
> reconsider the default cap on this setting, now that modern systems
> tend to have more memory than when the cap was first introduced, and
> given that we have demonstrable numbers showing why it is beneficial,
> especially for parity with TCP?

Makes sense.

What is the best place to discuss this or file a bug?



      reply	other threads:[~2025-04-30 21:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-27 16:50 [PATCH v3 0/2] io: Increase unix stream socket buffer size Nir Soffer
2025-04-27 16:50 ` [PATCH v3 1/2] io: Increase unix socket buffers size on macOS Nir Soffer
2025-05-07 16:37   ` Daniel P. Berrangé
2025-05-07 17:17     ` Nir Soffer
2025-05-07 18:23       ` Daniel P. Berrangé
2025-04-27 16:50 ` [PATCH v3 2/2] io: Increase unix socket buffers on Linux Nir Soffer
2025-04-28 21:37   ` Eric Blake
2025-04-30 21:02     ` Nir Soffer [this message]

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=8F7E5FA2-FB65-467D-8AF6-606F0EFB5963@gmail.com \
    --to=nirsof@gmail.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rjones@redhat.com \
    /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).