Sonar cache hit ratio is very low always

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
    We are running sonar-scanner with sonar-cache enabled, with our implementation, we create sonar-branch(short-lived branch) for every analysis, and master compilation runs on nightly mode. The short-lived branches and master analysis is done at two different locations for same code.
    With short-lived branch the cache is enabled, but the cache hit ratio is always low, can you help point us why ?
  • what have you tried so far to achieve this
    we see cache is enabled , but the hit ratio is very less. how to improve the cache hits?

INFO: Subprocess(es) done in 3740388ms
INFO: Cache: 44/6980 hits, 1543436875 bytes

Hi,

Welcome to the community!

I’ve flagged this for more expert attention than I can give the topic, but in the meantime, can you provide your SonarQube version and which scanner (the Scanner CLI?) you’re using?

 
Thx,
Ann

SONAR_SCANNER_VERSION = sonar/4.5.0.2216

SONARQUBE server version : SonarQube™ technology is powered by SonarSource SA

  • Enterprise Edition
  • Version 7.9.4 (build 35981)
  • LGPL v3

Hi,

Your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

7.9.4 → 8.9.6 → 9.2.4 (last step optional)

You may find the Upgrade Guide and the LTS-to-LTS Upgrade Notes helpful. If you have questions about upgrading, feel free to open a new thread for that here.

If your error persists after upgrade, please come back to us.

 
Ann