JavaScript Settings
6. JavaScript Settings
Similar to ISVA implementation, IBM Security Verify Access OIDC Provider implementation allows user to perform customization with JavaScript access policy and mapping rules.
The following text contains the JavaScript v8 engine settings. The system cannot keep creating a new v8 engine per request because of memory limitation. So v8 engines are shared resources that need to be regulated. The total v8 engines that are created is regulated by the max_load
parameter. The default is set to 16.
Currently, two modes are available:
pool
mode - Inpool
mode, a pool of v8 engines exists. First, an execution thread must get a v8 engine from the pool. Only then it can run the script. After it is completed, the v8 engine is returned to the pool.worker
mode - Inworker
mode, the system creates amax_load
of worker threads. Each thread has its own v8 engine. When an execution thread runs a script, it submits a task and waits for the execution result. The task is then picked up by a worker thread. It runs the script and returns the result.
In the production environment we recommend using worker
mode because it performs better. Better performance is attributed to the ability to reuse the pre-compiled scripts. Both implementations pre-compile the scripts. However, in worker
mode, since each worker always runs the scripts on the same v8 engine, the caching of pre-compiled scripts is more effective.
Name | Description | Valid Value | Mandatory | Default |
---|---|---|---|---|
use_pool | If true, run in pool mode, otherwise run in worker mode. | boolean | No | false |
max_load | Maximum number of v8 engine created. | integer | No | 16 |
timeout | Maximum execution time for a script in ms. Set to 0 for unlimited execution time. | integer | No | |
max_ctx_in_isolate | Maximum reuse of v8 engine before recreation. Set to 0 to disable. | integer | No |
javascript: # Javascript Settings
timeout: 0 # Maximum execution time for a script in ms. Set to 0 for unlimited execution time.
max_load: 16 # Maximum number of v8 engine spawned.
max_ctx_in_isolate: 50 # Maximum reuse of v8 engine before recreated. Set to 0 to disable.
use_pool: false # If true, run in `pool` mode, otherwise run in `worker` mode.
- Read more about JavaScript performance tuning here.
Updated about 2 years ago