On Thu, Jun 18, 2026 at 12:14 PM vermaden <[email protected]> wrote: > > Hi. > > By default GELI uses all threads available on a system - like from nproc(1) > output. > > But this 'default' is per device. > > I just came across one of my clients servers to 'check for possible > performance improvements' and ... they had 840 GELI threads - 40 threads for > each of 21 disks. > > This happened because client left 'kern.geom.eli.threads' on a default value. > > My proposal -> Change the default GELI threads value to number of physical > cores. > > ----------------------------------------------------------------- > > So if someone has 20 physical cores with SMT - which means 40 threads - the > 20 value should be used. > > It can be made in the source code or as intermediate step - as a config > option put automatically in loader.conf(5) or sysctl.conf(5) during > installation. > > The nproc(1) is already in Base System ... or 'kern.smp.cores' can be also > used as source of information. > > Regards, > vermaden
I've got a better proposal: switch geli to use a global thread pool rather than a per-disk thread pool. The per-disk thread pool only really works well for laptops, which have but a single disk. For many-disk servers, even one thread per disk might be too much. Instead, a global thread pool sized to nproc should in theory provide superior performance. And in fact, I've already implemented this change. However, the performance impact was not what I expected. I think the change helped reads but hurt writes, or maybe it was the other way around. Sadly, my attention got diverted to other projects and I never returned to this one. But I would gladly send you my patches if you'd like to pick up where I left off. -Alan
