SonarQube report process is very slow

I am currently using SonarQube developer version with PostgreSql 13.0.
when testing with H2 embedded database, report process only takes about 10s. After migrating to production env which PostgreSQL, it takes 5-10 mins to process the report. Most of time were spent on those stages:

Execute component visitors | status=SUCCESS | time=101249ms
Persist live measures | insertsOrUpdates=44972 | status=SUCCESS | time=114758ms

Seems very similar to the question here, but after I increasing work_mem of PostgreSQL and the memory of SonarQube server, performance is not improved.

Please tell me what could be the reason?
Thanks in advance!

what is the size of your DB?

1 Like

2 core, 8GB mem, and 50 GB disk
current DB size is 686 MB


Welcome to the community!

I guess when you were testing with the H2 DB, you only analyzed one or two projects? Did you analyze the same project that you’re now seeing a 10min processing time on? Or just a small, test project?


Hi Ann, Thank you for your reply!
In both env, I only analyzed one same project.


Thanks for that important detail!

Can you just double check your server logs and make sure there’s nothing of note in them, please?


We have recently upgraded from 7.9.3 → 8.9.7 → 9.6 and are also seeing Background tasks taking hours to complete for a very large, complex project. Specifically, we see a huge duration in Execute Component Visitors:

2023.01.22 14:57:58 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Compute complexity measures | status=SUCCESS | time=64ms
2023.01.22 14:57:58 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Load measure computers | status=SUCCESS | time=0ms
2023.01.22 14:57:58 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Compute Quality Profile status | status=SUCCESS | time=3ms
2023.01.22 21:05:59 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Execute component visitors | status=SUCCESS | time=22080307ms
2023.01.22 21:05:59 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Checks executed after computation of measures | status=SUCCESS | time=12ms
2023.01.22 21:05:59 INFO  ce[AYXbDstweTkuOtrY3CPn][o.s.c.t.s.ComputationStepExecutor] Compute Quality Gate measures | status=SUCCESS | time=1ms

What did you bump your postgres work_mem value (and others?) to address this please? I believe ours is set to the default at the moment, which is only 4MB. Shared_buffers is at 4096mb but not sure if that matters.

Thank you.