rubber 1.7.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. data/CHANGELOG +6 -0
  2. data/VERSION +1 -1
  3. data/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +3 -3
  4. data/generators/vulcanize/templates/base/config/rubber/rubber.yml +8 -0
  5. data/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +2 -2
  6. data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +0 -1
  7. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +1 -0
  8. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +4 -2
  9. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +6 -0
  10. data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +3 -3
  11. data/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +43 -16
  12. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf +7 -0
  13. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +270 -243
  14. data/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +3 -3
  15. data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +44 -5
  16. data/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +222 -43
  17. data/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +5 -0
  18. data/lib/generators/vulcanize/templates/base/config/rubber/rubber-rvm.yml +3 -3
  19. data/lib/generators/vulcanize/templates/base/config/rubber/rubber.yml +8 -0
  20. data/lib/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +2 -2
  21. data/lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +0 -1
  22. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +1 -0
  23. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +4 -2
  24. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +6 -0
  25. data/lib/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +3 -3
  26. data/lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +43 -16
  27. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/munin-postgresql.conf +7 -0
  28. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +270 -243
  29. data/lib/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +3 -3
  30. data/lib/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +44 -5
  31. data/lib/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +222 -43
  32. data/lib/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +5 -0
  33. data/lib/rubber/cloud/aws.rb +7 -0
  34. data/lib/rubber/recipes/rubber/instances.rb +8 -0
  35. data/lib/rubber/recipes/rubber/tags.rb +12 -0
  36. data/lib/rubber/recipes/rubber/volumes.rb +5 -4
  37. data/lib/rubber/tag.rb +16 -0
  38. data/lib/rubber/tasks/rubber.rb +1 -1
  39. metadata +14 -10
@@ -204,6 +204,13 @@ staging_roles: "web,app,db:primary=true"
204
204
  # zone: us-east-1a # zone to create volume in, needs to match host's zone
205
205
  # device: /dev/sdy # OS device to attach volume to
206
206
  #
207
+ # # Use some ephemeral volumes for raid array
208
+ # local_volumes:
209
+ # - partition_device: /dev/sdb
210
+ # zero: false # zeros out disk for improved performance
211
+ # - partition_device: /dev/sdc
212
+ # zero: false # zeros out disk for improved performance
213
+ #
207
214
  # # for raid array, you'll need to add mdadm to packages. Likewise,
208
215
  # # xfsprogs is needed for xfs filesystem support
209
216
  # packages: [xfsprogs, mdadm]
@@ -211,6 +218,7 @@ staging_roles: "web,app,db:primary=true"
211
218
  # - device: /dev/md0 # OS device to to create raid array on
212
219
  # mount: /mnt/fast # The directory to mount this array to
213
220
  # filesystem: xfs # the filesystem to create on array
221
+ # filesystem_opts: -f # the filesystem opts in mkfs
214
222
  # raid_level: 0 # the raid level to use for the array
215
223
  # source_devices: [/dev/sdx, /dev/sdy] # the source EBS devices we are creating raid array from
216
224
 
@@ -137,8 +137,8 @@ namespace :rubber do
137
137
  task :custom_install_munin, :roles => [:mysql_master, :mysql_slave] do
138
138
  rubber.sudo_script 'install_munin_mysql', <<-ENDSCRIPT
139
139
  if [ ! -f /usr/share/munin/plugins/mysql_ ]; then
140
- wget -qN -O /usr/share/munin/plugins/mysql_ http://github.com/kjellm/munin-mysql/raw/master/mysql_
141
- wget -qN -O /etc/munin/plugin-conf.d/mysql_.conf http://github.com/kjellm/munin-mysql/raw/master/mysql_.conf
140
+ wget --no-check-certificate -qN -O /usr/share/munin/plugins/mysql_ https://github.com/kjellm/munin-mysql/raw/master/mysql_
141
+ wget --no-check-certificate -qN -O /etc/munin/plugin-conf.d/mysql_.conf https://github.com/kjellm/munin-mysql/raw/master/mysql_.conf
142
142
  fi
143
143
  ENDSCRIPT
144
144
  end
@@ -11,7 +11,6 @@ namespace :rubber do
11
11
  rubber.sudo_script 'install_passenger', <<-ENDSCRIPT
12
12
  if [[ -z `ls #{rubber_env.passenger_lib} 2> /dev/null` ]]; then
13
13
  echo -en "\n\n\n\n" | passenger-install-apache2-module
14
- rvm #{rubber_env.rvm_ruby} --passenger
15
14
  fi
16
15
  ENDSCRIPT
17
16
  end
@@ -2,6 +2,7 @@
2
2
  @path = '/etc/sudoers'
3
3
  @additive = ["# munin passenger start", "# munin passenger end"]
4
4
  %>
5
+ Defaults env_keep = GEM_PATH
5
6
 
6
7
  nobody ALL=(ALL) NOPASSWD: <%= rubber_env.rvm_gem_home %>/bin/passenger-status
7
8
  nobody ALL=(ALL) NOPASSWD: <%= rubber_env.rvm_gem_home %>/bin/passenger-memory-stats
@@ -19,7 +19,6 @@ Listen <%= port %>
19
19
  SetEnvIf User-Agent "^(.*MSIE.*)|(.*AppleWebKit.*)$" nokeepalive
20
20
 
21
21
  RailsEnv <%= RUBBER_ENV %>
22
- RailsAllowModRewrite on
23
22
 
24
23
  RewriteEngine On
