Controlling parallelism on Terrasoft.Core.Tasks.Task.StartNewWithUserConnection
Is there a way to control parallelism when using Terrasoft.Core.Tasks.Task.StartNewWithUserConnection (see documentation here: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/data-operations-back-end/execute-operations-in-the-background/examples/register-a-background-operation )? The documentation doesn't mention it, and I don't want to overload the system or having the system spend too many resources on running a lot of these background tasks at once, but also want to be able to run them sufficiently in parallel to give performance boosts to a large task that needs to be performed.
I would also like to know if there is any way to check for task completion if possible, but it seems like these methods do not allow it - maybe I am missing something though?
Like
Hello,
Unfortunately, there is no direct way to control parallelism for the StartNewWithUserConnection method. However, it is possible to globally limit the number of threads used to execute requests by configuring the "MaxDopQueryHint thread count" system setting (MaxDopHintThreadsCount in code).
As a best practice, it is recommended to set this value to approximately one-quarter to one-half of the total available threads (assuming one thread corresponds to one CPU core). This approach helps ensure that resource-intensive operations do not consume all available system resources.
Additionally, there is no out-of-the-box functionality to determine whether a task has been completed. However, this can be implemented through custom logic within the UsrBackgroundActivityCreator class, specifically in the Run method referenced in the following article:
https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…
For example, you could implement a custom notification at the end of the method to indicate when the process has finished.
Hello,
Unfortunately, there is no direct way to control parallelism for the StartNewWithUserConnection method. However, it is possible to globally limit the number of threads used to execute requests by configuring the "MaxDopQueryHint thread count" system setting (MaxDopHintThreadsCount in code).
As a best practice, it is recommended to set this value to approximately one-quarter to one-half of the total available threads (assuming one thread corresponds to one CPU core). This approach helps ensure that resource-intensive operations do not consume all available system resources.
Additionally, there is no out-of-the-box functionality to determine whether a task has been completed. However, this can be implemented through custom logic within the UsrBackgroundActivityCreator class, specifically in the Run method referenced in the following article:
https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…
For example, you could implement a custom notification at the end of the method to indicate when the process has finished.
Thanks for the input, it sounds like this thread's discussion is also involved in limiting/raising the limit around these background tasks: https://community.creatio.com/questions/number-threads-pool