i’ve always been kind of hestitant about adapting these values to the system automatically; it doesn’t only depend on the CPU, but also the expected usage.
For a “fair” work queue it would indeed make sense to pick the number of CPU cores. However, bitcoin core’s RPC threads often sleep for various reasons. Eg waiting for I/O, waiting for a lock in another thread, etc. So it’s fine to have it a bit higher than the number of cores.
i’d definitely cap the minimum at 4, even for single-core CPUs.
i’m also not sure people running bitcoin core on say, giant 64+-core systems necessarily want 64+ RPC threads. They might be running it on the background as one of many processes, not intending to do a lot of parallel processing with bitcoin core at all.
(there’s also a limited gain in having more than a certain number of threads because they’ll just end up getting in each other’s way with lock contention)