I think we need to clarify how these settings can be used and what is recommended:
Maximum thread pool size
The maximum number of threads in the thread pool from which scripts operate. If no free thread is available in the pool, OpenAM creates new threads in the pool for script execution up to the configured maximum.
ssoadm attribute: maxThreads
Thread pool queue size
The number of threads to use for buffering script execution requests when the maximum thread pool size is reached.
ssoadm attribute: queueSize
These settings can be found in the XUI:
In case of load testing (i.e hitting access_token or userinfo endpoint hard), we need to tune up this settings (see https://bugster.forgerock.org/jira/browse/OPENAM-11778)
There is a recommendation in
set maxThreads=300 and queueSize=-1, this is not documented, it is however in the help text in the console: OPENAM-9307
queueSize help text:
Size of queue to use for buffering script execution request when core pool is at capacity.
Use -1 for an unbounded queue (this disables the maximum pool size setting). For short, CPU-bound scripts, consider a small pool size and larger queue length. For I/O-bound scripts (e.g., REST calls) consider a larger maximum pool size and a smaller queue. Not hot-swappable: restart server for changes to take effect.
I think we should:
- document the above recommendation (the ssoadm example does that here, but with no explanation)
- "this disables the maximum pool size setting" could make you think it refers to max threads(so you could leave empty), but looks like it refers to max queue size
To investigate a couple of points:
1. the 'workaround' was removed from the docs (I believe it should be added in the docs somewhere):
2. fix from https://bugster.forgerock.org/jira/browse/OPENAM-9307 : https://stash.forgerock.org/projects/OPENAM/repos/openam/commits/a05301d361dbba99f6b19e2a43fb928fd19ca658#openam-shared/src/main/java/org/forgerock/openam/shared/concurrency/ResizableLinkedBlockingQueue.java is throwing an error when queueSize is <0 but workaround is with -1 ?
I feel the docs are not saying much about these settings. Let me know something is unclear (it's best to look at the 2 jiras)