25
24
  RewriteCond %{HTTP_HOST} ^<%= rubber_env.domain %>$
@@ -43,4 +42,7 @@ Listen <%= port %>
43
42
 
44
43
  </VirtualHost>
45
44
 
46
- <% end %>
45
+ <% end %>
46
+
47
+ # The host here needs to match ServerName.
48
+ PassengerPreStart http://<%= rubber_env.domain %>:<%= rubber_env.passenger_listen_port %>/
@@ -10,6 +10,9 @@ PassengerUseGlobalQueue on
10
10
  # max number of rails instances per appserver
11
11
  PassengerMaxPoolSize <%= rubber_env.max_app_connections %>
12
12
 
13
+ # min number of rails instances per appserver (by setting this as the max, we make sure we only wait for workers to spawn on the first request)
14
+ PassengerMinInstances <%= rubber_env.max_app_connections %>
15
+
13
16
  # Use PassengerMaxPoolSize for limit as we only have 1 app
14
17
  PassengerMaxInstancesPerApp 0
15
18
 
@@ -33,3 +36,6 @@ RailsFrameworkSpawnerIdleTime 0
33
36
 
34
37
  # For performances sake, don't ever unload app spawner
35
38
  RailsAppSpawnerIdleTime 0
39
+
40
+ # Don't show the friendly error pages in production because it could leak information the public shouldn't see.
41
+ PassengerFriendlyErrorPages <%= RUBBER_ENV == 'production' ? 'off' : 'on' %>
@@ -1,6 +1,6 @@
1
- passenger_version: 2.2.11
1
+ passenger_version: 3.0.1
2
2
  passenger_root: "#{rvm_gem_home}/gems/passenger-#{passenger_version}"
3
- passenger_ruby: "#{ruby_prefix}/bin/passenger_ruby"
3
+ passenger_ruby: "#{rvm_prefix}/wrappers/#{`bash -l -c 'rvm strings #{rvm_ruby}'`.strip}/ruby"
4
4
  passenger_lib: "#{passenger_root}/ext/apache2/mod_passenger.so"
5
5
  passenger_listen_port: 7000
6
6
  passenger_listen_ssl_port: 7001
@@ -11,5 +11,5 @@ role_dependencies:
11
11
 
12
12
  roles:
13
13
  passenger:
14
- packages: [apache2-mpm-prefork, apache2-prefork-dev]
14
+ packages: [apache2-mpm-prefork, apache2-prefork-dev, libcurl4-openssl-dev]
15
15
  gems: [fastthread, rack, [passenger, "#{passenger_version}"]]
@@ -1,33 +1,39 @@
1
1
 
2
2
  namespace :rubber do
3
-
3
+
4
4
  namespace :postgresql do
5
-
5
+
6
6
  rubber.allow_optional_tasks(self)
7
-
7
+
8
+ before "rubber:install_packages", "rubber:postgresql:setup_apt_sources"
9
+
10
+ task :setup_apt_sources, :roles => :redis do
11
+ rsudo "add-apt-repository ppa:pitti/postgresql"
12
+ end
13
+
8
14
  after "rubber:create", "rubber:postgresql:validate_db_roles"
9
15
 
10
16
  task :validate_db_roles do
11
17
  db_instances = rubber_instances.for_role("postgresql_slave")
12
18
  db_instances.each do |instance|
13
19
  if instance.role_names.find {|n| n == 'postgresql_master'}
14
- fatal "Cannot have a postgresql slave and master on the same instance, please removing slave role for #{instance.name}"
20
+ fatal "Cannot have a postgresql slave and master on the same instance, please remove slave role for #{instance.name}"
15
21
  end
16
22
  end
17
23
  end
18
24
 
19
25
  after "rubber:bootstrap", "rubber:postgresql:bootstrap"
20
-
21
-
26
+
27
+
22
28
  # Bootstrap the production database config. Db bootstrap is special - the
23
29
  # user could be requiring the rails env inside some of their config
24
30
  # templates, which creates a catch 22 situation with the db, so we try and
25
31
  # bootstrap the db separate from the rest of the config
26
32
  task :bootstrap, :roles => [:postgresql_master, :postgresql_slave] do
27
-
28
- # Conditionaly bootstrap for each node/role only if that node has not
33
+
34
+ # Conditionally bootstrap for each node/role only if that node has not
29
35
  # been boostrapped for that role before
30
- master_instances = rubber_instances.for_role("postgresql_master") & rubber_instances.filtered
36
+ master_instances = rubber_instances.for_role("postgresql_master") & rubber_instances.filtered
31
37
  master_instances.each do |ic|
32
38
  task_name = "_bootstrap_postgresql_master_#{ic.full_name}".to_sym()
33
39
  task task_name, :hosts => ic.full_name do
@@ -47,7 +53,7 @@ namespace :rubber do
47
53
  send task_name
48
54
  end
49
55
 
50
- # Wait for postgresql 9.0 to be avlabel before allowing slaves
56
+ # Wait for postgresql 9.0 to be available before allowing slaves
51
57
  #
52
58
  # slave_instances = rubber_instances.for_role("postgresql_slave") & rubber_instances.filtered
53
59
  # slave_instances.each do |ic|
@@ -77,14 +83,35 @@ namespace :rubber do
77
83
  # end
78
84
  # send task_name
79
85
  # end
