Sonar Server side analysis taking inconsistant time for complete

Hi team!

We are using SonarQube community Edition (v9.9.1 LTS - We plan to migrate soon to latest community build) on a linux machine as a zip file.

I am asking about an issue that I am observing on the SonarQube Server Side Analysis.
The Server side analysis is taking a variable about of time of complete for multiple analysis of the same project

I have gone to the ce.log and tried to find out why certain analysis are taking longer, attaching my findings as an image

Analysis of the above data collected from ce.log:

  1. This is data of multiple scans on different branches of the same Project
  2. The columns show different stages in the ce.log for each run (Sorted in decreasing order of average time taken)
  3. The rows highlighted in grey are the ones for which analysis took less time.
  4. The rows not highlighted are the ones for which the analysis took very long (Unwanted behaviour)
  5. For the runs when analysis took less time, I can see the “Building Component of trees” and “Validate Project” are taking very less time (~1-3 seconds). Looks like these are the stages causing increase in scan time

Note: Each analysis is a full branch analysis (not PR-only).

Can someone please help us understand what happens in “Building Component of trees” and “Validate Project” and weather it is normal for each run to take so long for these stages in every analysis? Is there any way to optimize this?

Please let me know if more information is needed, I am happy to share.
These long analysis are choking up our Sonar Server during peak hours

Hi,

Welcome to the community!

I’m really not going to be able to help you with 9.9. You’re multiple years behind.

What I can say is that we’re always working to make analysis better and more performant and you should see some improvements once you upgrade.

If you really want to pursue this now - without further help from me, sorry! - turn on DEBUG server logging and see what that tells you.

Off-hand

  • the server needs to be close to the DB on the network to reduce latency
  • make sure the DB is responding in a timely manner
  • see if other processes are sucking up host resources

 
HTH,
Ann