wesley.wu
10/28/2026, 12:59 AMFailed to send request to OPA: Failed to send request to OPA: error sending request for url (<http://localhost:8181/v1/data/permit/root>)
also see a couple of these at the same time we see the above
Health check failed: opa: Failed to connect to OPA … <http://localhost:8181/health>
these tasks are well provisioned, not seeing it anywhere close to being starved for resources. any idea what the cause might be? we see the spikes (which correlate to spikes in traffic from about 5 req/s to about 100 req/s) and then the latency returns to baseline after the burst in load passes. are there limits to what OPA can handle or best practice for how to handle these bursts?
i found this similar thread above but not sure if there was any resolutionAsk Inkeep
10/28/2026, 12:59 AMAsk Inkeep
10/28/2026, 12:59 AMlocalhost:8181 under a burst from about 5 to about 100 req/s, and they don't state a throughput limit for OPA.
What the sources do support:
• The Edge PDP bundles OPA, the OPAL client, and an API server in one container, so a failure to reach OPA on localhost is internal to the PDP container, not an ALB issue.(1)
• OPA evaluation has a query timeout set by PDP_OPA_CLIENT_QUERY_TIMEOUT, in seconds, with a default of 1. The bulk check documentation describes raising it for bulk checks that take longer to evaluate, and says to give the PDP more CPU if timeouts continue.(2)
PDP_OPA_CLIENT_QUERY_TIMEOUT=10
(2)
That setting is documented for timeouts on slow evaluations. I can't confirm it applies to "error sending request" or health check connection failures, so treat it as something to test, not a confirmed fix.
• Edge PDP caching is off by default. When enabled, it can serve repeated checks without re-evaluating policy, and it supports an in-memory store for a single PDP or Redis for sharing across instances. Cached decisions can be stale until the TTL expires. See Cache configuration.(1)
• For high availability and scale, the documented pattern is several Edge PDPs behind a load balancer, which spreads burst load across instances.(1)
• If you send multiple checks per request handler, permit.bulkCheck() sends them to the PDP in one request instead of several.(2)
The GitHub issue you found (ARM64) is about the OPA binary failing to execute on linux/arm64 because of a linker mismatch. It was closed, with a fix included in a subsequent PDP release.(3) That produces a different failure (OPA never starting), so it's unlikely to explain intermittent errors that recover on their own. If your tasks run on ARM64 Fargate, confirm you're on a PDP version that includes that fix.
To help our engineers investigate, please share:
1. Which Workspace / Project / Env you're using
2. The calls you're performing (as SDK code or cURL)
3. The PDP version (image tag) you're running
4. The relevant PDP logs around a spike, including any OPA output and the timestamps of the localhost:8181 errors
If you want, I can also give a general answer based on broader knowledge, but it wouldn't be backed by these sources.Ask Inkeep
10/28/2026, 12:59 AMwesley.wu
10/28/2026, 1:01 AMEli Moshkovich
10/28/2026, 1:08 AMPDP_OPA_CLIENT_QUERY_TIMEOUT, 1s by default). When traffic jumps from ~5 to ~100 req/s, requests queue up in OPA. Any that wait longer than the timeout come back as Failed to send request to OPA and turn into 5xx, and OPA's health endpoint is slow for the same reason. Once the burst passes, the queue drains and latency goes back to normal, which matches what you're seeing.
Things to do:
1. Raise the timeout so bursts give slower responses instead of errors: PDP_OPA_CLIENT_QUERY_TIMEOUT=3 (or 5).
2. Provision for the peak, not the average. ECS autoscaling reacts too slowly for short bursts, so run enough tasks (at least 2) to handle ~100 req/s on their own. Average CPU over 1 minute can hide a short spike where OPA is pinned. Look at per-container CPU and throttling over the burst window.
3. Check your ALB/ECS health check settings. The PDP's health check fails while OPA is busy. If the health check thresholds are tight, the target group can pull tasks out in the middle of a burst, which pushes more load onto the rest. Loosen the unhealthy threshold and interval so a few seconds of slowness doesn't remove a task.
4. Check what's being called. A bulk check or a user-permissions call does many evaluations in one request, so 100 req/s of those costs far more than 100 single checks.
To confirm, could you send:
• the PDP version and the task's CPU/memory
• the full error line, including any "caused by" part (a timeout and a connection refused point to different causes)
• whether you see OPA restart logs during the spikes
• which endpoints/SDK methods make up the burstwesley.wu
10/28/2026, 1:24 AMwesley.wu
10/28/2026, 1:25 AMEli Moshkovich
10/28/2026, 1:28 AMwesley.wu
10/28/2026, 1:40 AM