From 45d3c88007584e5a5c92dfe778e85f10c9760cc8 Mon Sep 17 00:00:00 2001 From: Marie von Seggern Date: Wed, 8 Oct 2025 14:40:57 +0200 Subject: [PATCH 1/8] memory usage for java, nodejs and go added --- docs/.vitepress/config.js | 8 +++++- docs/Libraries/go/go-ams.md | 15 +++++++++++ .../Libraries/java/jakarta-ams/jakarta-ams.md | 20 ++++++++++++++ docs/Libraries/nodejs/sap_ams/sap_ams.md | 27 +++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 docs/Libraries/go/go-ams.md diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index d1b4b8f..ea4f252 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -68,7 +68,13 @@ export default defineConfig(withMermaid({ { text: '@sap/ams-dev', link: 'https://www.npmjs.com/package/@sap/ams-dev' } ] }, - { text: 'Go', link: 'https://github.com/SAP/cloud-identity-authorizations-golang-library' } + { text: 'Go', + collapsed: true, + items: [ + { text: 'cloud-identity-authorizations-golang-library', link: 'https://github.com/SAP/cloud-identity-authorizations-golang-library'}, + { text: 'golang', link: '/Libraries/go' } + ] + } ] }, diff --git a/docs/Libraries/go/go-ams.md b/docs/Libraries/go/go-ams.md new file mode 100644 index 0000000..0a9a345 --- /dev/null +++ b/docs/Libraries/go/go-ams.md @@ -0,0 +1,15 @@ +# Go-ams + +## Client Library +For details of the Go Authorization Client Library please refer to the repository [here](https://github.com/SAP/cloud-identity-authorizations-golang-library). + +## Configuration + +### Memory Usage +The memory usage of AMS in Go is very similar to the memory usage in Java. \n +The formula to calculate the memory usage is: +```` +memory_usage_in_kb = 0.2 * number_tenants + 0.25 * number_user + 0.1 * number_assignments +```` + + diff --git a/docs/Libraries/java/jakarta-ams/jakarta-ams.md b/docs/Libraries/java/jakarta-ams/jakarta-ams.md index a6fe8af..ed15b2c 100644 --- a/docs/Libraries/java/jakarta-ams/jakarta-ams.md +++ b/docs/Libraries/java/jakarta-ams/jakarta-ams.md @@ -100,6 +100,26 @@ This threshold can be set via the `ams.properties` file in the `src/main/resourc bundleGatewayUpdater.maxFailedUpdates=3 ```` +### Memory Usage +The memory usage of the AMS depends on the number of tenants, users and policy assignments. To calculate how much memory you will use approximately, you can use the following formula: +```` +memory_usage_in_kb = 0.2 * number_tenants + 0.15 * number_user + 0.07 * number_assignments +```` + +Some example data.json sizes can be found in this table: + +| Tenants | User | Assignments | Measured Difference to empty data.json | KB per Tenant (T)/User (U)/Assignment (A) | +|---------|-------|-------------|----------------------------------------|-------------------------------------------| +| 10 | 0 | 0 | 2 | 0.2 (T) | +| 10 | 100 | 0 | 17 | 0.15 (U) | +| 1 | 10 | 20 | 4 | 0.1 (A) | +| 1 | 100 | 200 | 34 | 0.095 (A) | +| 10 | 1000 | 2000 | 334 | 0.0915 (A) | +| 100 | 10000 | 20000 | 3336 | 0.0692 (A) | +| 1000 | 10000 | 200000 | 33348 | 0.069 (A) | + +The increase in memory usage per Tenant, User and Assignment in Java is approxiamtely linear. + ## Usage ### Setup PolicyDecisionPoint diff --git a/docs/Libraries/nodejs/sap_ams/sap_ams.md b/docs/Libraries/nodejs/sap_ams/sap_ams.md index 50702dd..9352484 100644 --- a/docs/Libraries/nodejs/sap_ams/sap_ams.md +++ b/docs/Libraries/nodejs/sap_ams/sap_ams.md @@ -244,6 +244,33 @@ Refer to the [Startup Check](/Authorization/StartupCheck) documentation for guid ### Testing See the central [Testing](/Authorization/Testing) documentation for details. +## Configuration + +### Memory Consumption +The memory that the AMS needs depends on the number of tenants, users and policy assignments in the application. +To approximately calculate the memory usage you can use the following primary formula: +```` +Memory(MB) = 6.54 + (AssignmentCount × 0.000117) +```` + +In the following table you can find some example sizes: +| Users | Tenants | Assignments | Total Memory | Memory Growth | Memory/User | Memory/Assignment | +|:-------:|:-------:|:-----------:|:------------:|:-------------:|:-----------:|:-----------------:| +| 0 | 0 | 0 | 6.54MB | 0MB | - | - | +| 10 | 1 | 19 | 6.67MB | 0.13MB | 13.0KB | 6.8KB | +| 100 | 1 | 167 | 6.72MB | 0.18MB | 1.8KB | 1.1KB | +| 1,000 | 10 | 1,901 | 6.97MB | 0.43MB | 0.43KB | 0.23KB | +| 10,000 | 100 | 19,164 | 9.06MB | 2.52MB | 0.25KB | 0.13KB | +| 50,000 | 100 | 95,867 | 18.28MB | 11.74MB | 0.24KB | 0.12KB | +| 100,000 | 100 | 191,446 | 29.12MB | 22.58MB | 0.23KB | 0.12KB | + +The memory growth with increasing numbers of users and policy assignments is linear, but the number of tenants affects memory efficiency in a non linear way: +- 1 tenant: 7.4KB per user +- 10 tenants: 0.43KB per user +- 100 tenants: 0.24KB per user + +With an increasing number of tenants, the memory usage per user gets more efficient. + ## API ### AuthorizationManagementService From c0b180ef64125cfe90ec3cc70760f29152b0f0a8 Mon Sep 17 00:00:00 2001 From: MarievonSeggern <142790704+MarievonSeggern@users.noreply.github.com> Date: Fri, 10 Oct 2025 12:05:55 +0200 Subject: [PATCH 2/8] Corrected spelling mistake Co-authored-by: Manuel Fink <123368068+finkmanAtSap@users.noreply.github.com> --- docs/Libraries/java/jakarta-ams/jakarta-ams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Libraries/java/jakarta-ams/jakarta-ams.md b/docs/Libraries/java/jakarta-ams/jakarta-ams.md index ed15b2c..f8a610d 100644 --- a/docs/Libraries/java/jakarta-ams/jakarta-ams.md +++ b/docs/Libraries/java/jakarta-ams/jakarta-ams.md @@ -118,7 +118,7 @@ Some example data.json sizes can be found in this table: | 100 | 10000 | 20000 | 3336 | 0.0692 (A) | | 1000 | 10000 | 200000 | 33348 | 0.069 (A) | -The increase in memory usage per Tenant, User and Assignment in Java is approxiamtely linear. +The increase in memory usage per Tenant, User and Assignment in Java is approximately linear. ## Usage From e8e911d211c201875c978dd7bd64ebb96bc8806b Mon Sep 17 00:00:00 2001 From: MarievonSeggern <142790704+MarievonSeggern@users.noreply.github.com> Date: Fri, 10 Oct 2025 12:07:26 +0200 Subject: [PATCH 3/8] Improvement of text Co-authored-by: Manuel Fink <123368068+finkmanAtSap@users.noreply.github.com> --- docs/Libraries/java/jakarta-ams/jakarta-ams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Libraries/java/jakarta-ams/jakarta-ams.md b/docs/Libraries/java/jakarta-ams/jakarta-ams.md index f8a610d..647e9ca 100644 --- a/docs/Libraries/java/jakarta-ams/jakarta-ams.md +++ b/docs/Libraries/java/jakarta-ams/jakarta-ams.md @@ -101,7 +101,7 @@ bundleGatewayUpdater.maxFailedUpdates=3 ```` ### Memory Usage -The memory usage of the AMS depends on the number of tenants, users and policy assignments. To calculate how much memory you will use approximately, you can use the following formula: +The memory usage of the AMS client library depends on the number of tenants, users and policy assignments. To approximate how much memory it will use, you can use the following formula: ```` memory_usage_in_kb = 0.2 * number_tenants + 0.15 * number_user + 0.07 * number_assignments ```` From 2fa6de238ae5f1a9c15bda00ad24ee6a72c81cde Mon Sep 17 00:00:00 2001 From: Marie von Seggern Date: Fri, 10 Oct 2025 13:37:11 +0200 Subject: [PATCH 4/8] minor corrections --- docs/Libraries/java/jakarta-ams/jakarta-ams.md | 2 +- docs/Libraries/nodejs/sap_ams/sap_ams.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/Libraries/java/jakarta-ams/jakarta-ams.md b/docs/Libraries/java/jakarta-ams/jakarta-ams.md index 647e9ca..a24ae61 100644 --- a/docs/Libraries/java/jakarta-ams/jakarta-ams.md +++ b/docs/Libraries/java/jakarta-ams/jakarta-ams.md @@ -118,7 +118,7 @@ Some example data.json sizes can be found in this table: | 100 | 10000 | 20000 | 3336 | 0.0692 (A) | | 1000 | 10000 | 200000 | 33348 | 0.069 (A) | -The increase in memory usage per Tenant, User and Assignment in Java is approximately linear. +The increase in memory usage per tenant, user and policy assignment in Java is approximately linear. ## Usage diff --git a/docs/Libraries/nodejs/sap_ams/sap_ams.md b/docs/Libraries/nodejs/sap_ams/sap_ams.md index 9352484..c2ca372 100644 --- a/docs/Libraries/nodejs/sap_ams/sap_ams.md +++ b/docs/Libraries/nodejs/sap_ams/sap_ams.md @@ -248,10 +248,11 @@ See the central [Testing](/Authorization/Testing) documentation for details. ### Memory Consumption The memory that the AMS needs depends on the number of tenants, users and policy assignments in the application. -To approximately calculate the memory usage you can use the following primary formula: +To approximately calculate the memory usage you can use the following formula: ```` Memory(MB) = 6.54 + (AssignmentCount × 0.000117) ```` +Although the memory usage depends on tenants, users and policy assignemnts, we found out that the driving factor behind large bundle sizes is primarily the number of policy assignments which naturally increases with a larger number of tenants and users. Our experiments found the above formula is a simple and practical way to estimate bundle sizes. In the following table you can find some example sizes: | Users | Tenants | Assignments | Total Memory | Memory Growth | Memory/User | Memory/Assignment | @@ -264,12 +265,12 @@ In the following table you can find some example sizes: | 50,000 | 100 | 95,867 | 18.28MB | 11.74MB | 0.24KB | 0.12KB | | 100,000 | 100 | 191,446 | 29.12MB | 22.58MB | 0.23KB | 0.12KB | -The memory growth with increasing numbers of users and policy assignments is linear, but the number of tenants affects memory efficiency in a non linear way: +The analysis revealed that memory usage per user and per policy assignment scales linearly. However, the distribution of users across tenants significantly impacts memory consumption: - 1 tenant: 7.4KB per user - 10 tenants: 0.43KB per user - 100 tenants: 0.24KB per user -With an increasing number of tenants, the memory usage per user gets more efficient. +With an increasing number of tenants, the memory usage per user gets more efficient, however the overall memory consumption will increase as more tenants are added. ## API From cac85e6489b38bb2063aee74c00802b4f9079ea0 Mon Sep 17 00:00:00 2001 From: Marie von Seggern Date: Fri, 10 Oct 2025 13:37:46 +0200 Subject: [PATCH 5/8] added detailed documentation for go memory usage --- docs/Libraries/go/go-ams.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/Libraries/go/go-ams.md b/docs/Libraries/go/go-ams.md index 0a9a345..97d4cc6 100644 --- a/docs/Libraries/go/go-ams.md +++ b/docs/Libraries/go/go-ams.md @@ -6,10 +6,25 @@ For details of the Go Authorization Client Library please refer to the repositor ## Configuration ### Memory Usage -The memory usage of AMS in Go is very similar to the memory usage in Java. \n -The formula to calculate the memory usage is: +The memory usage of the AMS client library depends on the number of tenants, users and policy assignments. To approximate how much memory it will use, you can use the following formula: ```` -memory_usage_in_kb = 0.2 * number_tenants + 0.25 * number_user + 0.1 * number_assignments +memory_usage_in_kb = 0.25 * number_tenants + 0.25 * number_user + 0.1 * number_assignments ```` +Some example data.json sizes can be found in this table: + +| Tenants | User | Assignments | Measured Difference to empty data.json | KB per Tenant (T)/User (U)/Assignment (A) | +|---------|-------|-------------|----------------------------------------|-------------------------------------------| +| 10 | 0 | 0 | 4 | 0.4 (T) | +| 1000 | 0 | 0 | 216 | 0.216 (T) | +| 10000 | 0 | 0 | 2517 | 0.2517 (T) | +| 10 | 100 | 0 | 28 | 0.26 (U) | +| 1 | 10 | 20 | 5 | 0.3 (A) | +| 1 | 100 | 200 | 45 | 0.085 (A) | +| 10 | 1000 | 2000 | 421 | 0.069 (A) | +| 100 | 10000 | 20000 | 4104 | 0.1138 (A) | +| 1000 | 10000 | 200000 | 24116 | 0.1077 (A) | + +The increase in memory usage per tenant, user and policy assignment in Java is approximately linear. + From 823b70325f97cf13338eb00b7bfc0d2798b02eb1 Mon Sep 17 00:00:00 2001 From: Manuel Fink <123368068+finkmanAtSap@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:24:12 +0200 Subject: [PATCH 6/8] Adjustments for the go docs (#15) * fixes for go docs * fix link in Getting Started --------- Co-authored-by: MarievonSeggern <142790704+MarievonSeggern@users.noreply.github.com> --- docs/.vitepress/config.js | 3 +-- docs/Authorization/GettingStarted.md | 2 +- docs/Libraries/go/go-ams.md | 31 +++++++--------------------- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index ea4f252..cffd468 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -71,8 +71,7 @@ export default defineConfig(withMermaid({ { text: 'Go', collapsed: true, items: [ - { text: 'cloud-identity-authorizations-golang-library', link: 'https://github.com/SAP/cloud-identity-authorizations-golang-library'}, - { text: 'golang', link: '/Libraries/go' } + { text: 'cloud-identity-authorizations-golang-library', link: '/Libraries/go/go-ams' } ] } diff --git a/docs/Authorization/GettingStarted.md b/docs/Authorization/GettingStarted.md index e7c4a27..33a38cf 100644 --- a/docs/Authorization/GettingStarted.md +++ b/docs/Authorization/GettingStarted.md @@ -15,7 +15,7 @@ The client libraries of AMS consist of different modules for the following progr - [@sap/ams](/Libraries/nodejs/sap_ams/sap_ams.md) - [@sap/ams-dev](https://www.npmjs.com/package/@sap/ams-dev) - **Go**: - - [cloud-identity-authorizations-golang-library](https://github.com/SAP/cloud-identity-authorizations-golang-library) + - [cloud-identity-authorizations-golang-library](/Libraries/go/go-ams) The next section lists the required module dependencies for different application setups, depending on the programming language and framework you are using. diff --git a/docs/Libraries/go/go-ams.md b/docs/Libraries/go/go-ams.md index 97d4cc6..9367f1c 100644 --- a/docs/Libraries/go/go-ams.md +++ b/docs/Libraries/go/go-ams.md @@ -1,30 +1,15 @@ -# Go-ams +# cloud-identity-authorizations-golang-library -## Client Library -For details of the Go Authorization Client Library please refer to the repository [here](https://github.com/SAP/cloud-identity-authorizations-golang-library). +The official Go client library is https://github.com/SAP/cloud-identity-authorizations-golang-library. + +## Documentation +Unfortunately, documentation for the Go client library is not yet available. Once it becomes available, it will be released here. ## Configuration ### Memory Usage -The memory usage of the AMS client library depends on the number of tenants, users and policy assignments. To approximate how much memory it will use, you can use the following formula: +The memory usage of AMS in Go is very similar to the memory usage in Java.\ +The formula to calculate the memory usage is: ```` -memory_usage_in_kb = 0.25 * number_tenants + 0.25 * number_user + 0.1 * number_assignments +memory_usage_in_kb = 0.2 * number_tenants + 0.25 * number_user + 0.1 * number_assignments ```` - -Some example data.json sizes can be found in this table: - -| Tenants | User | Assignments | Measured Difference to empty data.json | KB per Tenant (T)/User (U)/Assignment (A) | -|---------|-------|-------------|----------------------------------------|-------------------------------------------| -| 10 | 0 | 0 | 4 | 0.4 (T) | -| 1000 | 0 | 0 | 216 | 0.216 (T) | -| 10000 | 0 | 0 | 2517 | 0.2517 (T) | -| 10 | 100 | 0 | 28 | 0.26 (U) | -| 1 | 10 | 20 | 5 | 0.3 (A) | -| 1 | 100 | 200 | 45 | 0.085 (A) | -| 10 | 1000 | 2000 | 421 | 0.069 (A) | -| 100 | 10000 | 20000 | 4104 | 0.1138 (A) | -| 1000 | 10000 | 200000 | 24116 | 0.1077 (A) | - -The increase in memory usage per tenant, user and policy assignment in Java is approximately linear. - - From 53beab73d45c5b709467be342d36cf070c6ac560 Mon Sep 17 00:00:00 2001 From: MarievonSeggern <142790704+MarievonSeggern@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:27:02 +0200 Subject: [PATCH 7/8] Update docs/Libraries/nodejs/sap_ams/sap_ams.md Co-authored-by: Manuel Fink <123368068+finkmanAtSap@users.noreply.github.com> --- docs/Libraries/nodejs/sap_ams/sap_ams.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Libraries/nodejs/sap_ams/sap_ams.md b/docs/Libraries/nodejs/sap_ams/sap_ams.md index c2ca372..2b9446d 100644 --- a/docs/Libraries/nodejs/sap_ams/sap_ams.md +++ b/docs/Libraries/nodejs/sap_ams/sap_ams.md @@ -247,7 +247,7 @@ See the central [Testing](/Authorization/Testing) documentation for details. ## Configuration ### Memory Consumption -The memory that the AMS needs depends on the number of tenants, users and policy assignments in the application. +The memory that `@sap/ams` needs depends on the number of tenants, users and policy assignments in the application. To approximately calculate the memory usage you can use the following formula: ```` Memory(MB) = 6.54 + (AssignmentCount × 0.000117) From 5d87f53c2df0159d1f4573f080bcc20bd45e30ba Mon Sep 17 00:00:00 2001 From: Marie von Seggern Date: Tue, 14 Oct 2025 14:30:03 +0200 Subject: [PATCH 8/8] removed misleading paragraph for nodejs memory usage --- docs/Libraries/go/go-ams.md | 14 ++++++++++++++ docs/Libraries/nodejs/sap_ams/sap_ams.md | 6 ------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/Libraries/go/go-ams.md b/docs/Libraries/go/go-ams.md index 9367f1c..7238d41 100644 --- a/docs/Libraries/go/go-ams.md +++ b/docs/Libraries/go/go-ams.md @@ -13,3 +13,17 @@ The formula to calculate the memory usage is: ```` memory_usage_in_kb = 0.2 * number_tenants + 0.25 * number_user + 0.1 * number_assignments ```` +Some example data.json sizes can be found in this table: +| Tenants | User | Assignments | Measured Difference to empty data.json | KB per Tenant (T)/User (U)/Assignment (A) | +|---------|-------|-------------|----------------------------------------|-------------------------------------------| +| 10 | 0 | 0 | 4 | 0.4 (T) | +| 1000 | 0 | 0 | 216 | 0.216 (T) | +| 10000 | 0 | 0 | 2517 | 0.2517 (T) | +| 10 | 100 | 0 | 28 | 0.26 (U) | +| 1 | 10 | 20 | 5 | 0.3 (A) | +| 1 | 100 | 200 | 45 | 0.085 (A) | +| 10 | 1000 | 2000 | 421 | 0.069 (A) | +| 100 | 10000 | 20000 | 4104 | 0.1138 (A) | +| 1000 | 10000 | 200000 | 24116 | 0.1077 (A) | + +The increase in memory usage per tenant, user and policy assignment in Java is approximately linear. \ No newline at end of file diff --git a/docs/Libraries/nodejs/sap_ams/sap_ams.md b/docs/Libraries/nodejs/sap_ams/sap_ams.md index 2b9446d..e5b1c9d 100644 --- a/docs/Libraries/nodejs/sap_ams/sap_ams.md +++ b/docs/Libraries/nodejs/sap_ams/sap_ams.md @@ -265,12 +265,6 @@ In the following table you can find some example sizes: | 50,000 | 100 | 95,867 | 18.28MB | 11.74MB | 0.24KB | 0.12KB | | 100,000 | 100 | 191,446 | 29.12MB | 22.58MB | 0.23KB | 0.12KB | -The analysis revealed that memory usage per user and per policy assignment scales linearly. However, the distribution of users across tenants significantly impacts memory consumption: -- 1 tenant: 7.4KB per user -- 10 tenants: 0.43KB per user -- 100 tenants: 0.24KB per user - -With an increasing number of tenants, the memory usage per user gets more efficient, however the overall memory consumption will increase as more tenants are added. ## API