diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js index d1b4b8f..cffd468 100644 --- a/docs/.vitepress/config.js +++ b/docs/.vitepress/config.js @@ -68,7 +68,12 @@ 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: '/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 new file mode 100644 index 0000000..7238d41 --- /dev/null +++ b/docs/Libraries/go/go-ams.md @@ -0,0 +1,29 @@ +# 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 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.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/java/jakarta-ams/jakarta-ams.md b/docs/Libraries/java/jakarta-ams/jakarta-ams.md index a6fe8af..a24ae61 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 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 +```` + +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 policy assignment in Java is approximately 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..e5b1c9d 100644 --- a/docs/Libraries/nodejs/sap_ams/sap_ams.md +++ b/docs/Libraries/nodejs/sap_ams/sap_ams.md @@ -244,6 +244,28 @@ 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 `@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) +```` +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 | +|:-------:|:-------:|:-----------:|:------------:|:-------------:|:-----------:|:-----------------:| +| 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 | + + ## API ### AuthorizationManagementService