80
-
86
+
87
+ end
88
+
89
+ after "rubber:munin:custom_install", "rubber:postgresql:install_munin_plugins"
90
+ after "rubber:postgresql:install_munin_plugins", "rubber:munin:restart"
91
+ task :install_munin_plugins, :roles => [:postgresql_master, :postgresql_slave] do
92
+ regular_plugins = %w[bgwriter checkpoints connections_db users xlog]
93
+ parameterized_plugins = %w[cache connections locks querylength scans transactions tuples]
94
+
95
+ commands = ['rm -f /etc/munin/plugins/postgres_*']
96
+
97
+ regular_plugins.each do |name|
98
+ commands << "ln -s /usr/share/munin/plugins/postgres_#{name} /etc/munin/plugins/postgres_#{name}"
99
+ end
100
+
101
+ parameterized_plugins.each do |name|
102
+ commands << "ln -s /usr/share/munin/plugins/postgres_#{name}_ /etc/munin/plugins/postgres_#{name}_#{rubber_env.db_name}"
103
+ end
104
+
105
+ rubber.sudo_script "install_postgresql_munin_plugins", <<-ENDSCRIPT
106
+ #{commands.join(';')}
107
+ ENDSCRIPT
81
108
  end
82
-
109
+
83
110
  # TODO: Make the setup/update happen just once per host
84
111
  def common_bootstrap(role)
85
112
  # postgresql package install starts postgresql, so stop it
86
113
  rsudo "#{rubber_env.postgresql_ctl} stop" rescue nil
87
-
114
+
88
115
  # After everything installed on machines, we need the source tree
89
116
  # on hosts in order to run rubber:config for bootstrapping the db
90
117
  rubber.update_code_for_bootstrap
@@ -104,21 +131,21 @@ namespace :rubber do
104
131
  ENDSCRIPT
105
132
  sleep 5
106
133
  end
107
-
134
+
108
135
  desc <<-DESC
109
136
  Starts the postgresql daemons
110
137
  DESC
111
138
  task :start, :roles => [:postgresql_master, :postgresql_slave] do
112
139
  rsudo "#{rubber_env.postgresql_ctl} start"
113
140
  end
114
-
141
+
115
142
  desc <<-DESC
116
143
  Stops the postgresql daemons
117
144
  DESC
118
145
  task :stop, :roles => [:postgresql_master, :postgresql_slave] do
119
146
  rsudo "#{rubber_env.postgresql_ctl} stop"
120
147
  end
121
-
148
+
122
149
  desc <<-DESC
123
150
  Restarts the postgresql daemons
124
151
  DESC
@@ -0,0 +1,7 @@
1
+ <%
2
+ @path = '/etc/munin/plugin-conf.d/postgresql'
3
+ %>
4
+
5
+ [postgres_*]
6
+ user postgres
7
+ env.PGUSER postgres
@@ -41,16 +41,16 @@
41
41
  # The default values of these variables are driven from the -D command-line
42
42
  # option or PGDATA environment variable, represented here as ConfigDir.
43
43
 
44
- data_directory = '<%= rubber_env.postgresql_data_dir %>' # use data in another directory
45
- # (change requires restart)
46
- hba_file = '<%= rubber_env.postgresql_conf_dir %>/pg_hba.conf' # host-based authentication file
47
- # (change requires restart)
48
- ident_file = '<%= rubber_env.postgresql_conf_dir %>/pg_ident.conf' # ident configuration file
49
- # (change requires restart)
44
+ data_directory = '<%= rubber_env.postgresql_data_dir %>' # use data in another directory
45
+ # (change requires restart)
46
+ hba_file = '<%= rubber_env.postgresql_conf_dir %>/pg_hba.conf' # host-based authentication file
47
+ # (change requires restart)
48
+ ident_file = '<%= rubber_env.postgresql_conf_dir %>/pg_ident.conf' # ident configuration file
49
+ # (change requires restart)
50
50
 
51
51
  # If external_pid_file is not explicitly set, no extra PID file is written.
52
- external_pid_file = '<%= rubber_env.postgresql_pid_file %>' # write an extra PID file
53
- # (change requires restart)
52
+ external_pid_file = '<%= rubber_env.postgresql_pid_file %>' # write an extra PID file
53
+ # (change requires restart)
54
54
 
55
55
 
56
56
  #------------------------------------------------------------------------------
@@ -59,46 +59,48 @@ external_pid_file = '<%= rubber_env.postgresql_pid_file %>' # write an extra
59
59
 
60
60
  # - Connection Settings -
61
61
 
62
- listen_addresses = '*' # what IP address(es) to listen on;
63
- # comma-separated list of addresses;
64
- # defaults to 'localhost', '*' = all
65
- # (change requires restart)
66
- port = 5432 # (change requires restart)
67
- max_connections = 100 # (change requires restart)
68
- # Note: Increasing max_connections costs ~400 bytes of shared memory per
62
+ listen_addresses = '*' # what IP address(es) to listen on;
63
+ # comma-separated list of addresses;
64
+ # defaults to 'localhost', '*' = all
65
+ # (change requires restart)
66
+ port = 5432 # (change requires restart)
67
+ max_connections = 100 # (change requires restart)
68
+ # Note: Increasing max_connections costs ~400 bytes of shared memory per
69
69
  # connection slot, plus lock space (see max_locks_per_transaction).
