diff --git a/nixng/containers/hydra/postgresql.nix b/nixng/containers/hydra/postgresql.nix index cc0874a..b15e247 100644 --- a/nixng/containers/hydra/postgresql.nix +++ b/nixng/containers/hydra/postgresql.nix @@ -1,16 +1,21 @@ -{ makeSystem -, nixpkgs -}: -let - inherit (nixpkgs.lib) - singleton; +{ + makeSystem, + nixpkgs, +}: let + inherit + (nixpkgs.lib) + singleton + ; in -makeSystem { - system = "x86_64-linux"; - name = "nixng-hydra-postgresql"; - inherit nixpkgs; - config = { pkgs, config, ... }: - { + makeSystem { + system = "x86_64-linux"; + name = "nixng-hydra-postgresql"; + inherit nixpkgs; + config = { + pkgs, + config, + ... + }: { config = { dumb-init = { enable = true; @@ -26,12 +31,36 @@ makeSystem { authentication = "host all all all md5"; 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 = { - "pg_trgm" = [ "hydra" ]; + "pg_trgm" = ["hydra"]; }; ensureUsers = singleton { name = "hydra"; @@ -42,4 +71,4 @@ makeSystem { }; }; }; -} + } diff --git a/terranix/containers/hydra/job.hcl b/terranix/containers/hydra/job.hcl index 1fd4708..6279a4e 100644 --- a/terranix/containers/hydra/job.hcl +++ b/terranix/containers/hydra/job.hcl @@ -186,8 +186,8 @@ EOF resources { cpu = 500 - memory = 128 - memory_max = 256 + memory = 1024 + memory_max = 1024 } template {