Splitting SonarQube job in multiple parts

Must-share information (formatted with Markdown):

  • Using SonarQube EE 10.4.1
  • Deployed in some virtual machine.
  • We are trying to improve usage of resources
  • We have enabled server side cache

We have a setup where we use a fairly powerful runner to do the analysis on Gitlab but since our codebase is quite large this part of the job takes ~20 minutes. Under normal circumstances SonarQube is able to do its analysis in 10-15 minutes but at the moment we are seeing increased times of up to 1 hour. We are looking into this but the deterioration of the performance has started a discussion where we would like to release the resources when Sonarqube is doing its analysis.
What we have considered is to set sonar.qualitygate.wait=false and manually probe the web API but is that a preferred solution or is there a smarter way to do it? Also will it work with a MR decorator?

Kristian

Hey there.

The first thing to consider is whether the time is being spent scanner-sideor server-side.

Where is the time taking place? Scanner-side (in your CI, executing the rules against your code), or server-side (processing the analysis report being sent by the scanner to SonarQube)?

Hi.
We spend roughly 20 minutes scanner side followed by 10-15 minutes of server side analysis.
Server cache is enabled.

Thanks! I think there’s two things worth investigating:

Hi Colin.
Thanks for the answer.
We are vacuming the database but I will take a look at the log files first chance I get.

Best regards
Kristian

Hi Colin.
I have now had a chance to log at one of our log files and from a job taking a total of 30 minutes, 1670 seconds are spent on this line:
Execute component visitors | status=SUCCESS | time=1670205ms

Is there anything we can do to speed that up or get additional information about what takes up the time?

Kristian