首先说下做这件事情的主因,组内有人说Project repo sync有点慢,废话不多说,直接上图.
我的数据:
~/review_site/logs# fgrep "git-upload-pack" sshd_log.2019-06-17 | wc -l
7477
~/review_site/logs# fgrep "git-receive-pack" sshd_log.2019-06-17 | wc -l
9
我的服务器配置:
mmmm@ubuntu:~$ free -m
total used free shared buff/cache available
Mem: 64391 12022 1280 20 51087 51664
Swap: 15258 510 14748
mmmm@ubuntu:~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
2
mmmm@ubuntu:~$ cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores : 10
mmmm@ubuntu:~$ cat /proc/cpuinfo | grep "processor" | wc -l
40
mmmm@ubuntu:~$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
40 Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz
我的配置改动展示:
[gerrit]
basePath = git
serverId = 9c50f982-2140-47e3-bb05-xxxxxxxxx
canonicalWebUrl = http://xx.xx.xx.xx:8080/
[gc]
interval = 1w
startTime = Sun 8:30
[database]
type = h2
database = /xxxxx/xxxxx/review_site/db/ReviewDB
poolLimit = 150
poolMaxIdle = 16
[index]
type = LUCENE
[auth]
type = LDAP
[ldap]
server = ldap://xx.xx.xx.xx
username = cn=admin,dc=xxx,dc=xxx
accountBase = ou=People,dc=xxx,dc=xxx
groupBase = ou=Groups,dc=xxx,dc=xxx
[receive]
enableSignedPush = false
timeout = 4min
[sendemail]
enable = true
smtpServer = smtpinternal.xxxxx.com
smtpServerPort = 25
smtpUser = XxxxCodeReview@xxxx.com
from = XxxxCodeReview<XxxxCodeReview@xxxx.com>
[cache]
directory = cache
[container]
user = root
javaHome = /usr/lib/jvm/java-8-openjdk-amd64/jre
heapLimit = 16g
[core]
packedGitLimit = 4g
packedGitWindowSize = 16k
packedGitOpenFiles = 2048
[sshd]
listenAddress = *:29418
threads = 32
batchThreads = 4
CommandStartThreads = 3
[httpd]
listenUrl = http://*:8080/
maxThreads = 50
[gitweb]
type = gitweb
cgi = /usr/share/gitweb/gitweb.cgi
[plugins]
allowRemoteAdmin = true
[pack]
threads = 4