server: tweak postgresql to more caching

This commit is contained in:
Kabbone 2024-02-12 12:34:15 +01:00
parent f750968224
commit b37e0cdda5
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
2 changed files with 50 additions and 2 deletions

47
disko/nas_luks.nix Normal file
View File

@ -0,0 +1,47 @@
{
disko.devices = {
disk = {
sda = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
luks = {
size = "100%";
content = {
type = "luks";
name = "NAS-RAID";
askPassword = true;
# disable settings.keyFile if you want to use interactive password entry
#passwordFile = "/tmp/secret.key"; # Interactive
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [ "-f -L NAS-RAID" ];
subvolumes = {
"@" = {
mountpoint = "/mnt/Pluto";
mountOptions = [ "compress=zstd" "noatime" "ssd" "discard=async" ];
};
"@/Backups";
"@/Media";
"@/Games";
"@/IT";
"@/Rest";
"@snapshots" = {
mountpoint = "/mnt";
mountOptions = [ "compress=zstd" "noatime" "ssd" "discard=async" ];
};
};
};
};
};
};
};
};
};
};
}

View File

@ -12,8 +12,9 @@
max_connections = 200;
listen_addresses = "localhost";
password_encryption = "scram-sha-256";
shared_buffers = "512MB";
work_mem = "8MB";
shared_buffers = "2GB";
work_mem = "1GB";
maintence_work_mem = "500MB"
autovacuum_work_mem = -1;
min_wal_size = "1GB";
max_wal_size = "4GB";