From 0082fa9c49555c20b804990ed76a4482636a4918 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 29 May 2012 18:12:35 +0000 Subject: [PATCH] More gerrit tuning. Increase the heap size and dramatically increase the ssh threads. Add some more recommended parameters (see site manifest for details). Parameterize tunables in gerrit config file. Change-Id: Ia6446b29426f56a77425eed93a7f0e448c3cd7b1 --- manifests/site.pp | 29 ++++++++++++++++++-- modules/gerrit/manifests/init.pp | 19 +++++++++++++ modules/gerrit/templates/gerrit.config.erb | 31 +++++++++++++++++++--- 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index 42c4976b51..117677d8a0 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -43,7 +43,26 @@ node default { # # Long lived servers: # -node "gerrit.openstack.org", "review.openstack.org" { + +# Current thinking on Gerrit tuning parameters: + +# database.poolLimit: +# This limit must be several units higher than the total number of +# httpd and sshd threads as some request processing code paths may need +# multiple connections. +# database.poolLimit = 1 + max(sshd.threads,sshd.batchThreads) + sshd.streamThreads + sshd.commandStartThreads + httpd.acceptorThreads + httpd.maxThreads +# http://groups.google.com/group/repo-discuss/msg/4c2809310cd27255 +# or "2x sshd.threads" +# http://groups.google.com/group/repo-discuss/msg/269024c966e05d6a + +# container.heaplimit: +# core.packedgit* +# http://groups.google.com/group/repo-discuss/msg/269024c966e05d6a + +# sshd.threads: +# http://groups.google.com/group/repo-discuss/browse_thread/thread/b91491c185295a71 + +node "review.openstack.org" { include openstack_cron class { 'openstack_server': iptables_public_tcp_ports => [80, 443, 29418] @@ -54,7 +73,13 @@ node "gerrit.openstack.org", "review.openstack.org" { ssl_cert_file => '/etc/ssl/certs/review.openstack.org.pem', ssl_key_file => '/etc/ssl/private/review.openstack.org.key', ssl_chain_file => '/etc/ssl/certs/intermediate.pem', - email => "review@openstack.org", + email => 'review@openstack.org', + database_poollimit => '150', # 1 + 100 + 9 + 2 + 2 + 25 = 139(rounded up) + container_heaplimit => '8g', + core_packedgitopenfiles => '4096', + core_packedgitlimit => '400m', + core_packedgitwindowsize => '16k', + sshd_threads => '100', github_projects => [ { name => 'openstack/keystone', close_pull => 'true' diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index 703b7005c0..244d55d775 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -13,6 +13,16 @@ # The URL to use for OpenID in SSO mode. # email: # The email address Gerrit should use when sending mail. +# database_poollimit: +# container_heaplimit: +# core_packedgitopenfiles: +# core_packedgitlimit: +# core_packedgitwindowsize: +# sshd_threads: +# httpd_acceptorthreads: +# httpd_minthreads: +# httpd_maxthreads: +# Gerrit configuration options; see Gerrit docs. # commentlinks: # A list of regexes Gerrit should hyperlink. # logo: @@ -48,6 +58,15 @@ class gerrit($virtual_hostname='', $ssl_chain_file='', $openidssourl="https://login.launchpad.net/+openid", $email='', + $database_poollimit='', + $container_heaplimit='', + $core_packedgitopenfiles='', + $core_packedgitlimit='', + $core_packedgitwindowsize='', + $sshd_threads='', + $httpd_acceptorthreads='', + $httpd_minthreads='', + $httpd_maxthreads='', $github_projects = [], $upstream_projects = [], $commentlinks = [ { name => 'changeid', diff --git a/modules/gerrit/templates/gerrit.config.erb b/modules/gerrit/templates/gerrit.config.erb index e35c508a93..ad3fd2a770 100644 --- a/modules/gerrit/templates/gerrit.config.erb +++ b/modules/gerrit/templates/gerrit.config.erb @@ -9,7 +9,9 @@ hostname = localhost database = reviewdb username = gerrit2 - poolLimit = 32 +<% if database_poollimit != "" -%> + poolLimit = <%= database_poollimit %> +<% end -%> connectionpool = true [auth] type = OPENID_SSO @@ -21,12 +23,35 @@ [container] user = gerrit2 javaHome = /usr/lib/jvm/java-6-openjdk/jre +<% if container_heaplimit != "" -%> + heapLimit = <%= container_heaplimit %> +<% end -%> +[core] +<% if core_packedgitopenfiles != "" -%> + packedGitOpenFiles = <%= core_packedgitopenfiles %> +<% end -%> +<% if core_packedgitlimit != "" -%> + packedGitLimit = <%= core_packedgitlimit %> +<% end -%> +<% if core_packedgitwindowsize != "" -%> + packedGitWindowSize = <%= core_packedgitwindowsize %> +<% end -%> [sshd] listenAddress = *:29418 - threads = 24 +<% if sshd_threads != "" -%> + threads = <%= sshd_threads %> +<% end -%> [httpd] listenUrl = proxy-https://*:8081/ - acceptorThreads = 8 +<% if httpd_acceptorthreads != "" -%> + acceptorThreads = <%= httpd_acceptorthreads %> +<% end -%> +<% if httpd_minthreads != "" -%> + minThreads = <%= httpd_minthreads %> +<% end -%> +<% if httpd_maxthreads != "" -%> + maxThreads = <%= httpd_maxthreads %> +<% end -%> [cache] directory = cache [cache "web_sessions"]