supabase-postgres.git / summary / log / commit / refs
commit 05cecbbcf511fedb32e84d3f2d71b5d08d879a88
Author: Douglas J Hunley <doug.hunley@gmail.com>
Commit: GitHub <noreply@github.com>
Date: Mon Jun 29 15:48:09 2026 +0000
feat(ansible): add fs.file-max and fs.aio-max-nr to tuned profile (#2228)
* feat(ansible): add fs.file-max and fs.aio-max-nr to tuned profile
This update includes the addition of two key sysctl options to the
PostgreSQL tuned profile:
- fs.file-max: increased to 312139770
- fs.aio-max-nr: increased to 1048576
These changes are aimed at improving system-level performance and resource
availability for PostgreSQL. Minor formatting and linting adjustments are
also included to align with project standards.
* ci: trigger CI workflow with empty commit
ansible/tasks/setup-tuned.yml | 99 +++++++++++++++++++++++++------------------
1 file changed, 57 insertions(+), 42 deletions(-)
diff --git a/ansible/tasks/setup-tuned.yml b/ansible/tasks/setup-tuned.yml
index 622336ad..91bc0436 100644
--- a/ansible/tasks/setup-tuned.yml
+++ b/ansible/tasks/setup-tuned.yml
@@ -1,8 +1,8 @@
-- name: tuned - Install and configure tuned
+- name: 'tuned - Install and configure tuned' # noqa: name[casing]
when:
- (stage2_nix or nixpkg_mode or debpkg_mode)
block:
- - name: tuned - Install tuned
+ - name: 'tuned - Install tuned' # noqa: name[casing]
ansible.builtin.apt:
force_apt_get: true
name: 'tuned'
@@ -11,7 +11,7 @@
update_cache: true
become: true
- - name: tuned - Create a tuned profile directory
+ - name: 'tuned - Create a tuned profile directory' # noqa: name[casing]
ansible.builtin.file:
group: 'root'
mode: '0755'
@@ -20,7 +20,7 @@
state: 'directory'
become: true
- - name: tuned - Create a profile symlink for older tuned versions
+ - name: 'tuned - Create a profile symlink for older tuned versions' # noqa: name[casing]
ansible.builtin.file:
force: true
group: 'root'
@@ -31,8 +31,8 @@
state: 'link'
become: true
- - name: tuned - Create a tuned profile
- ansible.builtin.ini_file:
+ - name: 'tuned - Create a tuned profile' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -44,8 +44,8 @@
value: 'Tuned profile for PostgreSQL'
become: true
- - name: tuned - Disable Transparent Huge Pages (THP)
- ansible.builtin.ini_file:
+ - name: 'tuned - Disable Transparent Huge Pages (THP)' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -57,25 +57,21 @@
value: 'never'
become: true
- - name: tuned - Configure performance
- ansible.builtin.ini_file:
+ - name: 'tuned - Configure performance' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
no_extra_spaces: true
- option: "{{ perf_item['option'] }}"
+ option: 'governor'
path: '/etc/tuned/profiles/postgresql/tuned.conf'
- section: "{{ perf_item['section'] }}"
+ section: 'cpu'
state: 'present'
- value: "{{ perf_item['value'] }}"
+ value: 'performance'
become: true
- loop:
- - { option: 'governor', section: 'cpu', value: 'performance' }
- loop_control:
- loop_var: 'perf_item'
- - name: tuned - Configure Intel CPUs for maximum performance
- ansible.builtin.ini_file:
+ - name: 'tuned - Configure Intel CPUs for maximum performance' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -87,15 +83,19 @@
value: "{{ intel_item['value'] }}"
become: true
loop:
- - { option: 'energy_perf_bias', section: 'cpu', value: 'performance' }
- - { option: 'min_perf_pct', section: 'cpu', value: '100' }
+ - option: 'energy_perf_bias'
+ section: 'cpu'
+ value: 'performance'
+ - option: 'min_perf_pct'
+ section: 'cpu'
+ value: '100'
loop_control:
loop_var: 'intel_item'
when:
- ansible_facts['processor'][0] is search('GenuineIntel', ignorecase=True)
- - name: tuned - Set sysctl parameters
- ansible.builtin.ini_file:
+ - name: 'tuned - Set sysctl parameters' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -107,17 +107,27 @@
value: "{{ sysctl_item['value'] }}"
become: true
loop:
- - { option: 'net.ipv4.tcp_keepalive_intvl', value: '60' }
- - { option: 'net.ipv4.tcp_keepalive_time', value: '1800' }
- - { option: 'net.ipv4.ip_local_reserved_ports', value: '3000,3001,8085,9122,9187,9999' }
- - { option: 'net.ipv4.ip_local_port_range', value: '1025 65000' }
- - { option: 'vm.panic_on_oom', value: '1' }
- - { option: 'net.core.somaxconn', value: '16834' }
+ - option: 'fs.aio-max-nr'
+ value: '1048576'
+ - option: 'fs.file-max'
+ value: '312139770'
+ - option: 'net.core.somaxconn'
+ value: '16834'
+ - option: 'net.ipv4.ip_local_port_range'
+ value: '1025 65000'
+ - option: 'net.ipv4.ip_local_reserved_ports'
+ value: '3000,3001,8085,9122,9187,9999'
+ - option: 'net.ipv4.tcp_keepalive_intvl'
+ value: '60'
+ - option: 'net.ipv4.tcp_keepalive_time'
+ value: '1800'
+ - option: 'vm.panic_on_oom'
+ value: '1'
loop_control:
loop_var: 'sysctl_item'
- - name: tuned - Set kernel.panic=10
- ansible.builtin.ini_file:
+ - name: 'tuned - Set kernel.panic=10' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -131,12 +141,12 @@
when:
- (debpkg_mode or nixpkg_mode)
- - name: tuned - Enable zswap if swap is present
+ - name: 'tuned - Enable zswap if swap is present' # noqa: name[casing]
when:
- ansible_facts['swaptotal_mb'] > 0
block:
- - name: tuned - Decrease the kernel swappiness
- ansible.builtin.ini_file:
+ - name: 'tuned - Decrease the kernel swappiness' # noqa: name[casing]
+ community.general.ini_file:
create: true
group: 'root'
mode: '0644'
@@ -148,25 +158,30 @@
value: '10'
become: true
- - name: tuned - Load zstd compressor module
+ - name: 'tuned - Load zstd compressor module' # noqa: name[casing]
community.general.modprobe:
name: 'zstd'
persistent: 'present'
state: 'present'
become: true
- - name: tuned - Configure and enable zswap
+ - name: 'tuned - Configure and enable zswap' # noqa: name[casing]
ansible.builtin.shell:
cmd: "echo {{ zswap_item['value'] }} > /sys/module/zswap/parameters/{{ zswap_item['param'] }}"
+ changed_when: true
loop:
- - { param: 'compressor', value: 'zstd' }
- - { param: 'max_pool_percent', value: '10' }
- - { param: 'zpool', value: 'zsmalloc' }
- - { param: 'enabled', value: 'Y' }
+ - param: 'compressor'
+ value: 'zstd'
+ - param: 'max_pool_percent'
+ value: '10'
+ - param: 'zpool'
+ value: 'zsmalloc'
+ - param: 'enabled'
+ value: 'Y'
loop_control:
loop_var: 'zswap_item'
- - name: tuned - Activate the tuned service
+ - name: 'tuned - Activate the tuned service' # noqa: name[casing]
ansible.builtin.systemd_service:
daemon_reload: true
enabled: true
@@ -174,7 +189,7 @@
state: "{{ 'restarted' if stage2_nix else 'stopped' }}"
become: true
- - name: tuned - Activate the PostgreSQL tuned profile
+ - name: 'tuned - Activate the PostgreSQL tuned profile' # noqa: name[casing]
ansible.builtin.command:
cmd: 'tuned-adm profile postgresql'
become: true