-
Notifications
You must be signed in to change notification settings - Fork 1
Staging pgtune #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: stable/sap/3.0
Are you sure you want to change the base?
Staging pgtune #49
Conversation
This recipe contains fine-tuning to make sure that postgresql is configured the correct way on the node is being deployed to (in terms of memory usage, for instance). (cherry picked from commit acf6a53)
There are a couple of fixes that we want from https://github.com/sous-chefs/postgresql/blob/master/recipes/config_pgtune.rb (cherry picked from commit bc7292280dccd5e89721ec0869fc69662cff096f)
Now that we enable the config_pgtune recipe, the max_connection settings must live there. This mostly reverts 251a5de. (cherry picked from commit 42d14f66336caf0b0d88541f919da3fcef054790)
|
|
||
| def downgrade(ta, td, a, d) | ||
| if ta["postgresql"]["config"].key?("max_connections") | ||
| a["postgresql"]["config"]["max_connections"] = a["postgresql"]["config_pgtune"]["max_connections"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| def upgrade(ta, td, a, d) | ||
| a["postgresql"]["config_pgtune"] ||= {} | ||
| unless a["postgresql"]["config_pgtune"].key?("max_connections") | ||
| a["postgresql"]["config_pgtune"]["max_connections"] = a["postgresql"]["config"]["max_connections"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| "dw" => 500, | ||
| "mixed" => 100, | ||
| "desktop" => 100, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => 100, | ||
| "dw" => 500, | ||
| "mixed" => 100, | ||
| "desktop" => 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| "dw" => "0.9", | ||
| "mixed" => "0.9", | ||
| "desktop" => "0.5", | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => mem / 16, | ||
| "dw" => mem / 8, | ||
| "mixed" => mem / 16, | ||
| "desktop" => mem / 16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| "dw" => mem_con_v / 2, | ||
| "mixed" => mem_con_v / 2, | ||
| "desktop" => mem_con_v / 6, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => mem_con_v, | ||
| "dw" => mem_con_v / 2, | ||
| "mixed" => mem_con_v / 2, | ||
| "desktop" => mem_con_v / 6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| }.fetch(db_type) | ||
|
|
||
| node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size*1024*1024) | ||
| node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size * 1024 * 1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [112/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| "dw" => mem * 3 / 4, | ||
| "mixed" => mem * 3 / 4, | ||
| "desktop" => mem / 4, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
|
|
||
| def downgrade(ta, td, a, d) | ||
| if ta["postgresql"]["config"].key?("max_connections") | ||
| a["postgresql"]["config"]["max_connections"] = a["postgresql"]["config_pgtune"]["max_connections"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| def upgrade(ta, td, a, d) | ||
| a["postgresql"]["config_pgtune"] ||= {} | ||
| unless a["postgresql"]["config_pgtune"].key?("max_connections") | ||
| a["postgresql"]["config_pgtune"]["max_connections"] = a["postgresql"]["config"]["max_connections"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| "dw" => 500, | ||
| "mixed" => 100, | ||
| "desktop" => 100, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => 100, | ||
| "dw" => 500, | ||
| "mixed" => 100, | ||
| "desktop" => 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| "dw" => "0.9", | ||
| "mixed" => "0.9", | ||
| "desktop" => "0.5", | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => mem / 16, | ||
| "dw" => mem / 8, | ||
| "mixed" => mem / 16, | ||
| "desktop" => mem / 16, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| "dw" => mem_con_v / 2, | ||
| "mixed" => mem_con_v / 2, | ||
| "desktop" => mem_con_v / 6, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
| "oltp" => mem_con_v, | ||
| "dw" => mem_con_v / 2, | ||
| "mixed" => mem_con_v / 2, | ||
| "desktop" => mem_con_v / 6, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)
| }.fetch(db_type) | ||
|
|
||
| node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size*1024*1024) | ||
| node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size * 1024 * 1024) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [112/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)
| "dw" => mem * 3 / 4, | ||
| "mixed" => mem * 3 / 4, | ||
| "desktop" => mem / 4, | ||
| }.fetch(db_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.
This is the re-based version of #20
In order to be able to re-trigger the CI