We need to investigate, what causes such a load. Strictly saying, the ideal background processing will always cause 100% CPU usage, if the number of workers is more or equal to the logical processor count – all the CPU cores are busy, and network delays are minimal. But we should ensure that all is ok in your case.
- What queries cause the high CPU usage on your DB server? You can see the answers by using SQL Server Performance Dashboard.
- What methods cause the high CPU usage on your application server? You can use a profiler to get an answer to this question. I prefer to use JetBrains' dotTrace. Samling method will not cause any significant delays to your application.
- Ensure you are placing the
AutomaticRetryAttribute on the correct method. If you enqueue your background jobs using base classes or interfaces, make sure you are applying the attribute to base classes, instead of derived ones