High SCIM CPU Usage. Cache build gets stuck and Swagger doesn't function properly.
Symptom
When trying to make a connection via Swagger, connection fails, and you may see error:
"ERR_EMPTY_RESPONSE"
Alternatively, Swagger may load, but may not function as expected.
You may additionally see unexpected CPU usage.
If you review the CAScimScheduler.log, you will see that during each cache refresh / rebuild cycle, the process is getting stuck on an endpoint, like so:
INFO [04/12/2023 10:19:18] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:182- Refreshing Endpoint User
INFO [04/12/2023 10:31:45] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:185- Total Results for Endpoint: 985 pagesize=200
INFO [04/12/2023 10:34:37] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:194- Finished Endpoint User [919 secs, totalResults=985]
INFO [04/12/2023 10:34:42] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:182- Refreshing Endpoint Group
INFO [04/12/2023 10:35:26] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:185- Total Results for Endpoint: 3170 pagesize=200
INFO [04/12/2023 10:46:30] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:194- Finished Endpoint Group [707 secs, totalResults=3170]
INFO [04/12/2023 10:46:34] com.cyberark.scimserver.scheduler.RebuildCacheScheduler:autoRefreshEndpoint:182- Refreshing Endpoint Containers
<At this point, the process in the logs will restart/repeat>
Note: This is often the 'containers' endpoint, but can technically occur with any endpoint.
Environment
N/A Credential Providers Credential Provider On-Premise Idira SCIM Server
Cause
This is often caused by a missed configuration step, where the parameter in the GlobalConfig.yml known as "executionThreadPoolSize" isn't set.
This parameter allows SCIM to properly utilize the CPU Cores, and without it, SCIM tends to have issues building the cache, as a result of utilizing the CPU resources in a much less optimized fashion.
Resolution
1) Stop the SCIM Service on the SCIM Server.
2) Using PrivateArk Client (as an administrative user) access the SCIM Config safe. Download the 'GlobalConfig.yml' file
3) Make a backup copy of the file, and then edit the file. Find the parameter 'executionThreadPoolSize'. Remove the comment symbol (#) and proceeding space. After the parameter, and after the : symbol, add a value. In a normal SCIM environment with minimum specifications, this should be no higher than 5. Do not raise this value above 5 without direction from Idira support.
4) Save the changes to the GlobalConfig.yml file, and then upload your newly edited copy to the 'SCIM Config' safe - replacing the original within the safe.
5) On the SCIM Server - navigate to the cache folder (in the SCIM installation path). Delete all contents of the CACHE folder.
6) When the GlobalConfig has been replaced, and the CACHE cleared, restart the SCIM Service.
7) Now you will need to monitor the CAScimScheduler.log - this process can take anywhere from a few minutes, to a couple of hours, depending on the amount of vault data. During the cache rebuild process, Swagger will not be available.
Ideally - after monitoring for some time, you will see a message in the CAScimScheduler.log indicating that the cache refresh completed. At this time, you can test Swagger.
If the cache rebuild still doesn't complete, you can reach out to support for further direction and investigation.