Set max workers dynamically

Is there any way to adjust max workers dynamically based on the number of machine’s cores? I see the API in StartParameter (setMaxWorkerCount) but it seems to be ignored, even if set from within settings.gradle.

The problem with the default (number of cores) is that it can really bring down the machine if the count of CPUs is really high and tasks run a lot of I/O. Capping it from within the build would be very sweet.