commit 361fdaa

Alvar Penning  ·  2026-02-17 22:03:23 +0000 UTC
parent c29d691
OpenBSD: Document login class w/ extended openfiles

A file heavy applications makes heavy use of files. Shocking news.

OpenBSD's daemon login class limits the amount of openfiles quite
strict. This restriction is an annoyance for lots of applications, and,
unless I am mistaken, seems to be an issue for snac as well.

Thus, after hopefully fixing this on my instance, I tried to briefly
document this in snac(8) and provide a minimal login.conf(5) example.
2 files changed,  +42, -0
+35, -0
 1@@ -704,6 +704,41 @@ out there. If you want your language file to be included in the standard
 2 .Nm
 3 distribution, please send me a link to it via the Fediverse to @grunfink@comam.es
 4 or make a PR via the Git repository.
 5+.Ss Number of open files on OpenBSD and login classes
 6+Being a file intensive application, even a small
 7+.Nm
 8+instance might open lots of files, especially when forwarding a new post to
 9+other instances.
10+.Pp
11+OpenBSD's daemon login class comes with a very low
12+.Pa openfiles
13+value, usually restricting the amount of open files to 128 (cur), 1024 (max).
14+This can result in
15+.Nm
16+to stop working due to too many open files.
17+.Pp
18+To continue operation, a new
19+.Pa snac
20+login class can be created. Please consult
21+.Xr login.conf 5
22+and afterwards create a new login class as follows.
23+.Bd -literal -offset indent
24+snac:\\
25+    :openfiles=4096:\\
26+    :tc=daemon:
27+.Ed
28+.Pp
29+After rebuilding the
30+.Pa /etc/login.conf.db ,
31+ensure that your snac user's login class is set to
32+.Pa snac :
33+.Bd -literal -offset indent
34+# cap_mkdb /etc/login.conf
35+# usermod -L snac SNACUSER
36+.Ed
37+.Pp
38+One restart later, the daemon should run with increased
39+.Pa openfiles .
40 .Sh ENVIRONMENT
41 .Bl -tag -width Ds
42 .It Ev DEBUG
+7, -0
1@@ -0,0 +1,7 @@
2+# OpenBSD login.conf(5) entry to increase the openfiles for the snac login
3+# class. Further documented under "Number of open files on OpenBSD and login
4+# classes" in snac(8).
5+
6+snac:\
7+	:openfiles=4096:\
8+	:tc=daemon: