Skip to content

Commit

Permalink
postgresql: increase shared_buffers size
Browse files Browse the repository at this point in the history
  • Loading branch information
erikarvstedt committed Jul 6, 2022
1 parent 01f369d commit c4ff3fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deployment/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ ssh nixbitcoin.org :
# Remount already formatted storage
# <2-format-storage.sh ssh nixbitcoin.org 'bash -s remount'

# Determine and set `memorySizeGiB` in ../hardware.nix
ssh nixbitcoin.org free --gibi | awk '/Mem:/ { print $2 }'

# Optional: Generate config to update ../hardware.nix
makeConfig() {(
set -euxo pipefail
Expand Down
7 changes: 7 additions & 0 deletions hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
{ config, lib, pkgs, modulesPath, ... }:

let
memorySizeGiB = 64;

hetznerDedicated = {
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "sd_mod" ];
boot.kernelModules = [ "kvm-amd" ];
Expand Down Expand Up @@ -78,4 +80,9 @@ in
{ path = "/boot2"; devices = [ "/dev/sdb" ]; }
];
};

services.postgresql.settings.shared_buffers = let
size = memorySizeGiB / 4;
in
assert size >= 1; "${toString size}GB";
}

0 comments on commit c4ff3fa

Please sign in to comment.