Commit 2a60cecf12aea3d47dc3385b28f6d6930e2f09fb

Authored by Antonio Terceiro
2 parents 07e70955 344faa3e

Merge branch 'performance'

config/cdtc/config.yaml
... ... @@ -12,4 +12,3 @@ relay_hostname: relay.spb.cdtc.unb.br
12 12 relay_ip: 164.41.9.48
13 13 alt_ssh_port: 55555
14 14 from_address: noreply@spb.cdtc.unb.br
15   -colab_http_workers: 4
... ...
config/dev/config.yaml
... ... @@ -16,4 +16,3 @@ alt_ssh_port: 55555
16 16 external_outgoing_mail_domain: serpro.gov.br
17 17 raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19
18 18 google_analytics_id: 'UA-64206731-2'
19   -colab_http_workers: 8
... ...
config/homologa/config.yaml
... ... @@ -17,4 +17,3 @@ external_outgoing_mail_relay: 189.9.150.53
17 17 external_outgoing_mail_domain: serpro.gov.br
18 18 raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19
19 19 google_analytics_id: 'UA-64206731-3'
20   -colab_http_workers: 8
... ...
config/lappis/config.yaml
... ... @@ -12,4 +12,4 @@ relay_hostname: relay.softwarepublico.lappis
12 12 relay_ip: 10.0.0.15
13 13 alt_ssh_port: 5555
14 14 from_address: noreply@softwarepublico.lappis
15   -colab_http_workers: 4
  15 +
... ...
config/local/config.yaml
... ... @@ -13,4 +13,3 @@ relay_ip: 10.10.10.3
13 13 alt_ssh_port: 5555
14 14 from_address: noreply@softwarepublico.dev
15 15 raven_dsn: https://a5e2f92a83774dfc9de66486e0fe970b:1a9229a4e1d2483582144d302fb53115@sentry.tracy.com.br/19
16   -colab_http_workers: 2
... ...
config/prod/config.yaml
... ... @@ -18,4 +18,3 @@ external_outgoing_mail_domain: serpro.gov.br
18 18 raven_dsn: https://4418146896924efe9b73d557f803f047:8a59f39b5f584ff589ecf3dd47faaead@sentry.tracy.com.br/13
19 19 google_analytics_id: 'UA-64206731-1'
20 20 munin_master: 10.21.0.10
21   -colab_http_workers: 16
... ...
cookbooks/colab/templates/colab.erb
1   -WEB_CONCURRENCY=<%= node['config']['colab_http_workers'] %>
  1 +WEB_CONCURRENCY=<%= `nproc`.to_i * 2 %>
... ...
cookbooks/gitlab/files/unicorn.rb
... ... @@ -16,7 +16,7 @@ ENV[&#39;RAILS_RELATIVE_URL_ROOT&#39;] = &quot;/gitlab&quot;
16 16 # Read about unicorn workers here:
17 17 # http://doc.gitlab.com/ee/install/requirements.html#unicorn-workers
18 18 #
19   -worker_processes 2
  19 +worker_processes `nproc`.to_i
20 20  
21 21 # Since Unicorn is never exposed to outside clients, it does not need to
22 22 # run on the standard HTTP port (80), there is no reason to start Unicorn
... ...
cookbooks/postgresql/templates/centos/postgresql.conf.erb
1 1 listen_addresses = 'localhost,<%= node['peers']['database'] %>'
2 2  
3   -# TODO optimize these settings
  3 +<% ram = `awk '{ if ($1 == "MemTotal:") {print($2) } }' /proc/meminfo`.to_i %>
4 4  
5   -max_connections = 100 # (change requires restart)
6   -shared_buffers = 32MB # min 128kB
  5 +#######################################################################
  6 +# performance optimization settings
  7 +#######################################################################
  8 +shared_buffers = <%= (0.1 * ram).to_i %>kB # 10% of RAM for shared buffers
  9 +effective_cache_size = <%= (0.8 * ram).to_i %>kB # 80% of RAM for cache
  10 +
  11 +#######################################################################
  12 +# other settings
  13 +#######################################################################
  14 +max_connections = 500 # (change requires restart)
7 15 logging_collector = on # Enable capturing of stderr and csvlog
8 16 log_filename = 'postgresql-%a.log' # log file name pattern,
9 17 log_truncate_on_rotation = on # If on, an existing log file with the
... ...