Arif
02/17/2026, 1:20 PMdescope/authzcache Docker image as described in the documentation:
β’ https://hub.docker.com/r/descope/authzcache
β’ https://docs.descope.com/authorization/fga-cache
We are observing unexpected behavior when using the FGA cache:
1. When we do NOT configure the FGA cache URL in the Descope client, FGA checks work correctly and return expected results.
2. When we configure the FGA cache URL, we observe:
β’ Increased latency compared to direct FGA calls, Also it worked when less number of relations to be pass to check. but if its more than 500 relation check at once, it takes time.
will share logs from the cache container if needed.
Can you please help.
cc- @Mike Hudson @Kenneth KnollMeir Wahnon
02/17/2026, 1:20 PMYosi Haran
02/17/2026, 3:33 PMArif
02/17/2026, 4:15 PMYosi Haran
02/18/2026, 3:01 PMArif
02/25/2026, 5:40 AMYosi Haran
02/26/2026, 1:15 PMKenneth Knoll
02/26/2026, 2:23 PMKenneth Knoll
03/03/2026, 1:15 AMKenneth Knoll
03/05/2026, 12:48 PMYosi Haran
03/05/2026, 1:33 PMKenneth Knoll
03/05/2026, 4:43 PMYosi Haran
03/05/2026, 5:27 PMKenneth Knoll
03/05/2026, 8:46 PMKenneth Knoll
03/10/2026, 1:54 AMYosi Haran
03/10/2026, 4:24 PMKenneth Knoll
03/10/2026, 4:27 PMYosi Haran
03/10/2026, 6:15 PMArif
03/11/2026, 7:07 AMArif
03/13/2026, 10:51 AMVivek Sharma
03/16/2026, 5:56 AMVivek Sharma
03/16/2026, 9:06 AMYosi Haran
03/16/2026, 9:08 AMYosi Haran
03/16/2026, 9:36 AM208ms, during a cache miss, which is reasonable run time for a network request, and I see most requests taking under 1ms, which means they are returning directly from the local cache.
Perhaps there is an external issue related to the Prisma database connection which might be configured differently when authzcache is used?
Maybe threads are not being closed properly?
The failures I saw in the logs did not seem related to authzcache, but to Postgress.
After my manual analysis, I ran an analysis using Claude Code and verified that it's conclusion about authzcache logs, which I am familiar with, is correct.
I cannot verify the conclusions about the service logs, but perhaps it will be useful for you? Please see the analysis below and let me know if it makes sense π
authzcache performance (from dev-auth-cache-logs.csv)
Extracting all gRPC durations from the Check calls:
ββββββββββββ¬βββββββββ¬βββββββββββ
β Time β Method β Duration β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:06 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:26 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:26 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:29 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:29 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:48 β Check β 33ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:50 β Check β 200ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:50 β Check β 208ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:54:51 β Check β 23ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:06 β Check β 132ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:26 β Check β 18ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:26 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:28 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:29 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:49 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:49 β Check β 1ms β
ββββββββββββΌβββββββββΌβββββββββββ€
β 07:55:50 β Check β 5ms β
ββββββββββββ΄βββββββββ΄βββββββββββ
The vast majority of Check calls complete in 1-5ms. The occasional 100-200ms calls are likely cache misses that proxy to the remote Descope server β entirely normal behavior. Write operations (CreateFGARelations, DeleteFGARelations) also
complete quickly at 29-34ms.
The "idle-session timeout" errors (from dev-service-action-logs.csv)
The "terminating connection due to idle-session timeout" errors at lines 364-383 are PostgreSQL errors (SqlState E57P05), NOT authzcache errors. They come from the DatabaseService / Prisma client within the actions service itself:
prisma:error: Error in PostgreSQL connection: Error {
severity: "FATAL",
code: SqlState(E57P05),
message: "terminating connection due to idle-session timeout"
}
These occur at 07:58:00-07:58:01 (6 errors) and 07:59:50 (2 errors). Their Azure PostgreSQL server (aptly-pg-server-dev.postgres.database.azure.com) is killing idle connections in Prisma's connection pool.
Later at 08:13:29, the service restarts and fails entirely with P1001: Can't reach database server β the PostgreSQL server is completely unreachable.
What's actually happening
1. The client's PostgreSQL has idle_session_timeout configured β it kills connections that sit idle in Prisma's pool. When the service tries to use a killed connection, it gets the FATAL error.
2. Their database becomes entirely unreachable at ~08:13, causing bootstrap failures and crash loops.
3. They're checking permissions for 1,206 actions per request (visible in multiple log entries like "Checking permissions for 1206 actions"). Even at 1-5ms per authzcache call, that adds up β but it's the sheer volume, not authzcache
latency.
Verdict
authzcache is fast and healthy β 1-5ms typical response times. The latency/timeout issues are entirely on the client's infrastructure side:
- Root cause: Their Azure PostgreSQL server's idle_session_timeout setting is killing pooled connections, and the database is intermittently unreachable.
- Recommended actions for the client:
a. Check/increase the idle_session_timeout setting on their Azure PostgreSQL server
b. Configure Prisma's connection pool to handle stale connections (e.g., connection_limit, pool_timeout, or connection health checks)
c. Investigate why their database becomes completely unreachable (network/firewall/Azure scaling issue)Yosi Haran
03/16/2026, 9:37 AMVivek Sharma
03/16/2026, 9:44 AMYosi Haran
03/16/2026, 9:45 AMYosi Haran
03/16/2026, 9:45 AMVivek Sharma
03/16/2026, 9:45 AMYosi Haran
03/16/2026, 9:48 AMVivek Sharma
03/16/2026, 9:48 AMYosi Haran
03/16/2026, 9:49 AMYosi Haran
03/16/2026, 9:55 AMYosi Haran
03/16/2026, 10:01 AMVivek Sharma
03/16/2026, 10:02 AMYosi Haran
03/16/2026, 10:03 AMVivek Sharma
03/16/2026, 10:08 AMVivek Sharma
03/16/2026, 10:53 AMYosi Haran
03/16/2026, 11:46 AMYosi Haran
03/16/2026, 11:58 AMββββββββββββββββ¬ββββββββ¬ββββββββββββββββββββββββββββββββββββββββββ
β Duration β Count β Details β
ββββββββββββββββΌββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 0ms (sub-ms) β 2 β 109Β΅s, 112Β΅s β quick cache hits. β
ββββββββββββββββΌββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 1-2ms β 14 β Normal cache hits β
ββββββββββββββββΌββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 25-32ms β 5 β Write ops (Create/Delete FGA) + 1 miss β
ββββββββββββββββΌββββββββΌββββββββββββββββββββββββββββββββββββββββββ€
β 108-186ms β 5 β (Larger) Cache misses proxied to remote β
ββββββββββββββββ΄ββββββββ΄ββββββββββββββββββββββββββββββββββββββββββYosi Haran
03/16/2026, 3:39 PMVivek Sharma
03/16/2026, 4:10 PMYosi Haran
03/17/2026, 2:13 PMVivek Sharma
03/17/2026, 2:15 PMVivek Sharma
03/17/2026, 2:45 PMKenneth Knoll
03/18/2026, 2:50 PMYosi Haran
03/18/2026, 2:53 PM2.2.0
authzcache Digest: sha256:e9746c784721a7560f164c386ea921adfe47a2c01400c0778b5cbf9fc80bc4e0 (docker pull descope/authzcache:latest)Kenneth Knoll
03/18/2026, 4:17 PMVivek Sharma
03/19/2026, 5:33 AMYosi Haran
03/19/2026, 7:52 AMVivek Sharma
03/19/2026, 8:51 AMYosi Haran
03/19/2026, 9:28 AMVivek Sharma
03/19/2026, 9:41 AMYosi Haran
03/19/2026, 10:41 AMYosi Haran
03/19/2026, 12:26 PMYosi Haran
03/19/2026, 12:30 PMVivek Sharma
03/20/2026, 4:53 AMHarsh Gajjar
03/20/2026, 5:11 AMVivek Sharma
03/20/2026, 5:19 AMYosi Haran
03/20/2026, 5:34 PMYosi Haran
03/23/2026, 9:08 AMVivek Sharma
03/23/2026, 9:10 AMYosi Haran
03/23/2026, 10:55 AM2.2.1 and try to use fgaCacheUrl again? πVivek Sharma
03/23/2026, 10:56 AMVivek Sharma
03/23/2026, 12:35 PMKenneth Knoll
03/24/2026, 4:14 AMYosi Haran
03/25/2026, 2:15 PMYosi Haran
03/25/2026, 2:16 PMVivek Sharma
03/26/2026, 4:49 AMHarsh Gajjar
03/26/2026, 1:28 PMYosi Haran
03/26/2026, 1:34 PMYosi Haran
03/26/2026, 2:18 PMHarsh Gajjar
03/26/2026, 2:23 PMVivek Sharma
04/10/2026, 11:24 AMYosi Haran
04/10/2026, 11:32 AMYosi Haran
04/10/2026, 12:04 PMYosi Haran
04/12/2026, 1:24 PMVivek Sharma
04/13/2026, 4:56 AMYosi Haran
04/13/2026, 5:46 AMVivek Sharma
04/13/2026, 6:32 AMYosi Haran
04/13/2026, 6:35 AMYosi Haran
04/13/2026, 6:38 AMReshma
04/13/2026, 7:57 AMVivek Sharma
04/14/2026, 1:51 PMYosi Haran
04/14/2026, 1:57 PMVivek Sharma
04/15/2026, 4:19 AMYosi Haran
04/15/2026, 5:31 PMYosi Haran
04/16/2026, 8:25 AMVivek Sharma
04/16/2026, 8:41 AMYosi Haran
04/16/2026, 8:41 AMVivek Sharma
04/16/2026, 9:18 AMYosi Haran
04/16/2026, 9:21 AMYosi Haran
04/16/2026, 9:51 AMP2mDFvFZYGZ4pt1KzQVgaF89Dmr9 π€
Could you please re-confirm and let me know which projectId you used? πVivek Sharma
04/16/2026, 9:55 AMYosi Haran
04/16/2026, 9:55 AMYosi Haran
04/16/2026, 11:31 AM4ms .
Additionally, the cache metrics do not show any long running queries that match the ~8s delay we are seeing in the logs below...
However, I see that only 16 tuples were checked in the backend, and 80 were requested from the cache.
So I will dig into the cache logic to make sure we do not have any potential issue there either, and will update more soon.
@Vivek Sharma From your end, can you please verify that setupDescopeClient() does not cause any locking or waiting for other requests to finish? Seems unlikely, but I don't know what this method does, so worth verifying as well if that's ok π
public async checkRelationFGA(relations: IFGARelation[]): Promise<IFGACheckMap[]> {
await this.setupDescopeClient(); // <-- THIS
const response = await this.descopeClient.management.fga.check(relations);
return response.data ?? [];
}
{"timestamp":"2026-04-16T09:01:50.130Z","status":"debug","level":"debug","message":"[checkPermissions] Calling Descope checkRelationFGA API","service":"Actions service","env":"development","logger.name":"ActionService"}
{"timestamp":"2026-04-16T09:01:58.744Z","status":"debug","level":"debug","message":"[getGlobalSearchActionList] transformActionToResponseDto branch completed in 8613ms","service":"Actions service","env":"development","logger.name":"ActionService"}
{"timestamp":"2026-04-16T09:01:58.874Z","status":"debug","level":"debug","message":"[checkPermissions] Descope checkRelationFGA API completed in 8744ms (response size: 80 checks)","service":"Actions service","env":"development","logger.name":"ActionService"}Vivek Sharma
04/16/2026, 12:29 PMYosi Haran
04/16/2026, 1:19 PMVivek Sharma
04/16/2026, 1:29 PMVivek Sharma
04/16/2026, 1:31 PMYosi Haran
04/16/2026, 1:51 PMVivek Sharma
04/16/2026, 2:05 PMYosi Haran
04/16/2026, 2:06 PMVivek Sharma
04/17/2026, 6:05 AMYosi Haran
04/17/2026, 6:09 AMVivek Sharma
04/17/2026, 7:47 AM