pepegar
05/27/2025, 9:10 AMzed permission lookup-resources document can_comment user:$uuid --page-limit 100
(can comment is a permission backed by a relation that allows for user:*, just in case it makes any difference)
We get a flamegraph that looks like this (see attached). The strange thing is that the sql queries occur during the 1st ~10ms of the request, but then the request hangs for 30s, until it times out on server side.
Do you know what can be causing this? should we just discourage the use of lookup resources for wildcard-backed relations?
https://cdn.discordapp.com/attachments/844600078948630559/1376849986460979313/CleanShot_2025-05-27_at_10.08.06.png?ex=6836d2f9&is=68358179&hm=d7e08c9480a952fb7138c84293967c4f0e5026cece0c7090bdc934ba636fa971&pepegar
05/27/2025, 9:11 AMcontext canceled
, btwyetitwo
05/27/2025, 2:32 PMyetitwo
05/27/2025, 2:33 PMcontext canceled
isn't necessarily a problem - the dispatch service will show that in normal operationJoey
05/27/2025, 2:41 PMgsimas
05/28/2025, 10:15 PMyetitwo
05/28/2025, 10:29 PMgsimas
05/28/2025, 11:02 PMgsimas
05/28/2025, 11:11 PMyetitwo
05/29/2025, 12:55 AMyetitwo
05/29/2025, 12:55 AMgsimas
05/29/2025, 3:09 PMgsimas
05/29/2025, 3:09 PMyetitwo
05/29/2025, 5:38 PMyetitwo
05/29/2025, 5:38 PMyetitwo
05/29/2025, 5:39 PMyetitwo
05/29/2025, 5:39 PMgsimas
05/29/2025, 5:56 PMgsimas
05/29/2025, 5:57 PMJoey
05/29/2025, 6:47 PMJoey
05/29/2025, 6:47 PMgsimas
05/29/2025, 7:56 PMpepegar
05/30/2025, 9:09 AMpermission can_comment = owner + delete + editor + comment + parent->can_comment + can_participate
(we don't have any parent
data in the DB, that's a feature that hasn't landed yet, but the schema is prepared). By the measures mentioned by you before (10 levels deep/10k out/in-coming conns) the schema is neither deep or wide.
- @yetitwo yes, we're using GRPC to talk with SpiceDB, configuring the client as follows:
kotlin
PermissionsServiceGrpcKt.PermissionsServiceCoroutineStub(
ManagedChannelBuilder
.forTarget(headlessServiceUrl)
.usePlaintext()
.defaultLoadBalancingPolicy("round_robin")
.build()
)
And the server with:
typescript
{
name: "SPICEDB_DATASTORE_CONNECTION_BALANCING",
value: "true",
},
{
name: "SPICEDB_ENABLE_EXPERIMENTAL_WATCHABLE_SCHEMA_CACHE",
value: "true",
},
{
name: "SPICEDB_DISPATCH_CLUSTER_MAX_CONN_AGE",
value: "15s",
},
- @Joey We use internal k8s networking, and we've configured the k8s service as headless to do load balancing on client side.pepegar
05/30/2025, 9:10 AM