diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2019-05-17 17:00:30 +0000 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-05-20 13:20:34 +0000 |
commit | 5c133d940c2b33bde0b7b1f47a925126e3e73861 (patch) | |
tree | 2b33e1ea21749b6ea06562caa3c24800844a91c1 /config | |
parent | 84336fa361fab28148992b791f616539908e4bdf (diff) | |
download | gitlab-ce-5c133d940c2b33bde0b7b1f47a925126e3e73861.tar.gz |
Merge branch '61376-add-documentation-about-how-to-enable-puma-web-server-for-installations-from-source' into 'master'
Add documentation about how to enable Puma web server for installations from source
Closes #61376
See merge request gitlab-org/gitlab-ce!28235
(cherry picked from commit 5ec4052281da296f40d6eec90301cbf44c93f5c4)
c06dfd9d Replace Unicorn with web server in the init.d script [ci skip]
95afca31 Add puma example for production [ci skip]
f2c6bfbe Add using Puma section to install from source [ci skip]
5ebf0492 Add Puma web server support to init.d file
aa7b053c Minor doc improvements to Puma instructions
29e49b45 Apply suggestion to doc/install/installation.md
6a691fa7 Apply suggestion to doc/install/installation.md
Diffstat (limited to 'config')
-rw-r--r-- | config/puma.rb.example | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/config/puma.rb.example b/config/puma.rb.example new file mode 100644 index 00000000000..6558dbc6cfe --- /dev/null +++ b/config/puma.rb.example @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Load "path" as a rackup file. +# +# The default is "config.ru". +# +rackup 'config.ru' +pidfile '/home/git/gitlab/tmp/pids/puma.pid' +state_path '/home/git/gitlab/tmp/pids/puma.state' + +stdout_redirect '/home/git/gitlab/log/puma.stdout.log', + '/home/git/gitlab/log/puma.stderr.log', + true + +# Configure "min" to be the minimum number of threads to use to answer +# requests and "max" the maximum. +# +# The default is "0, 16". +# +threads 1, 16 + +# By default, workers accept all requests and queue them to pass to handlers. +# When false, workers accept the number of simultaneous requests configured. +# +# Queueing requests generally improves performance, but can cause deadlocks if +# the app is waiting on a request to itself. See https://github.com/puma/puma/issues/612 +# +# When set to false this may require a reverse proxy to handle slow clients and +# queue requests before they reach puma. This is due to disabling HTTP keepalive +queue_requests false + +# Bind the server to "url". "tcp://", "unix://" and "ssl://" are the only +# accepted protocols. +bind 'unix:///home/git/gitlab/tmp/sockets/gitlab.socket' + +workers 3 + +require_relative "/home/git/gitlab/lib/gitlab/cluster/lifecycle_events" +require_relative "/home/git/gitlab/lib/gitlab/cluster/puma_worker_killer_initializer" + +on_restart do + # Signal application hooks that we're about to restart + Gitlab::Cluster::LifecycleEvents.do_master_restart +end + +before_fork do + # Signal to the puma killer + Gitlab::Cluster::PumaWorkerKillerInitializer.start @config.options unless ENV['DISABLE_PUMA_WORKER_KILLER'] + + # Signal application hooks that we're about to fork + Gitlab::Cluster::LifecycleEvents.do_before_fork +end + +Gitlab::Cluster::LifecycleEvents.set_puma_options @config.options +on_worker_boot do + # Signal application hooks of worker start + Gitlab::Cluster::LifecycleEvents.do_worker_start +end + +# Preload the application before starting the workers; this conflicts with +# phased restart feature. (off by default) +preload_app! + +tag 'gitlab-puma-worker' + +# Verifies that all workers have checked in to the master process within +# the given timeout. If not the worker process will be restarted. Default +# value is 60 seconds. +# +worker_timeout 60 |