Hi,
For Event 4506, we may consider the following possible solutions.
1, Write scripts where it's possible, taking into account 128 DataItems limit per Workflow.
2, PS module is too slow, replace it with js/vbs where it is possible
3, Replace PS script with custom C# module
4, Iteratively add more CPU/memory to the server
5, Add another server and move part of load to it.
Hope the above information helps.
Alex Zhu
If the response is helpful, please click "Accept Answer" and upvote it.