Sonarqube database cleanup issue

We are using Sonarqube version of 7.9.4 with postgresql as database server. Eventhough auto cleanup setting is there in administration settings of sonarqube our database which is postgres is taking much space. Could you please provide us with a solution for the clean up process in postgres to avoid taking up space in server.

Hi,

Could you share which edition you’re using?

 
Ann

We are using community Edition 7.9.4 and database is Postgres.

Hi,

Thanks for answering. I asked because we are aware of a potential database bloat issue in commercial editions (related to lots of short-lived branches & issues). In the absence of that, I can only say that the size of your DB is going to be proportional to the number of projects & analyses on file. The housekeeping docs might be useful. Note that housekeeping only kicks in on analysis, so if you’ve got an old project sitting around, there’s no automated job on the SonarQube side that’s going to clean up its snapshots in the absence of an analysis of that project.

 
HTH,
Ann

Hi Ann,

I didn’t get the exact solution what you are referring to. Could you please help me in a better way to resolve my case how can we overcome the problem of Postgres database size(53 Gb) is increasing and not reclaiming the disk space? How can we reduce the database size to a minimum? can we achieve this by sonarqube database cleaner or with running Postgres commands manually? Our sonarqube is 7.9.4 community edition.

Hi,

Have you looked at the docs on housekeeping I linked above?

 
Ann

Yes, But didn’t get [roper solution. Please help me resolve this issue on how can we reduce postgres db size.

Hi,

Can you share what your housekeeping settings are? Are they still at the defaults?

 
Ann

HI Ann,

Sorry for the late response.

Please find the attachment for housekeeping settings below. Please help us with a solution of reclaiming the disk space from Postgres DB. How can we clean up unused data from Postgres DB.

sonarqubedb.PNG

Hi @Akhila,

As explained by Ann, the housekeeping settings only apply during project analysis.
So if you have recently done some update on them, you should be sure that all your projects have been analyzed since the last change you’ve made on these settings.

You can only go to Administration > Projects > Management page, and search for projects that have not be analyzed for a while. You can only use api/projects/search if you prefer using web service.
Then, you can maybe remove these projects if you think they can be removed, it will decrease the size of your DB.