70
- #superuser_reserved_connections = 3 # (change requires restart)
71
- unix_socket_directory = '/var/run/postgresql' # (change requires restart)
72
- #unix_socket_group = '' # (change requires restart)
73
- #unix_socket_permissions = 0777 # begin with 0 to use octal notation
74
- # (change requires restart)
75
- #bonjour_name = '' # defaults to the computer name
76
- # (change requires restart)
70
+ #superuser_reserved_connections = 3 # (change requires restart)
71
+ unix_socket_directory = '/var/run/postgresql' # (change requires restart)
72
+ #unix_socket_group = '' # (change requires restart)
73
+ #unix_socket_permissions = 0777 # begin with 0 to use octal notation
74
+ # (change requires restart)
75
+ #bonjour = off # advertise server via Bonjour
76
+ # (change requires restart)
77
+ #bonjour_name = '' # defaults to the computer name
78
+ # (change requires restart)
77
79
 
78
80
  # - Security and Authentication -
79
81
 
80
- #authentication_timeout = 1min # 1s-600s
81
- #ssl = true # (change requires restart)
82
- #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
83
- # (change requires restart)
84
- #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
82
+ #authentication_timeout = 1min # 1s-600s
83
+ #ssl = off # (change requires restart)
84
+ #ssl_ciphers = 'ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH' # allowed SSL ciphers
85
+ # (change requires restart)
86
+ #ssl_renegotiation_limit = 512MB # amount of data between renegotiations
85
87
  #password_encryption = on
86
88
  #db_user_namespace = off
87
89
 
88
90
  # Kerberos and GSSAPI
89
91
  #krb_server_keyfile = ''
90
- #krb_srvname = 'postgres' # (Kerberos only)
92
+ #krb_srvname = 'postgres' # (Kerberos only)
91
93
  #krb_caseins_users = off
92
94
 
93
95
  # - TCP Keepalives -
94
96
  # see "man 7 tcp" for details
95
97
 
96
- #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
97
- # 0 selects the system default
98
- #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
99
- # 0 selects the system default
100
- #tcp_keepalives_count = 0 # TCP_KEEPCNT;
101
- # 0 selects the system default
98
+ #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds;
99
+ # 0 selects the system default
100
+ #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds;
101
+ # 0 selects the system default
102
+ #tcp_keepalives_count = 0 # TCP_KEEPCNT;
103
+ # 0 selects the system default
102
104
 
103
105
 
104
106
  #------------------------------------------------------------------------------
@@ -107,42 +109,42 @@ unix_socket_directory = '/var/run/postgresql' # (change requires restart)
107
109
 
108
110
  # - Memory -
109
111
 
110
- shared_buffers = 28MB # min 128kB
111
- # (change requires restart)
112
- #temp_buffers = 8MB # min 800kB
113
- #max_prepared_transactions = 0 # zero disables the feature
114
- # (change requires restart)
112
+ shared_buffers = 28MB # min 128kB
113
+ # (change requires restart)
114
+ #temp_buffers = 8MB # min 800kB
115
+ #max_prepared_transactions = 0 # zero disables the feature
116
+ # (change requires restart)
115
117
  # Note: Increasing max_prepared_transactions costs ~600 bytes of shared memory
116
118
  # per transaction slot, plus lock space (see max_locks_per_transaction).
117
119
  # It is not advisable to set max_prepared_transactions nonzero unless you
118
120
  # actively intend to use prepared transactions.
119
- #work_mem = 1MB # min 64kB
120
- #maintenance_work_mem = 16MB # min 1MB
121
- #max_stack_depth = 2MB # min 100kB
121
+ #work_mem = 1MB # min 64kB
122
+ #maintenance_work_mem = 16MB # min 1MB
123
+ #max_stack_depth = 2MB # min 100kB
122
124
 
123
125
  # - Kernel Resource Usage -
124
126
 
125
- #max_files_per_process = 1000 # min 25
126
- # (change requires restart)
127
- #shared_preload_libraries = '' # (change requires restart)
127
+ #max_files_per_process = 1000 # min 25
128
+ # (change requires restart)
129
+ #shared_preload_libraries = '' # (change requires restart)
128
130
 
129
131
  # - Cost-Based Vacuum Delay -
130
132
 
131
- #vacuum_cost_delay = 0ms # 0-100 milliseconds
132
- #vacuum_cost_page_hit = 1 # 0-10000 credits
133
- #vacuum_cost_page_miss = 10 # 0-10000 credits
134
- #vacuum_cost_page_dirty = 20 # 0-10000 credits
135
- #vacuum_cost_limit = 200 # 1-10000 credits
133
+ #vacuum_cost_delay = 0ms # 0-100 milliseconds
134
+ #vacuum_cost_page_hit = 1 # 0-10000 credits
135
+ #vacuum_cost_page_miss = 10 # 0-10000 credits
136
+ #vacuum_cost_page_dirty = 20 # 0-10000 credits
137
+ #vacuum_cost_limit = 200 # 1-10000 credits
136
138
 
137
139
  # - Background Writer -
138
140
 
139
- #bgwriter_delay = 200ms # 10-10000ms between rounds
140
- #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
141
- #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
141
+ #bgwriter_delay = 200ms # 10-10000ms between rounds
142
+ #bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
143
+ #bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round
142
144
 
143
145
  # - Asynchronous Behavior -
144
146
 
145
- #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
147
+ #effective_io_concurrency = 1 # 1-1000. 0 disables prefetching
146
148
 
147
149
 
148
150
  #------------------------------------------------------------------------------
@@ -151,37 +153,58 @@ shared_buffers = 28MB # min 128kB
151
153
 
152
154
  # - Settings -
153
155
 
