Hi, On Sun, Jun 16, 2019 at 09:01:01PM +0100, Edd Barrett wrote: > Hi, > > Here's an update to Syncthing. I'll be testing this over the next few > days.
This is the same diff again, just with a little more info added to the README about file descriptor limits. This came out of a discussion on the syncthing forum here: https://forum.syncthing.net/t/high-file-descriptor-usage-openbsd/13408 I think this is ready to be committed now. OK? Index: Makefile =================================================================== RCS file: /cvs/ports/net/syncthing/Makefile,v retrieving revision 1.26 diff -u -p -r1.26 Makefile --- Makefile 4 May 2019 21:46:17 -0000 1.26 +++ Makefile 27 Jun 2019 21:12:53 -0000 @@ -2,7 +2,7 @@ COMMENT = open decentralized synchronization utility -V = 1.1.1 +V = 1.1.4 DISTNAME = syncthing-${V} DISTFILES = syncthing-source-v${V}${EXTRACT_SUFX} @@ -29,9 +29,9 @@ do-build: cd ${WRKSRC} && ${MODGO_CMD} run build.go \ -version v${V} -no-upgrade -# Some tests fail, but they are bugs in the test suite itself, not Syncthing. -# We are working with upstream to fix these: -# https://forum.syncthing.net/t/openbsd-test-debugging/12799 +# A couple of test failures caused by a bug in the test suite (but not in +# Syncthing itself): +# https://github.com/syncthing/syncthing/issues/5796#issuecomment-502473144 do-test: cd ${WRKSRC} && ${MODGO_CMD} run build.go test Index: distinfo =================================================================== RCS file: /cvs/ports/net/syncthing/distinfo,v retrieving revision 1.16 diff -u -p -r1.16 distinfo --- distinfo 3 May 2019 12:58:59 -0000 1.16 +++ distinfo 27 Jun 2019 21:11:15 -0000 @@ -1,2 +1,2 @@ -SHA256 (syncthing-source-v1.1.1.tar.gz) = p5ZYPBKJR2U5S+OOjehYcFSR3GdCibtpNuaK60viNHc= -SIZE (syncthing-source-v1.1.1.tar.gz) = 6966579 +SHA256 (syncthing-source-v1.1.4.tar.gz) = 1GSIS/2S6sLy28g1x0DqfVvZ5uvQvKfNpJaCsNpOa14= +SIZE (syncthing-source-v1.1.4.tar.gz) = 9364374 Index: patches/patch-build_go =================================================================== RCS file: /cvs/ports/net/syncthing/patches/patch-build_go,v retrieving revision 1.8 diff -u -p -r1.8 patch-build_go --- patches/patch-build_go 3 May 2019 12:58:59 -0000 1.8 +++ patches/patch-build_go 27 Jun 2019 21:11:15 -0000 @@ -2,7 +2,7 @@ $OpenBSD: patch-build_go,v 1.8 2019/05/0 Index: build.go --- build.go.orig +++ build.go -@@ -188,6 +188,20 @@ var targets = map[string]target{ +@@ -189,6 +189,20 @@ var targets = map[string]target{ {src: "AUTHORS", dst: "deb/usr/share/doc/syncthing-relaypoolsrv/AUTHORS.txt", perm: 0644}, }, }, @@ -23,7 +23,7 @@ Index: build.go } // These are repos we need to clone to run "go generate" -@@ -435,7 +449,7 @@ func appendParameters(args []string, tags []string, ta +@@ -439,7 +453,7 @@ func appendParameters(args []string, tags []string, ta if !debugBinary { // Regular binaries get version tagged and skip some debug symbols Index: pkg/README =================================================================== RCS file: /cvs/ports/net/syncthing/pkg/README,v retrieving revision 1.4 diff -u -p -r1.4 README --- pkg/README 4 Sep 2018 12:46:19 -0000 1.4 +++ pkg/README 27 Jun 2019 21:43:56 -0000 @@ -51,7 +51,12 @@ File Descriptor Limits ====================== Syncthing is fairly hungry for file descriptors and the default limits may be -insufficient. If you run Syncthing via the rc.d(8) script, then you can give +insufficient. On OpenBSD, Syncthing uses kqueue(2) to "watch" files, and since +kqueue(2) doesn't support recursive watching, each file has be watched +individually. The upshot of this is that each file in a watched folder will use +one file descriptor. + +If you run Syncthing via the rc.d(8) script, then you can give Syncthing more file descriptors by adding the following to login.conf(5): syncthing:\ @@ -62,3 +67,12 @@ Syncthing more file descriptors by addin Don't forget to rebuild the login.conf.db file (if necessary): # [ -f /etc/login.conf.db ] && cap_mkdb /etc/login.conf + +Note that in addition to ulimits, there is a kernel-level file descriptor limit +which may also need to be adjusted. This limit is managed through the +kern.maxfiles sysctl(8). + +Another option is to turn off the file watcher and use only periodic scans. +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). -- Best Regards Edd Barrett http://www.theunixzoo.co.uk