figedi
04/12/2024, 7:22 AMLookupResources
on a self hosted instance in k8s using the spicedb-operator. There is not a high number of tuples (< 200k), and the expected outcome tuples for a single request are also relatively small (< 50k). Now i already gave the underlying db (postgres) a lot of resources, as well as the spicedb pods as well. I am experiencing either:
- Really long response times (~ 30s-1min)
- Errors: 4 DEADLINE_EXCEEDED
Is there any way to configure spicedb to increase the deadline? List-query permission checking is an absolute must for us, so w/o it and w/o materialize being public (yet) I am not sure about other options :/
PS: As the underlying db is GCP cloudsql, i have some query insights about whats happening. So although i already gave the postgres 4 cpus and 16gigs of ram, it spikes to 100% cpu usage when requesting that data. It seems a bit fishy to me that this already leads to such high usagevroldanbet
04/12/2024, 7:38 AMLookupResources
queries?vroldanbet
04/12/2024, 7:39 AMExpand
API for what you are trying to achieve. @ecordell has put some thought to it.figedi
04/12/2024, 7:40 AMvroldanbet
04/12/2024, 7:41 AMvroldanbet
04/12/2024, 7:41 AMfigedi
04/12/2024, 7:42 AMvroldanbet
04/12/2024, 7:43 AMvroldanbet
04/12/2024, 7:44 AMfigedi
04/12/2024, 7:45 AMSELECT
namespace,
object_id,
relation,
userset_namespace,
userset_object_id,
userset_relation,
caveat_name,
caveat_context
FROM
relation_tuple
WHERE
pg_visible_in_snapshot(created_xid,
$1) = $2
AND pg_visible_in_snapshot(deleted_xid,
$3) = $4
AND namespace = $5
AND relation = $6
AND object_id IN ($7, <....>) LIMIT $107
It executes itself fast (6ms) but is called a ridiculous amount (600k times roughly)figedi
04/12/2024, 7:45 AMvroldanbet
04/12/2024, 7:46 AMvroldanbet
04/12/2024, 7:46 AMfigedi
04/12/2024, 7:47 AMvroldanbet
04/12/2024, 7:48 AMzed permission check --explain
on the same LR path you are using? What's the SpiceDB version?vroldanbet
04/12/2024, 7:49 AMzed backup create
and zed backup redact
and sends us a dump of your schema, but being totally transparent we are swamped in work and it be best effortfigedi
04/12/2024, 7:49 AMfigedi
04/12/2024, 7:50 AMfigedi
04/12/2024, 7:55 AM9:55AM INF debugging requested on check
true
9:55AM WRN No debuging information returned for the check
vroldanbet
04/12/2024, 10:56 AM