154
- #fsync = on # turns forced synchronization on or off
155
- #synchronous_commit = on # immediate fsync at commit
156
- #wal_sync_method = fsync # the default is the first option
157
- # supported by the operating system:
158
- # open_datasync
159
- # fdatasync
160
- # fsync
161
- # fsync_writethrough
162
- # open_sync
163
- #full_page_writes = on # recover from partial page writes
164
- #wal_buffers = 64kB # min 32kB
165
- # (change requires restart)
166
- #wal_writer_delay = 200ms # 1-10000 milliseconds
167
-
168
- #commit_delay = 0 # range 0-100000, in microseconds
169
- #commit_siblings = 5 # range 1-1000
156
+ #wal_level = minimal # minimal, archive, or hot_standby
157
+ # (change requires restart)
158
+ #fsync = on # turns forced synchronization on or off
159
+ #synchronous_commit = on # immediate fsync at commit
160
+ #wal_sync_method = fsync # the default is the first option
161
+ # supported by the operating system:
162
+ # open_datasync
163
+ # fdatasync
164
+ # fsync
165
+ # fsync_writethrough
166
+ # open_sync
167
+ #full_page_writes = on # recover from partial page writes
168
+ #wal_buffers = 64kB # min 32kB
169
+ # (change requires restart)
170
+ #wal_writer_delay = 200ms # 1-10000 milliseconds
171
+
172
+ #commit_delay = 0 # range 0-100000, in microseconds
173
+ #commit_siblings = 5 # range 1-1000
170
174
 
171
175
  # - Checkpoints -
172
176
 
173
- #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
174
- #checkpoint_timeout = 5min # range 30s-1h
175
- #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
176
- #checkpoint_warning = 30s # 0 disables
177
+ #checkpoint_segments = 3 # in logfile segments, min 1, 16MB each
178
+ #checkpoint_timeout = 5min # range 30s-1h
179
+ #checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
180
+ #checkpoint_warning = 30s # 0 disables
177
181
 
178
182
  # - Archiving -
179
183
 
180
- #archive_mode = off # allows archiving to be done
181
- # (change requires restart)
182
- #archive_command = 'cp -i %p <%= rubber_env.postgresql_archive_dir %>/%f </dev/null' # command to use to archive a logfile segment
183
- #archive_timeout = 300 # force a logfile segment switch after this
184
- # number of seconds; 0 disables
184
+ #archive_mode = off # allows archiving to be done
185
+ # (change requires restart)
186
+ #archive_command = '' # command to use to archive a logfile segment
187
+ #archive_timeout = 0 # force a logfile segment switch after this
188
+ # number of seconds; 0 disables
189
+
190
+ # - Streaming Replication -
191
+
192
+ #max_wal_senders = 0 # max number of walsender processes
193
+ # (change requires restart)
194
+ #wal_sender_delay = 200ms # walsender cycle time, 1-10000 milliseconds
195
+ #wal_keep_segments = 0 # in logfile segments, 16MB each; 0 disables
196
+ #vacuum_defer_cleanup_age = 0 # number of xacts by which cleanup is delayed
197
+
198
+ # - Standby Servers -
199
+
200
+ #hot_standby = off # "on" allows queries during recovery
201
+ # (change requires restart)
202
+ #max_standby_archive_delay = 30s # max delay before canceling queries
203
+ # when reading WAL from archive;
204
+ # -1 allows indefinite delay
205
+ #max_standby_streaming_delay = 30s # max delay before canceling queries
206
+ # when reading streaming WAL;
207
+ # -1 allows indefinite delay
185
208
 
186
209
 
187
210
  #------------------------------------------------------------------------------
@@ -194,6 +217,7 @@ shared_buffers = 28MB # min 128kB
194
217
  #enable_hashagg = on
195
218
  #enable_hashjoin = on
196
219
  #enable_indexscan = on
220
+ #enable_material = on
197
221
  #enable_mergejoin = on
198
222
  #enable_nestloop = on
199
223
  #enable_seqscan = on
@@ -202,30 +226,31 @@ shared_buffers = 28MB # min 128kB
202
226
 
203
227
  # - Planner Cost Constants -
204
228
 
205
- #seq_page_cost = 1.0 # measured on an arbitrary scale
206
- #random_page_cost = 4.0 # same scale as above
207
- #cpu_tuple_cost = 0.01 # same scale as above
208
- #cpu_index_tuple_cost = 0.005 # same scale as above
209
- #cpu_operator_cost = 0.0025 # same scale as above
229
+ #seq_page_cost = 1.0 # measured on an arbitrary scale
230
+ #random_page_cost = 4.0 # same scale as above
231
+ #cpu_tuple_cost = 0.01 # same scale as above
232
+ #cpu_index_tuple_cost = 0.005 # same scale as above
233
+ #cpu_operator_cost = 0.0025 # same scale as above
210
234
  #effective_cache_size = 128MB
211
235
 
212
236
  # - Genetic Query Optimizer -
213
237
 
214
238
  #geqo = on
215
239
  #geqo_threshold = 12
216
- #geqo_effort = 5 # range 1-10
217
- #geqo_pool_size = 0 # selects default based on effort
218
- #geqo_generations = 0 # selects default based on effort
219
- #geqo_selection_bias = 2.0 # range 1.5-2.0
240
+ #geqo_effort = 5 # range 1-10
241
+ #geqo_pool_size = 0 # selects default based on effort
242
+ #geqo_generations = 0 # selects default based on effort
243
+ #geqo_selection_bias = 2.0 # range 1.5-2.0
244
+ #geqo_seed = 0.0 # range 0.0-1.0
220
245
 
