Reputation: 143
I'm new to SonarQube. I'm trying to analyze my project sources with SonarQube 4.2 with Maven3.
SonarQube is installed on my local PC and it's database(i.e MySQL) is installed on a remote host.
I executed sonar:sonar goarl by maven, then some process between Index files and Quality profile was too slow(about 7min).
Why is it such a slow? When MySQL was installed on same host with SonarQube, it's not so slow.
Does anybody knows how to fix this problem?
■Environment
■Maven's setting.xml
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Example for MySQL-->
<sonar.jdbc.url>
jdbc:mysql://<<REMOTE_HOST>>:3306/sonar?useUnicode=true&characterEncoding=utf8
</sonar.jdbc.url>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<!-- Optional URL to server. Default value is http://localhost:9000 -->
<sonar.host.url>
http://localhost:9000
</sonar.host.url>
</properties>
</profile>
■Log
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building <<PROJECT NAME>> 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The artifact xml-apis:xml-apis:jar:2.0.2 has been relocated to xml-apis:xml-apis:jar:1.0.b2
[INFO]
[INFO] --- sonar-maven-plugin:2.1:sonar (default-cli) @ <<PROJECT NAME>> ---
[INFO] SonarQube version: 4.2
INFO: Default locale: "ja_JP", source code encoding: "UTF-8"
INFO: Work directory: C:\<<PROJECT NAME>>\target\sonar
INFO: SonarQube Server 4.2
[INFO] [16:09:12.437] Load batch settings
[INFO] [16:09:12.806] User cache: C:\Users\<<USER>>\.sonar\cache
[INFO] [16:09:12.812] Install plugins
[INFO] [16:09:12.993] Install JDBC driver
[INFO] [16:09:13.001] Create JDBC datasource for jdbc:mysql://<<REMOTEHOST>>:3306/sonar?useUnicode=true&characterEncoding=utf8
[INFO] [16:09:17.442] Initializing Hibernate
[INFO] [16:09:24.204] Load project settings
[INFO] [16:09:24.711] Apply project exclusions
[INFO] [16:09:26.168] ------------- Scan <<PROJECT NAME>>
[INFO] [16:09:26.177] Load module settings
[INFO] [16:10:23.105] Loading technical debt model...
[INFO] [16:10:27.281] Loading technical debt model done: 4176 ms
[INFO] [16:10:27.289] Configure Maven plugins
[INFO] [16:10:27.805] Compare to previous analysis (2014-05-02)
[INFO] [16:10:27.892] Compare over 30 days (2014-04-02, analysis of 2014-05-01 15:21:24.0)
[INFO] [16:10:28.074] Deleting C:\<<PROJECT NAME>>\target\jacoco.exec
[INFO] [16:10:28.126] JaCoCo agent (version 0.6.4.201312101107) extracted: C:\Users\<<USER>>\AppData\Local\Temp\jacocoagent4016855045746382836.jar
[INFO] [16:10:28.127] JVM options: -javaagent:C:\\Users\\<<USER>>\\AppData\\Local\\Temp\\jacocoagent4016855045746382836.jar=destfile=target/jacoco.exec,excludes=*_javassist_* -javaagent:${settings.localRepository}/mockit/jmockit/0.999.8/jmockit-0.999.8.jar
[INFO] [16:10:28.371] Initializer FindbugsMavenInitializer...
[INFO] [16:10:28.387] Initializer FindbugsMavenInitializer done: 16 ms
[INFO] [16:10:28.388] Base dir: C:\<<PROJECT NAME>>
[INFO] [16:10:28.388] Working dir: C:\<<PROJECT NAME>>\target\sonar
[INFO] [16:10:28.388] Source dirs: C:\<<PROJECT NAME>>c\src\main\java
[INFO] [16:10:28.388] Test dirs: C:\<<PROJECT NAME>>\test\java
[INFO] [16:10:28.388] Binary dirs: C:\<<PROJECT NAME>>\classes
[INFO] [16:10:28.388] Source encoding: UTF-8, default locale: ja_JP
[INFO] [16:10:28.389] Index files
[INFO] [16:10:30.810] 560 files indexed
[INFO] [16:17:03.447] Quality profile for java: Sonar way
[INFO] [16:17:03.707] Sensor org.sonar.plugins.jacoco.JacocoMavenInitializer@769b92ed...
[INFO] [16:17:03.707] Execute maven plugin maven-surefire-plugin...
[INFO] [16:17:03.707] Execute org.apache.maven.plugins:maven-surefire-plugin:2.7.2:test...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building <<PROJECT NAME>> 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-surefire-plugin:2.7.2:test (default-cli) @ <<PROJECT NAME>> ---
[INFO] Surefire report directory: C:\<<PROJECT NAME>>\target\surefire-reports
:
Thanks,
Upvotes: 1
Views: 2544
Reputation: 77961
How remote is the remote host?
Sonar uses JDBC to upload results to the database. This protocol can be very inefficient when run over WAN links, resulting in very long Sonar runs.
Upvotes: 2