Relationship write latency
# spicedb
t
Hey everyone! I noticed really weird behaviour in the way SpiceDB work for one of my relationship write, it does the write with a notable delay, around 5min. So far I noticed that only for one particular relationship, other relationships get written right away. This makes me wonder if there's any write scheduling that could cause the delay 🤔 Eventually the relationship gets written. (NodeJS version 16)
j
Can you reproduce it with this same relationship consistently?
t
Each time I assign a new ID of the defined resource, in some cases I get the relationship written fast as expected. From what I've been seeing if I do a second write right after, then there's no delay
I'll try to reproduce it with
zed
@Jake this doesn't seem to be reproducible for the same relationship, the second attempt I did to write it was done right away. Also I couldn't reproduce it with
zed
j
what does your environment look like?
in general writes aren't very variable
although I would recommend sending more than one write per
WriteRelationshipsRequest
if possible
t
We have a K8s cluster, there are 2 replicas of NodeJS service responsible for permission writes, these are dispatched by messaging bus, regarding SpiceDB -- there are 2 replicas and we use external db instance of pg for datasource
Messaging bus -> NodeJS service -> Write permission in SpiceDB
j
sounds really standard, which version of spicedb are you using, and are you using the spicedb-operator?
t
1.16.2
no operator
j
if you find a way to repro it please let us know, but otherwise my guess would be that your nodejs servers are overloaded/blocking
how many QPS of write are you approximately sending?
t
queries to nodejs servers or SpiceDB?
I actually excluded the option of nodejs servers being overloaded, we have logs before and after each SpiceDB write, there is a milliseconds of difference before these 2 logs :/
5 Views