221
246
  # - Other Planner Options -
222
247
 
223
- #default_statistics_target = 100 # range 1-10000
224
- #constraint_exclusion = partition # on, off, or partition
225
- #cursor_tuple_fraction = 0.1 # range 0.0-1.0
248
+ #default_statistics_target = 100 # range 1-10000
249
+ #constraint_exclusion = partition # on, off, or partition
250
+ #cursor_tuple_fraction = 0.1 # range 0.0-1.0
226
251
  #from_collapse_limit = 8
227
- #join_collapse_limit = 8 # 1 disables collapsing of explicit
228
- # JOIN clauses
252
+ #join_collapse_limit = 8 # 1 disables collapsing of explicit
253
+ # JOIN clauses
229
254
 
230
255
 
231
256
  #------------------------------------------------------------------------------
@@ -234,93 +259,91 @@ shared_buffers = 28MB # min 128kB
234
259
 
235
260
  # - Where to Log -
236
261
 
237
- #log_destination = 'stderr' # Valid values are combinations of
238
- # stderr, csvlog, syslog and eventlog,
239
- # depending on platform. csvlog
240
- # requires logging_collector to be on.
262
+ #log_destination = 'stderr' # Valid values are combinations of
263
+ # stderr, csvlog, syslog, and eventlog,
264
+ # depending on platform. csvlog
265
+ # requires logging_collector to be on.
241
266
 
242
267
  # This is used when logging to stderr:
243
- #logging_collector = off # Enable capturing of stderr and csvlog
244
- # into log files. Required to be on for
245
- # csvlogs.
246
- # (change requires restart)
268
+ #logging_collector = off # Enable capturing of stderr and csvlog
269
+ # into log files. Required to be on for
270
+ # csvlogs.
271
+ # (change requires restart)
247
272
 
248
273
  # These are only used if logging_collector is on:
249
- #log_directory = 'pg_log' # directory where log files are written,
250
- # can be absolute or relative to PGDATA
251
- #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
252
- # can include strftime() escapes
253
- #log_truncate_on_rotation = off # If on, an existing log file of the
254
- # same name as the new log file will be
255
- # truncated rather than appended to.
256
- # But such truncation only occurs on
257
- # time-driven rotation, not on restarts
258
- # or size-driven rotation. Default is
259
- # off, meaning append to existing files
260
- # in all cases.
261
- #log_rotation_age = 1d # Automatic rotation of logfiles will
262
- # happen after that time. 0 disables.
263
- #log_rotation_size = 10MB # Automatic rotation of logfiles will
264
- # happen after that much log output.
265
- # 0 disables.
274
+ #log_directory = 'pg_log' # directory where log files are written,
275
+ # can be absolute or relative to PGDATA
276
+ #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
277
+ # can include strftime() escapes
278
+ #log_truncate_on_rotation = off # If on, an existing log file of the
279
+ # same name as the new log file will be
280
+ # truncated rather than appended to.
281
+ # But such truncation only occurs on
282
+ # time-driven rotation, not on restarts
283
+ # or size-driven rotation. Default is
284
+ # off, meaning append to existing files
285
+ # in all cases.
286
+ #log_rotation_age = 1d # Automatic rotation of logfiles will
287
+ # happen after that time. 0 disables.
288
+ #log_rotation_size = 10MB # Automatic rotation of logfiles will
289
+ # happen after that much log output.
290
+ # 0 disables.
266
291
 
267
292
  # These are relevant when logging to syslog:
268
293
  #syslog_facility = 'LOCAL0'
269
294
  #syslog_ident = 'postgres'
270
295
 
271
- #silent_mode = off # Run server silently.
272
- # DO NOT USE without syslog or
273
- # logging_collector
274
- # (change requires restart)
296
+ #silent_mode = off # Run server silently.
297
+ # DO NOT USE without syslog or
298
+ # logging_collector
299
+ # (change requires restart)
275
300
 
276
301
 
277
302
  # - When to Log -
278
303
 
279
- #client_min_messages = notice # values in order of decreasing detail:
280
- # debug5
281
- # debug4
282
- # debug3
283
- # debug2
284
- # debug1
285
- # log
286
- # notice
287
- # warning
288
- # error
289
-
290
- #log_min_messages = warning # values in order of decreasing detail:
291
- # debug5
292
- # debug4
293
- # debug3
294
- # debug2
295
- # debug1
296
- # info
297
- # notice
298
- # warning
299
- # error
300
- # log
301
- # fatal
302
- # panic
303
-
304
- #log_error_verbosity = default # terse, default, or verbose messages
305
-
306
- #log_min_error_statement = error # values in order of decreasing detail:
307
- # debug5
308
- # debug4
309
- # debug3
310
- # debug2
311
- # debug1
312
- # info
313
- # notice
314
- # warning
315
- # error
316
- # log
317
- # fatal
318
- # panic (effectively off)
319
-
320
- log_min_duration_statement = 1 # -1 is disabled, 0 logs all statements
321
- # and their durations, > 0 logs only
322
- # statements running at least this number
323
- # of milliseconds
304
+ #client_min_messages = notice # values in order of decreasing detail:
305
+ # debug5
306
+ # debug4
307
+ # debug3
308
+ # debug2
309
+ # debug1
310
+ # log
311
+ # notice
312
+ # warning
313
+ # error
314
+
315
+ #log_min_messages = warning # values in order of decreasing detail:
316
+ # debug5
317
+ # debug4
318
+ # debug3
319
+ # debug2
320
+ # debug1
321
+ # info
322
+ # notice
323
+ # warning
324
+ # error
325
+ # log
326
+ # fatal
327
+ # panic
328
+
329
+ #log_min_error_statement = error # values in order of decreasing detail:
330
+ # debug5
331
+ # debug4
332
+ # debug3
333
+ # debug2
334
+ # debug1
335
+ # info
336
+ # notice
337
+ # warning
338
+ # error
339
+ # log
340
+ # fatal
341
+ # panic (effectively off)
342
+
343
+ log_min_duration_statement = 1 # -1 is disabled, 0 logs all statements
344
+ # and their durations, > 0 logs only
345
+ # statements running at least this number
346
+ # of milliseconds
324
347
 
