AMI: Setup swap at stage2 not stage1 - #2381
Merged
Merged
Conversation
Collaborator
Author
|
depends on #2380 |
PostgreSQL Extension Dependency Analysis: PR #2381
SummaryNo extensions had dependencies with MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Extension DependenciesPostgreSQL 17 Extension DependenciesOrioleDB 17 Extension Dependencies |
PostgreSQL Package Dependency Analysis: PR #2381
SummaryNo packages had MAJOR version updates. Full Analysis ResultsPostgreSQL 15 Dependency ChangesExtracting PostgreSQL 15 dependencies...
Runtime Closure Size
Raw Dependency ClosurePostgreSQL 17 Dependency ChangesExtracting PostgreSQL 17 dependencies...
Runtime Closure Size
Raw Dependency Closure |
Having swap setup in stage1 uses up 10% of the disk while we need as much space as possible (for fetching, building, etc). We are extremely sensitive to cache clean up ordering so that we don't go over, but thats a big pain that can be allievated by moving swap to the end of the run. We run stage2 on beefy machines that don't need swap so lets use the space better.
mmlb
force-pushed
the
push-yzqyyqvttvkn
branch
from
August 24, 2026 14:51
d78cf31 to
6817eba
Compare
mmlb
marked this pull request as ready for review
August 24, 2026 14:51
mmlb
enabled auto-merge
August 24, 2026 16:22
hunleyd
approved these changes
Aug 24, 2026
| passno: "0" | ||
| state: present | ||
|
|
||
| - name: 'tuned - Decrease the kernel swappiness' # noqa: name[casing] |
Contributor
There was a problem hiding this comment.
the tuned - prefix was because this task was in the setup-tuned task. you can probably drop it :)
Contributor
There was a problem hiding this comment.
or, if you want to keep the convention, all tasks in this file should be name: swap - <foo>
Collaborator
Author
There was a problem hiding this comment.
ack, I'll ponder on what I want to do here and fixup in a follow up PR
hunleyd
added a commit
that referenced
this pull request
Aug 24, 2026
…claudemd * origin/develop: ansible: Setup swap in stage2 not stage1 (#2381)
2 tasks
hunleyd
added a commit
that referenced
this pull request
Aug 25, 2026
…nix-pkg-for-pgbackrest * origin/develop: (26 commits) chore(nix): remove LLVM JIT support from postgresql build (#2296) fix: cover pg_cron legacy extversion strings with alignment migration and alias scripts (#2300) docs: commit supabase/postgres's CLAUDE.md (#2395) ansible: Setup swap in stage2 not stage1 (#2381) ci: install AMI postgres profile via nix-env --set (#2309) images: clean up nix at end of process (#2393) ansible: Stop compiling binaries (#2382) Report final AMI disk usage to workflow job (#2384) Re-organize build scripts, add to shellcheck (#2380) feat: Do not hardcode `orioledb.main_buffers` in `postgresql.conf` (#2365) feat: add orioledb debug symbols (#2379) chore: Make postgresql.env optional in database-optimizations.service (#2372) feat: bump to PostgREST v14.17 (#2374) ansible: Bump versions to get new AMIs built (#2376) Revert PostgREST bump to v14.17 (#2371) fix: disable APT timers during Supabase upgrades (#2358) gha/nix-install-ephemeral: Actually copy to s3, not just echo it (#2369) feat: bump to PostgREST v14.17 (#2363) feat: add guest-to-host time synchronisation (#2364) ci: Add final job that depends on the important jobs (#2361) ...
hunleyd
added a commit
that referenced
this pull request
Aug 25, 2026
…chiving-on-customer-tier * origin/develop: (26 commits) chore(nix): remove LLVM JIT support from postgresql build (#2296) fix: cover pg_cron legacy extversion strings with alignment migration and alias scripts (#2300) docs: commit supabase/postgres's CLAUDE.md (#2395) ansible: Setup swap in stage2 not stage1 (#2381) ci: install AMI postgres profile via nix-env --set (#2309) images: clean up nix at end of process (#2393) ansible: Stop compiling binaries (#2382) Report final AMI disk usage to workflow job (#2384) Re-organize build scripts, add to shellcheck (#2380) feat: Do not hardcode `orioledb.main_buffers` in `postgresql.conf` (#2365) feat: add orioledb debug symbols (#2379) chore: Make postgresql.env optional in database-optimizations.service (#2372) feat: bump to PostgREST v14.17 (#2374) ansible: Bump versions to get new AMIs built (#2376) Revert PostgREST bump to v14.17 (#2371) fix: disable APT timers during Supabase upgrades (#2358) gha/nix-install-ephemeral: Actually copy to s3, not just echo it (#2369) feat: bump to PostgREST v14.17 (#2363) feat: add guest-to-host time synchronisation (#2364) ci: Add final job that depends on the important jobs (#2361) ...
hunleyd
added a commit
that referenced
this pull request
Aug 25, 2026
…c-spool-path-defaults-onto-the-10gb-root-volume * origin/develop: chore(nix): remove LLVM JIT support from postgresql build (#2296) fix: cover pg_cron legacy extversion strings with alignment migration and alias scripts (#2300) docs: commit supabase/postgres's CLAUDE.md (#2395) ansible: Setup swap in stage2 not stage1 (#2381) ci: install AMI postgres profile via nix-env --set (#2309) images: clean up nix at end of process (#2393) ansible: Stop compiling binaries (#2382)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Bug fix
What is the current behavior?
For AMI builds we setup 1G swap in stage1 which takes up 10% of the disk during stage2.
What is the new behavior?
Swap space is allocated/setup at the end of stage2's ansible run.
Additional context
The swap space isn't really necessary on these c6 machines with 32G of ram. We do end up running right up to the brink of available disk during builds/installs before cleaning out caches/gc and could put that 1G to better use there.