SonarQube DB size is increasing very fast

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) : 9.9.1 LTA
  • how is SonarQube deployed: zip
  • what are you trying to achieve : Want to reduce the DB size which is growing very faster.
  • what have you tried so far to achieve this : None

Hi Team,
I want to reduce the DB size, since development teams are using SonarQube for feature branches, pull requests and base branches. How can we reduce/optimize the DB size for this, what changes i need to apply through SonarQube UI.

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

You can change the housekeeping setting.

If you have projects which have not been analyzed for a long time (e.g. since the last update of SonarQube), yo may consider to wipe out these stale projects.

I want delete more than 30 days older reports which is not required. Can you please let us know the steps to reduce the DB size.

Thanks,

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your upgrade path is:

9.9.1 → 2025.1

You may find these resources helpful:

If you have questions about upgrading, feel free to open a new thread for that here.

Regarding your DB size, you’ll find once you’ve upgraded that we’ve taken steps in the 10-series (which culminates in 2025.1) to reduce the DB size.

And if that’s not enough, you should certainly consider adjusting the housekeeping settings, as @milbrandt recommended. Note that housekeeping doesn’t run on a cron; it’s executed as part of analysis report processing, so it doesn’t happen until you analyze.

 
HTH,
Ann

Hi @ganncamp /@milbrandt

Can’t we able to delete the older reports by applying “Number of days before purging inactive branches and pull requests reports=10” in 9.9.1 LTA version. If yes, then i will apply the [Housekeeping]. (Housekeeping | SonarQube Server Documentation_gcl_auMTA0Mjg3MjE3MC4xNzQxMTU0Mjkz*_gaNDA5MzI3MjE1LjE3NDExNTQyOTM._ga_9JZ0GZ5TC6*MTc0MTYwNDUyMC42LjEuMTc0MTYxMjMzNC4zNS4wLjA.)

Hi,

Again, this doesn’t run on a cron. You can update the housekeeping settings but then you’ll need to analyze each project before the new settings kick in on it.

 
HTH,
Ann

Hi @ganncamp

Can’t we optimize DB size by applying Housekeeping settings in 9.9.1 LTA version itself without upgrading to 2025.1 version…? What is the special features that are available in 2025.1 related to optimizing SonarQube.

Hi,

That’s not what I said. What I said was

And it will get even better once you upgrade.

 
HTH,
Ann

Hi again,

BTW, this may help:

 
Ann

Hi @ganncamp
Do we have steps/queries to clean up the stale projects and one year old projects from SonarQube DB.
If yes please share it with me.

And moreover do we have LTA version available in community edition which is in 2025 releases…? I want to upgrade the SonarQube version from 9.9.1 to latest LTA version. Also, by updating sonarqube version to latest LTA version, will it help to optimize the DB size by changing the housekeping settings..? If yes what changes needs to be updated post update for branch analysis and pull request analysis.

Hi,

Delete the projects from the UI and run the DB cleanup as described in the post I linked previously.

There is no LTA for Community Build. You’ll need to make sure you stay on the Latest version.

 
HTH,
Ann

Hi @milbrandt /@ganncamp

Are we good to upgrade to any latest version from 9.9.1 LTA version in community build to reduce/optimize the DB size. If yes which version is suitable.

Moreover DB is size increasing very with below tables. Can you please let me know are we good to clean up any cache content from live_measures, file_sources, issues tables from DB. Please let me know if we are good to clean up the data from these tables…?

Hi,

Again:

You can make the jump from 9.9 straight to 25.3.

Do not directly modify the DB except to follow the DB maintenance suggested in the post I recommended to you 10 days ago.

 
HTH,
Ann