325
348
 
326
349
  # - What to Log -
@@ -333,32 +356,35 @@ log_min_duration_statement = 1 # -1 is disabled, 0 logs all statements
333
356
  #log_connections = off
334
357
  #log_disconnections = off
335
358
  #log_duration = off
359
+ #log_error_verbosity = default # terse, default, or verbose messages
336
360
  #log_hostname = off
337
- log_line_prefix = '%t ' # special values:
338
- # %u = user name
339
- # %d = database name
340
- # %r = remote host and port
341
- # %h = remote host
342
- # %p = process ID
343
- # %t = timestamp without milliseconds
344
- # %m = timestamp with milliseconds
345
- # %i = command tag
346
- # %c = session ID
347
- # %l = session line number
348
- # %s = session start timestamp
349
- # %v = virtual transaction ID
350
- # %x = transaction ID (0 if none)
351
- # %q = stop here in non-session
352
- # processes
353
- # %% = '%'
354
- # e.g. '<%u%%%d> '
355
- #log_lock_waits = off # log lock waits >= deadlock_timeout
356
- #log_statement = 'none' # none, ddl, mod, all
357
- #log_temp_files = -1 # log temporary files equal or larger
358
- # than the specified size in kilobytes;
359
- # -1 disables, 0 logs all temp files
360
- #log_timezone = unknown # actually, defaults to TZ environment
361
- # setting
361
+ log_line_prefix = '%t' # special values:
362
+ # %a = application name
363
+ # %u = user name
364
+ # %d = database name
365
+ # %r = remote host and port
366
+ # %h = remote host
367
+ # %p = process ID
368
+ # %t = timestamp without milliseconds
369
+ # %m = timestamp with milliseconds
370
+ # %i = command tag
371
+ # %e = SQL state
372
+ # %c = session ID
373
+ # %l = session line number
374
+ # %s = session start timestamp
375
+ # %v = virtual transaction ID
376
+ # %x = transaction ID (0 if none)
377
+ # %q = stop here in non-session
378
+ # processes
379
+ # %% = '%'
380
+ # e.g. '<%u%%%d> '
381
+ #log_lock_waits = off # log lock waits >= deadlock_timeout
382
+ #log_statement = 'none' # none, ddl, mod, all
383
+ #log_temp_files = -1 # log temporary files equal or larger
384
+ # than the specified size in kilobytes;
385
+ # -1 disables, 0 logs all temp files
386
+ #log_timezone = unknown # actually, defaults to TZ environment
387
+ # setting
362
388
 
363
389
 
364
390
  #------------------------------------------------------------------------------
@@ -369,8 +395,8 @@ log_line_prefix = '%t ' # special values:
369
395
 
370
396
  #track_activities = on
371
397
  track_counts = on
372
- #track_functions = none # none, pl, all
373
- #track_activity_query_size = 1024
398
+ #track_functions = none # none, pl, all
399
+ #track_activity_query_size = 1024 # (change requires restart)
374
400
  #update_process_title = on
375
401
  #stats_temp_directory = 'pg_stat_tmp'
376
402
 
@@ -387,28 +413,29 @@ track_counts = on
387
413
  # AUTOVACUUM PARAMETERS
388
414
  #------------------------------------------------------------------------------
389
415
 
390
- autovacuum = on # Enable autovacuum subprocess? 'on'
391
- # requires track_counts to also be on.
392
- #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
393
- # their durations, > 0 logs only
394
- # actions running at least this number
395
- # of milliseconds.
396
- #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
397
- #autovacuum_naptime = 1min # time between autovacuum runs
398
- #autovacuum_vacuum_threshold = 50 # min number of row updates before
399
- # vacuum
400
- #autovacuum_analyze_threshold = 50 # min number of row updates before
401
- # analyze
402
- #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
403
- #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
404
- #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
405
- # (change requires restart)
406
- #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
407
- # autovacuum, in milliseconds;
408
- # -1 means use vacuum_cost_delay
409
- #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
410
- # autovacuum, -1 means use
411
- # vacuum_cost_limit
416
+ autovacuum = on # Enable autovacuum subprocess? 'on'
417
+ # requires track_counts to also be on.
418
+ #log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
419
+ # their durations, > 0 logs only
420
+ # actions running at least this number
421
+ # of milliseconds.
422
+ #autovacuum_max_workers = 3 # max number of autovacuum subprocesses
423
+ # (change requires restart)
424
+ #autovacuum_naptime = 1min # time between autovacuum runs
425
+ #autovacuum_vacuum_threshold = 50 # min number of row updates before
426
+ # vacuum
427
+ #autovacuum_analyze_threshold = 50 # min number of row updates before
428
+ # analyze
429
+ #autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
430
+ #autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
431
+ #autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
432
+ # (change requires restart)
433
+ #autovacuum_vacuum_cost_delay = 20ms # default vacuum cost delay for
434
+ # autovacuum, in milliseconds;
435
+ # -1 means use vacuum_cost_delay
436
+ #autovacuum_vacuum_cost_limit = -1 # default vacuum cost limit for
437
+ # autovacuum, -1 means use
438
+ # vacuum_cost_limit
412
439
 
