what is the recommended number of read
# spicedb
m
what is the recommended number of read connection pool that should be defined in spicedb for connecting to a cockroachdb backingstore runing a 5 node cluster with 8 cores per node
e
the general recommendation from the cockroach folks is 4 connections per core so you're looking for 160 connections to divide between the read and write pools of however many spicedb nodes you're running
m
so 80 connections for read and write each per spicedb pod
or are we dividing 160 connections across N pods?
e
160 should be the total, so if you have 4 spicedb nodes you'd have 40 connections per node to use most folks don't have a 50/50 read write workload, so you might choose each node to get 30 read and 10 write, or 35 read and 5 write
yeah
m
oh I see it's 160 overall
interesting this brings an interesting question is that we have to tweak this number every time we scale up or down the spicedb pods
e
yes, we've discussed methods for sizing the pool automatically but don't have it implemented yet in practice though most people don't need to scale spicedb super dynamically; you'll size it for your peak load + a buffer and then track when your peak load is changing over time
also: it's not the end of the world to over or undershoot this recommendation
crdb performance may degrade somewhat, but a lot of that can be mitigated with the connection pool jitter flags