From 791948b81e26e474cb196f7fcacd72a6461ce129 Mon Sep 17 00:00:00 2001 From: mayabarak Date: Wed, 3 Jul 2024 20:31:39 +0300 Subject: [PATCH 1/3] add timeout doc --- docs/how-to/enforce-permissions/bulk-check.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/how-to/enforce-permissions/bulk-check.mdx b/docs/how-to/enforce-permissions/bulk-check.mdx index 0b28d840..0e371afe 100644 --- a/docs/how-to/enforce-permissions/bulk-check.mdx +++ b/docs/how-to/enforce-permissions/bulk-check.mdx @@ -162,6 +162,15 @@ const permittedResources = resources.filter( ``` --- +### Set Timeout +For setting the timeout for the bulk check, you can set the 'PDP_OPA_CLIENT_QUERY_TIMEOUT' environment variable for the PDP. + +If for example you want a 10 second timeout, you can set the environment variable as follows: + +```bash +PDP_OPA_CLIENT_QUERY_TIMEOUT=10 +``` + :::note While `bulkCheck` will save you time in latency, it could have an impact on performance if you're checking permissions for different tenants. From f32aec50aee81e37e3ccdaa56b93709a33b8d12e Mon Sep 17 00:00:00 2001 From: mayabarak Date: Thu, 4 Jul 2024 07:27:02 +0300 Subject: [PATCH 2/3] add cpu info --- docs/how-to/enforce-permissions/bulk-check.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/how-to/enforce-permissions/bulk-check.mdx b/docs/how-to/enforce-permissions/bulk-check.mdx index 0e371afe..8440c2e2 100644 --- a/docs/how-to/enforce-permissions/bulk-check.mdx +++ b/docs/how-to/enforce-permissions/bulk-check.mdx @@ -170,6 +170,9 @@ If for example you want a 10 second timeout, you can set the environment variabl ```bash PDP_OPA_CLIENT_QUERY_TIMEOUT=10 ``` +OPA Runs the authorization query concurrently based on the amount of CPU it has, so if you have a lot of queries to run, you can increase the CPU count to speed up the process. +For more information on system requirements and performance optimization, you can check [this documentation.](/how-to/deploy/deploy-to-production#system-requirements-and-performance-optimization) + :::note From 02d3d14fbc822e790ba342844543b4b21c162c0e Mon Sep 17 00:00:00 2001 From: mayabarak Date: Thu, 4 Jul 2024 15:17:15 +0300 Subject: [PATCH 3/3] add cpu info --- docs/how-to/enforce-permissions/bulk-check.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/how-to/enforce-permissions/bulk-check.mdx b/docs/how-to/enforce-permissions/bulk-check.mdx index 8440c2e2..ad352806 100644 --- a/docs/how-to/enforce-permissions/bulk-check.mdx +++ b/docs/how-to/enforce-permissions/bulk-check.mdx @@ -163,14 +163,15 @@ const permittedResources = resources.filter( --- ### Set Timeout -For setting the timeout for the bulk check, you can set the 'PDP_OPA_CLIENT_QUERY_TIMEOUT' environment variable for the PDP. +Bulk checking is more performance-intensive than regular checking and also takes more time, which can lead to an OPA timeout. +To address this issue, you can increase the query timeout for the PDP and add more CPU to your virtual machine. If for example you want a 10 second timeout, you can set the environment variable as follows: ```bash PDP_OPA_CLIENT_QUERY_TIMEOUT=10 ``` -OPA Runs the authorization query concurrently based on the amount of CPU it has, so if you have a lot of queries to run, you can increase the CPU count to speed up the process. + For more information on system requirements and performance optimization, you can check [this documentation.](/how-to/deploy/deploy-to-production#system-requirements-and-performance-optimization)