413
440
 
414
441
  #------------------------------------------------------------------------------
@@ -417,17 +444,18 @@ autovacuum = on # Enable autovacuum subprocess? 'on'
417
444
 
418
445
  # - Statement Behavior -
419
446
 
420
- #search_path = '"$user",public' # schema names
421
- #default_tablespace = '' # a tablespace name, '' uses the default
422
- #temp_tablespaces = '' # a list of tablespace names, '' uses
423
- # only default tablespace
447
+ #search_path = '"$user",public' # schema names
448
+ #default_tablespace = '' # a tablespace name, '' uses the default
449
+ #temp_tablespaces = '' # a list of tablespace names, '' uses
450
+ # only default tablespace
424
451
  #check_function_bodies = on
425
452
  #default_transaction_isolation = 'read committed'
426
453
  #default_transaction_read_only = off
427
454
  #session_replication_role = 'origin'
428
- #statement_timeout = 0 # in milliseconds, 0 is disabled
455
+ #statement_timeout = 0 # in milliseconds, 0 is disabled
429
456
  #vacuum_freeze_min_age = 50000000
430
457
  #vacuum_freeze_table_age = 150000000
458
+ #bytea_output = 'hex' # hex, escape
431
459
  #xmlbinary = 'base64'
432
460
  #xmloption = 'content'
433
461
 
@@ -435,25 +463,25 @@ autovacuum = on # Enable autovacuum subprocess? 'on'
435
463
 
436
464
  datestyle = 'iso, mdy'
437
465
  #intervalstyle = 'postgres'
438
- #timezone = unknown # actually, defaults to TZ environment
439
- # setting
466
+ #timezone = unknown # actually, defaults to TZ environment
467
+ # setting
440
468
  #timezone_abbreviations = 'Default' # Select the set of available time zone
441
- # abbreviations. Currently, there are
442
- # Default
443
- # Australia
444
- # India
445
- # You can create your own file in
446
- # share/timezonesets/.
447
- #extra_float_digits = 0 # min -15, max 2
448
- #client_encoding = sql_ascii # actually, defaults to database
449
- # encoding
469
+ # abbreviations. Currently, there are
470
+ # Default
471
+ # Australia
472
+ # India
473
+ # You can create your own file in
474
+ # share/timezonesets/.
475
+ #extra_float_digits = 0 # min -15, max 3
476
+ #client_encoding = sql_ascii # actually, defaults to database
477
+ # encoding
450
478
 
451
479
  # These settings are initialized by initdb, but they can be changed.
452
- lc_messages = 'en_US.UTF-8' # locale for system error message
453
- # strings
454
- lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
455
- lc_numeric = 'en_US.UTF-8' # locale for number formatting
456
- lc_time = 'en_US.UTF-8' # locale for time formatting
480
+ lc_messages = 'en_US.UTF-8' # locale for system error message
481
+ # strings
482
+ lc_monetary = 'en_US.UTF-8' # locale for monetary formatting
483
+ lc_numeric = 'en_US.UTF-8' # locale for number formatting
484
+ lc_time = 'en_US.UTF-8' # locale for time formatting
457
485
 
458
486
  # default configuration for text search
459
487
  default_text_search_config = 'pg_catalog.english'
@@ -469,8 +497,8 @@ default_text_search_config = 'pg_catalog.english'
469
497
  #------------------------------------------------------------------------------
470
498
 
471
499
  #deadlock_timeout = 1s
472
- #max_locks_per_transaction = 64 # min 10
473
- # (change requires restart)
500
+ #max_locks_per_transaction = 64 # min 10
501
+ # (change requires restart)
474
502
  # Note: Each lock table slot uses ~270 bytes of shared memory, and there are
475
503
  # max_locks_per_transaction * (max_connections + max_prepared_transactions)
476
504
  # lock table slots.
@@ -482,12 +510,11 @@ default_text_search_config = 'pg_catalog.english'
482
510
 
483
511
  # - Previous PostgreSQL Versions -
484
512
 
485
- #add_missing_from = off
486
513
  #array_nulls = on
487
- #backslash_quote = safe_encoding # on, off, or safe_encoding
514
+ #backslash_quote = safe_encoding # on, off, or safe_encoding
488
515
  #default_with_oids = off
489
516
  #escape_string_warning = on
490
- #regex_flavor = advanced # advanced, extended, or basic
517
+ #lo_compat_privileges = off
491
518
  #sql_inheritance = on
492
519
  #standard_conforming_strings = off
493
520
  #synchronize_seqscans = on
@@ -501,4 +528,4 @@ default_text_search_config = 'pg_catalog.english'
501
528
  # CUSTOMIZED OPTIONS
502
529
  #------------------------------------------------------------------------------
503
530
 
504
- #custom_variable_classes = '' # list of custom variable class names
531
+ #custom_variable_classes = '' # list of custom variable class names