7

I have one java based application which is having huge line of source code(~1m).Now I am using jenkins with sonar-runner-2.4 to run analysis with code coverage and test cases count.I have upgraded sonarqube server from 5.4 to 6.3.1.Before upgrade this job took 9hrs to complete the whole analysis (still it is very much long time but fine) but after upgrade to sonarqube-6.3.1 same job taking 13hrs to complete the same analysis.

How do I improve analysis time at least my earlier time 9hr ?

EDIT

Here is my JAVA_OPTS for sonarqube-6.3.1 instance

sonar.web.javaOpts=-Xmx6G -Xms2G -XX:MaxPermSize=1G -XX:+HeapDumpOnOutOfMemoryError -Djava.net.preferIPv4Stack=true

Available Hardware :

$lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 8 On-line CPU(s) list: 0-7 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 26 Stepping: 5 CPU MHz: 1596.000 BogoMIPS: 3999.44 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 4096K NUMA node0 CPU(s): 0-3 NUMA node1 CPU(s): 4-7

Available Memory : $free -m total used free shared buff/cache available Mem: 128714 58945 66232 430 3535 68298 Swap: 32767 957 31810

sonar-project.properties for the long running job:

sonar-project.properties

chintan thakar
  • 1,440
  • 1
  • 15
  • 25
  • 9hrs is a lot! It shouldn't take that long. Are you following the [hardware requirements](https://docs.sonarqube.org/display/SONAR/Requirements)? – Teryk - SonarSource May 16 '17 at 12:46
  • Hi @Teryk-SonarSourceTeam Thank you for your guidance! I have updated my question with hardware configuration I have and `sonar-project.properties` can you please guide where I have done something wrong ? – chintan thakar May 17 '17 at 06:09
  • Currently I have oracle Database of `10GB` can you please help me how frequently we should `re-index` or `purge` it ? – chintan thakar May 17 '17 at 06:13
  • @Teryk-SonarSourceTeam can you please take a look in properties file and help me where should I need to make change ?? – chintan thakar May 22 '17 at 12:10

1 Answers1

3

As you haven't really given many details, I can't really give many details in the answer, but the simple answer is that you have to make the scan do less work.

Look at your codebase. Is your scan processing generated classes? Is it scanning test classes? Is it scanning classes that have little real business logic? If you answer "yes" to any of those, consider excluding those classes.

Look at the SonarQube plugins you're using. Are you running every possible plugin you can run? Are there some heuristics you don't need to run, or perhaps you could run less frequently?

David M. Karr
  • 14,317
  • 20
  • 94
  • 199
  • HI @David, Thank you for your answer ! I have updated the details in my question. Can you please help me for same ? also let me know if you need any further details.Thank you! – chintan thakar May 17 '17 at 06:11