简体   繁体   中英

Very slow response times from sonarqube server

Running SonarQube 5.3 server and I'm having trouble with incredibly slow response times and as a result a lot of socket timeout errors from various job scanners. Just to give some perspective, SonarQube is running on a Windows 7 box (don't ask), so is Jenkins (in a separate instance of tomcat)

Response times from Jenkins: <0.1 seconds on average

Response times from SonarQube: 3-30 seconds, with average around 9-12 second range

SonarQube is installed as a Windows service and so is Tomcat where Jenkins is running.

The database server that SQ is running against is Oracle, and I really doubt that's the source of latency as the Oracle server is both fast and local... Here're the jvm opts for sq

sonar.web.javaOpts=-Xmx1536m -Xms256m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError -server -Djava.net.preferIPv4Stack=true -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF-8

Running on java 1.8_u45

I'm kinda at a loss as I don't know how I can improve response time? (Other than by maybe running it on other hardware/os.)

I was able to improve response time from the server greatly by doing the following:

  1. Restart (scheduled this daily)
  2. Schedule a process to periodically poll the server (just a shell script executing curl and logging the response time every few minutes)

There are still some discrepancies, which I need to analyze, but after restarting sq, the average latency went down significantly (average response in ~0.6 seconds vs. 10+), it's still a bit slow imo, but as sq is only used internally, I'm ok with it. Most importantly, none of the scanner jobs failed. Before the restart the failure rate for jobs with socket timeout was about 60%

Perhaps you can add file to exclude to narrow down the scans.

Try to exclude file that you don't need. https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/

Also i found scan tend to be way faster, if you disable sonar scm

Project->Project Settings -> SCM -> Disabed the SCM sensor (checked it)

sonar.scm.disabled = true

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM