How to set automatically the parameter of the number of workers of compute-engine

Hi,

The question is about SonarQube 8.5.1 EE.

I would like to know how to configure automatically the number of workers of compute-engine of a SQ EE.

I would like that my deployments scripts be able to set it automatically by, for example, setting it in the sonar.properties file.

I have seen that the number of workers can be set manually in the “Background Tasks” page but I have not found a way to configure it automatically, neither in the parameters list of the default sonar.properties file, nor in the documentation.

Thanks in advance.


Rodolphe

Hi Rodolphe!

This setting is stored in the database, so it cannot be set via the sonar.properties file. However, anything you can do via the UI can usually also be done via a web API call.

In this case, the resource api/ce has a call api/ce/set_worker_count which could be called automatically to set the value. Please note that this API is marked internal. You’re welcome to use it for purposes such as yours, but since it’s not a designated public API it may change without notice between SonarQube releases. If you choose to use this within your scripts, you must take care to ensure the API still exists with the same parameters whenever you upgrade SonarQube in the future.

Hope this helps!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.