Index | Thread | Search

From:
Stuart Henderson <stu@spacehopper.org>
Subject:
Re: net/syncthing: failed to increase receive buffer size (quic-go)
To:
Douglas Silva <doug.hs@proton.me>
Cc:
Edd Barrett <edd@theunixzoo.co.uk>, "ports@openbsd.org" <ports@openbsd.org>, "edd@openbsd.org" <edd@openbsd.org>, Klemens Nanni <kn@openbsd.org>
Date:
Tue, 17 Feb 2026 11:55:38 +0000

Download raw body.

Thread
On 2026/02/16 17:57, Douglas Silva wrote:
> The quic-go maintainer said that 2 MB is not enough. [1]
> 
> Is there any chance we can change the OpenBSD kernel to allow larger buffer sizes?
> Otherwise, I think I'll replace those instructions with a note explaining that
> QUIC will not work.

No, he says "not sufficient for certain network conditions" (which
is not the same as "will not work"). But this is only talking about
the receive buffer and I think he may be mistaken (unless the code is
really slow? afaik this is buffering received data in the kernel if the
userland process is slow to read it)

If he was talking about send buffer that might make more sense, but we
don't have a send buffer for UDP the way Linux has.


> 
> [1] https://github.com/quic-go/quic-go/issues/3476#issuecomment-3831234358
> 
> 
> 
> 
> On Sunday, February 1st, 2026 at 12:23, Douglas Silva <doug.hs@proton.me> wrote:
> 
> > Hi, I've applied the suggested changes. Diff's below.
> > 
> > > can the linux code be ported across? (we don't have
> > > SO_RCVBUFFORCE which ignore the max limit, but
> > > SO_RCVBUF will at least allow up to 2MB). if so,
> > > doing that (and changing the amount it's trying to
> > > raise to cap it to 2MB on OpenBSD, or at least
> > > retry capped to 2MB if it fails) is a better
> > > approach than telling the user to unilaterally
> > > raise the socket buffer for all programs via sysctl.
> > 
> > I've also sent that suggestion to quic-go. I wish I
> > could make a PR, but I don't feel confident with Go.
> > 
> > [1] https://github.com/quic-go/quic-go/issues/3476#issuecomment-3831146698
> > 
> > 
> > Index: pkg/README
> > ===================================================================
> > RCS file: /cvs/ports/net/syncthing/pkg/README,v
> > diff -u -p -u -p -r1.9 README
> > --- pkg/README	1 Jan 2026 22:24:37 -0000	1.9
> > +++ pkg/README	1 Feb 2026 15:13:22 -0000
> > @@ -22,8 +22,8 @@ Starting via RC script
> >  Syncthing can be started via the included RC script, thus running
> >  Syncthing as a system service. This is fine for single user
> >  configurations. Under this mode of operation, Syncthing runs as the
> > -_syncthing user, and the default location for folders is
> > -${LOCALSTATEDIR}/syncthing.
> > +_syncthing user (or whatever `syncthing_user` is set to in RC), and
> > +the default location for folders is ${LOCALSTATEDIR}/syncthing.
> > 
> >  Starting Manually
> >  -----------------
> > @@ -45,6 +45,17 @@ This will result in a new tmux(1) sessio
> >  boot. The user can later use `tmux attach` to view and control their
> >  Syncthing process.
> > 
> > +Logging
> > +=======
> > +
> > +By default, logs are not saved anywhere; but you can read the logs
> > +for the current session on the web GUI.
> > +
> > +To log to a file, set these flags:
> > +
> > +	# rcctl set syncthing flags --log-file /var/log/syncthing/syncthing.log \
> > +		--log-max-old-files 5 --log-max-size 2000000
> > +
> >  File Descriptor Limits
> >  ======================
> > 
> > @@ -87,3 +98,22 @@ Another option is to turn off the file w
> >  This will result in much reduced file descriptor usage at the cost of a
> >  (configurable) latency. See "watch for changes" and "full rescan interval" in
> >  the "advanced" tab in a folder's settings (on the web UI).
> > +
> > +UDP Buffer Size
> > +===============
> > +
> > +Syncthing uses quic-go for QUIC transport. On other platforms, it is
> > +able to increase the UDP buffer size automatically on startup; but it does
> > +not have an implementation for OpenBSD, so you get this warning instead:
> > +
> > +	2026-01-24 12:33:01 INF failed to increase receive buffer size
> > +	(wanted: 7168 kiB, got 0 kiB). See
> > +	https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
> > +
> > +This can be manually raised system-wide by setting a sysctl. Note that the
> > +maximum size is 2097152 (~2 MB), which is well below what quic-go expects.
> > +Hopefully it should be enough for it to minimally function.
> > +
> > +       # sysctl net.inet.udp.recvspace=2097152
> > +
> > +This can be set at boot in sysctl.conf(5).
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Monday, January 26th, 2026 at 12:34, Stuart Henderson <stu@spacehopper.org> wrote:
> > 
> > >
> > >
> > >
> > >
> > > On 2026/01/26 13:24, Douglas Silva wrote:
> > >
> > > > +By default, logs are not saved anywhere; but you can read the logs
> > > > +for the current session on the web GUI.
> > > > +
> > > > +To log to a file, use `syncthing_flags`. Example:
> > > > +
> > > > + syncthing_flags="--log-file /var/log/syncthing/syncthing.log --log-max-old-files 5 --log-max-size 2000000"
> > >
> > >
> > > the recommended interface is 'rcctl set' for this, also wrap the line
> > > e.g.
> > >
> > > rcctl set syncthing flags --log-file /var/log/syncthing/syncthing.log \
> > > --log-max-old-files 5 --log-max-size 2000000
> > >
> > > > +UDP Buffer Size
> > > > +===============
> > >
> > >
> > > can the linux code be ported across? (we don't have SO_RCVBUFFORCE which
> > > ignore the max limit, but SO_RCVBUF will at least allow up to 2MB).
> > > if so, doing that (and changing the amount it's trying to raise to
> > > cap it to 2MB on OpenBSD, or at least retry capped to 2MB if it fails)
> > > is a better approach than telling the user to unilaterally raise the
> > > socket buffer for all programs via sysctl.
> > >
> > > there's certainly no point warning above 2MB, the OS won't accept it,
> > > so there's nothing the user can do.
> > >
> > > if the code can't be changed, ...
> > >
> > > > +quic-go requests about 8 MB of UDP buffer space. On some platforms, it is able to increase the limit automatically on startup. On OpenBSD this fails with the following warning:
> > > > +
> > > > + 2026-01-24 12:33:01 INF failed to increase receive buffer size (wanted: 7168 kiB, got 0 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
> > > > +
> > > > +We can manually increase it by changing `net.inet.udp.recvspace`. Unfortunately, this limit can only be raised to a maximum of 2097152 (approx. 2 MB). For context, see the discussion at https://github.com/quic-go/quic-go/issues/3476.
> > > > +
> > > > + # sysctl net.inet.udp.recvspace=2097152
> > > > +
> > > > +Add that to sysctl.conf(5) to permanently set it.
> > >
> > >
> > > text needs word-wrapping.
> > >
> > > it doesn't attempt to change the limit at all on OpenBSD, there is
> > > simply no code for it, so saying that it has "failed" doesn't quite
> > > sit right...
> > >
> > > ---
> > > syncthing uses quic-go for QUIC transport. This wants to increase UDP
> > > socket buffers, however it does not has an OpenBSD implementation to
> > > actually do this, and otherwise logs a warning, e.g.:
> > >
> > > INF failed to increase receive buffer size (wanted: 7168 kiB, got 0 kiB).
> > > See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
> > >
> > > This can be manually raised for the entire system by setting a sysctl.
> > > The maximum available is 2097152 (2MB).
> > >
> > > # sysctl net.inet.udp.recvspace=2097152
> > >
> > > This can be set at boot in sysctl.conf(5).
> > > ---
> > >
> > >
> > > > On Sunday, January 25th, 2026 at 13:00, Douglas Silva doug.hs@proton.me wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > When you start Syncthing, one of the first log entries is this warning:
> > > > >
> > > > > 2026-01-24 12:33:01 INF failed to increase receive buffer size (wanted: 7168 kiB, got 0 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
> > > > >
> > > > > The linked wiki page explains that quic-go tries to automatically increase the buffer size on some platforms (not BSDs), and it has instructions for manually doing it on others; but the section on BSDs doesn't apply to OpenBSD. There is an open issue [1] about it.
> > > > >
> > > > > Someone there has figured out that the sysctl variable to change here is "net.inet.udp.recvspace", but it can only be increased to about 2 MB (2097152) — well below the target 7.5 MB (8441037). I have no idea whether quic-go is able to work properly with this. Either way, the warning persists.
> > > > >
> > > > > So, my idea is to:
> > > > >
> > > > > 1. Modify our package README with instructions to increase the buffer size to maximum.
> > > > > 2. Silence the warning by setting the variable "QUIC_GO_DISABLE_RECEIVE_BUFFER_WARNING" [2] [3]
> > > > >
> > > > > What do you think?
> > > > >
> > > > > [1] https://github.com/quic-go/quic-go/issues/3476
> > > > > [2] https://github.com/quic-go/quic-go/blob/4a8af22606c2d237da39212a734b80026a9a0bb0/sys_conn.go#L59
> > > > > [3] https://github.com/quic-go/quic-go/issues/3801#issuecomment-1882365505
> > >
> > >
> > > On 2026/01/26 14:25, Edd Barrett wrote:
> > >
> > > > Hi,
> > > >
> > > > On Mon, Jan 26, 2026 at 01:24:45PM +0000, Douglas Silva wrote:
> > > >
> > > > > Below are my proposed additions to the README file, assuming we don't want to silence the warning.
> > > > >
> > > > > I've added a short section on logging too.
> > > >
> > > > Looks good, but please wrap long lines at column 80 (as mentioned in
> > > > README.template).
> > > >
> > > > Also, from memory QUIC is optional, and syncthing will work without it. Is it
> > > > worth mentioning this?
> > > >
> > > > --
> > > > Best Regards
> > > > Edd Barrett
> > > >
> > > > https://www.theunixzoo.co.uk
>