greetings folks.
# spicedb
s
greetings folks. I'm doing a small load testing scenario with Thumper and adjusting some knobs along the way. One thing that I can't fully understand is
--dispatch-cache-num-counters
flag (which I'm setting with
SPICEDB_DISPATCH_CACHE_NUM_COUNTERS
env var). In my testing it doesn't have any effect at all - whether it's 1 or 1000000. I've prepopulated the database with 10000 users and 10000 grants (1 to 1 relation) and running a following scenario on them:
Copy code
yaml
{{- range $j := enumerate 2000 }}
---
name: "min latency check"
weight: 80
steps:
- op: CheckPermission
  resource: core/geohash_grant:{{ $j }}
  permission: view
  subject: core/user:{{ $j }}
  consistency: MinimizeLatency
  expectNoPermission: false
---
name: "fully consistent check"
weight: 20
steps:
  - op: CheckPermission
    resource: core/geohash_grant:{{ $j }}
    permission: view
    subject: core/user:{{ $j }}
    consistency: FullyConsistent
    expectNoPermission: false
{{- end }}
On a screenshot there are couple of annotations: - a first one is where I set
SPICEDB_DISPATCH_CACHE_NUM_COUNTERS
to 1 - a second one is where i set
SPICEDB_DISPATCH_CACHE_NUM_COUNTERS
to 1000000 - a third one with improvement is change to datastore quantization interval from 5s to 15s - a fourth one where I've removed fully consistent check from the Thumper script - a fifth one - quantization interval is set to the default value of 5s again LFU cache metrics (second screenshot) show a much higher hitrate (although
SPICEDB_DISPATCH_CACHE_NUM_COUNTERS
doesn't seem to have an effect on it either). Can someone explain what
SPICEDB_DISPATCH_CACHE_NUM_COUNTERS
is suppose to be doing please? https://cdn.discordapp.com/attachments/844600078948630559/1417407970375110686/image.png?ex=68ca5f8a&is=68c90e0a&hm=8e317f384c0b67d17f398af6a1d8c87b1212b731e882fa02cfa2dc7ba5ba9b31& https://cdn.discordapp.com/attachments/844600078948630559/1417407970945273856/image.png?ex=68ca5f8a&is=68c90e0a&hm=00c8718de1b94354e10492461e08413b1bd174a7bae0f94a278e407a5d73de58&
are you doing any writes as a part of your workload?
it's also only used in the
ristretto
cache implementation. i'm currently trying to figure out which cache we use by default.
s
Writes are not a part of a workload. There is a separate script that does writes. I was aware of
ristretto
and LFU cache in general and it's just surprising to me that these parameters don't seem to have any effect. Regardless of num-counters added and evicted keys remained roughly the same over the course of the load test. https://cdn.discordapp.com/attachments/1417407971188805773/1417760662456631337/image.png?ex=68cba802&is=68ca5682&hm=a84cad34deac9a0c9172543b3c58585538628e7f1c0d6317ef77102b08a7a325&
I'm tinkering with cache parameters because I've noticed that as the number of checks per second increases,
spicedb_dispatch_client_check_from_cache_total
drops drastically.