mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
Attempt to tune PSQL for Hydra
Signed-off-by: magic_rb <magic_rb@redalder.org>
This commit is contained in:
parent
50ebadd844
commit
a92d44383d
|
@ -1,16 +1,21 @@
|
||||||
{ makeSystem
|
{
|
||||||
, nixpkgs
|
makeSystem,
|
||||||
}:
|
nixpkgs,
|
||||||
let
|
}: let
|
||||||
inherit (nixpkgs.lib)
|
inherit
|
||||||
singleton;
|
(nixpkgs.lib)
|
||||||
|
singleton
|
||||||
|
;
|
||||||
in
|
in
|
||||||
makeSystem {
|
makeSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
name = "nixng-hydra-postgresql";
|
name = "nixng-hydra-postgresql";
|
||||||
inherit nixpkgs;
|
inherit nixpkgs;
|
||||||
config = { pkgs, config, ... }:
|
config = {
|
||||||
{
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
config = {
|
config = {
|
||||||
dumb-init = {
|
dumb-init = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -26,12 +31,36 @@ makeSystem {
|
||||||
authentication = "host all all all md5";
|
authentication = "host all all all md5";
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
max_connections = 1024;
|
# DB Version: 12
|
||||||
|
# OS Type: linux
|
||||||
|
# DB Type: mixed
|
||||||
|
# Total Memory (RAM): 1 GB
|
||||||
|
# CPUs num: 12
|
||||||
|
# Connections num: 512
|
||||||
|
# Data Storage: hdd
|
||||||
|
|
||||||
|
max_connections = 512;
|
||||||
|
shared_buffers = "256 MB";
|
||||||
|
effective_cache_size = "768 MB";
|
||||||
|
maintenance_work_mem = "64 MB";
|
||||||
|
checkpoint_completion_target = 0.9;
|
||||||
|
wal_buffers = "7864 kB";
|
||||||
|
default_statistics_target = 100;
|
||||||
|
random_page_cost = 4;
|
||||||
|
effective_io_concurrency = 2;
|
||||||
|
work_mem = "64 kB";
|
||||||
|
huge_pages = "off";
|
||||||
|
min_wal_size = "1 GB";
|
||||||
|
max_wal_size = "4 GB";
|
||||||
|
max_worker_processes = 12;
|
||||||
|
max_parallel_workers_per_gather = 4;
|
||||||
|
max_parallel_workers = 12;
|
||||||
|
max_parallel_maintenance_workers = 4;
|
||||||
};
|
};
|
||||||
|
|
||||||
ensureDatabases = [ "hydra" ];
|
ensureDatabases = ["hydra"];
|
||||||
ensureExtensions = {
|
ensureExtensions = {
|
||||||
"pg_trgm" = [ "hydra" ];
|
"pg_trgm" = ["hydra"];
|
||||||
};
|
};
|
||||||
ensureUsers = singleton {
|
ensureUsers = singleton {
|
||||||
name = "hydra";
|
name = "hydra";
|
||||||
|
@ -42,4 +71,4 @@ makeSystem {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,8 +186,8 @@ EOF
|
||||||
|
|
||||||
resources {
|
resources {
|
||||||
cpu = 500
|
cpu = 500
|
||||||
memory = 128
|
memory = 1024
|
||||||
memory_max = 256
|
memory_max = 1024
|
||||||
}
|
}
|
||||||
|
|
||||||
template {
|
template {
|
||||||
|
|
Loading…
Reference in a new issue