Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f274bbf
perf: activate and configure zswap for postgresql tuned profile
hunleyd Mar 2, 2026
1a5edaa
Update ansible/tasks/setup-tuned.yml
hunleyd Mar 2, 2026
95bb6c3
Update ansible/tasks/setup-tuned.yml
hunleyd Mar 2, 2026
d4ec835
chore: bump ami version vars
hunleyd Mar 2, 2026
505ac54
Merge branch 'INDATA-488' of github.com:supabase/postgres into INDATA…
hunleyd Mar 2, 2026
a37fd90
Update ansible/tasks/setup-tuned.yml
hunleyd Mar 2, 2026
2af72c7
fix: spacing that GH editor messed up
hunleyd Mar 2, 2026
2bf6e1b
refactor: use modprobe module instead
hunleyd Mar 2, 2026
ee15152
fix: avoid an error on the GH runners due to missing kernel module
hunleyd Mar 2, 2026
0d19497
fix: the runners are also ubuntu, so just ignore if we cannot load this
hunleyd Mar 2, 2026
4201972
Merge branch 'develop' into INDATA-488
hunleyd Mar 2, 2026
40f3427
Merge branch 'develop' of github.com:supabase/postgres into INDATA-488
hunleyd Mar 5, 2026
7ef5d82
refactor(tuned): refactor based on feedback from Sam
hunleyd Mar 5, 2026
907d0ea
fix(tuned): errant quotes
hunleyd Mar 5, 2026
b069f72
Update vars.yml
hunleyd Mar 5, 2026
c972cf2
chore: bump to test
samrose Mar 5, 2026
52f7766
fix(tuned): switch from copy to lineinfil to avoid perm issues on the…
hunleyd Mar 5, 2026
545e5fd
Merge branch 'INDATA-488' of github.com:supabase/postgres into INDATA…
hunleyd Mar 5, 2026
a13ae9a
refactor(tuned): use command instead of lineinfile in case the origin…
hunleyd Mar 5, 2026
132ab05
chore: bump to release
samrose Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions ansible/tasks/setup-tuned.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,54 @@
when:
- ansible_facts['processor'][0] is search("GenuineIntel", ignorecase=True)

- name: tuned - Enable zswap if swap is present
when:
- ansible_facts['swaptotal_mb'] > 0
block:
- name: tuned - Decrease the kernel swappiness
become: true
community.general.ini_file:
create: true
group: 'root'
mode: '0644'
no_extra_spaces: true
option: 'vm.swappiness'
path: '/etc/tuned/profiles/postgresql/tuned.conf'
section: 'sysctl'
state: 'present'
value: 10

- name: tuned - Load zstd compressor module
become: true
community.general.modprobe:
name: 'zstd'
persistent: 'present'
state: 'present'

- name: tuned - Configure and enable zswap
ansible.builtin.shell:
cmd: "echo {{ zswap_item['value'] }} > /sys/module/zswap/parameters/{{ zswap_item['param'] }}"
loop:
- { 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 - Enable zswap at boot
become: true
community.general.ini_file:
create: true
group: 'root'
mode: '0644'
no_extra_spaces: true
option: 'cmdline_zswap'
path: '/etc/tuned/profiles/postgresql/tuned.conf'
section: 'bootloader'
state: 'present'
value: 'zswap.enabled=1 zswap.zpool=zsmalloc zswap.compressor=zstd zswap.max_pool_percent=10'

- name: Activate the tuned service
ansible.builtin.systemd_service:
daemon_reload: true
Expand Down
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.6.0.050-orioledb"
postgres17: "17.6.1.093"
postgres15: "15.14.1.093"
postgresorioledb-17: "17.6.0.052-orioledb"
postgres17: "17.6.1.095"
postgres15: "15.14.1.095"

# Non Postgres Extensions
pgbouncer_release: 1.25.1
Expand Down
11 changes: 11 additions & 0 deletions audit-specs/baselines/ami-build/kernel-param.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# kernel-param baseline for AMI build
# Checks that critical kernel parameters haven't changed
kernel-param:
vm.page-cluster:
value: '3' # kernel default; assert to catch if kernel upgrade changes it
kernel.panic:
value: '10' # set by setup-system.yml
vm.panic_on_oom:
value: '1' # set by setup-system.yml
vm.swappiness:
value: '10' # intentionally lowered from kernel default (60) for DB + zswap
Loading