Advice on KeyDB configuration for 96core instance with 2TB RAM

We are planning to use KeyDB for our application backend. We have huge use case to store around 50-60 million keys. We will be having 2 physical instances each with 96 CPU cores and around 1.5TB RAM.
Can I know what will be the max number of threads that I can configure to get the best use of these resources. Would be setting up active-active replication so that the resources of both the machines can be leveraged.

Hi @fferozbasha,

We typically find performance gains up to 8 threads assigned to KeyDB (server-threads). On smaller machines, the user will often see large performance gains up to 4 threads with smaller performance gains as more are added pending other workloads on the machine. Because you will have an excess of cores, you would likely see gains up to 8 threads for normal workloads. If you are using TLS encryption we see performance gains up to 16 threads assigned. This is in reference to a single database node.

You can consider using the server-thread-affinity option as well to pin threads which you may see additional performance gains with.

From your description it sounds like you are trying to maintain a large singular replicated dataset. The other option is running a sharded dataset spread over multiple nodes. We typically do not see much improvement running multiple shards on the same server, but if you split up your server this is a possibility which could also allow you to scale horizontally to other machines as well.

@benschermel thanks much for your response. There will not be any other application running on these instances. So, all the 96 vCPU’s will be dedicated for the KeyDB instance. Can we go more than 8 threads considering the number of vCPU’s?
We are intending to have 2 such servers both running in active-active replication. Eager to know the max server-threads that we can go for and is there any benchmarking for the same?