Problem

Solution

To achieve stable and good performance, max degree of parallelism option need to be limited to the number of processors to use in parallel plan execution.

https://github.com/steverezhener/DBA/blob/master/Procedures/bestpractices.usp_change_server_max_dop.sql

Example:

Based on https://blogs.msdn.microsoft.com/sqlsakthi/p/maxdop-calculator