commit af6a8bcc9bd629a7bc85f314085498f381adab5e
parent 4d0e2e512ade6ea12e84021e72d6a0ca98dac127
Author: MTRNord <mtrnord1@gmail.com>
Date: Mon, 4 Sep 2023 23:19:40 +0200
Smaller tweaks for perf
Diffstat:
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/nixos/common/server.nix b/nixos/common/server.nix
@@ -34,6 +34,7 @@
"net.ipv4.tcp_congestion_control" = "bbr";
"net.ipv4.conf.all.forwarding" = true;
"net.ipv6.conf.all.forwarding" = true;
+ "net.ipv4.tcp_tw_reuse" = 1;
};
# Ensure a clean & sparkling /tmp on fresh boots.
tmp.cleanOnBoot = true;
@@ -58,4 +59,19 @@
UseDns = false;
};
};
+
+ security.pam.loginLimits = [
+ {
+ domain = "*";
+ type = "hard";
+ item = "nofile";
+ value = "8192";
+ }
+ {
+ domain = "*";
+ type = "soft";
+ item = "nofile";
+ value = "8192";
+ }
+ ];
}
diff --git a/nixos/worker-1/configuration.nix b/nixos/worker-1/configuration.nix
@@ -350,7 +350,9 @@
enable = true;
config = ''
global
- maxconn 100
+ maxconn 300
+ nbthread 6
+ cpu-map 1/all 0-5
defaults
log global
@@ -358,7 +360,7 @@
retries 2
timeout client 30m
timeout connect 4s
- timeout server 30m
+ timeout server 1m
timeout check 5s
listen postgres
@@ -369,10 +371,8 @@
option httpchk
http-check expect status 200
default-server inter 3s fall 3 rise 2 on-marked-down shutdown-sessions
- server pgsql1 100.64.0.3:5432 maxconn 100 check port 8008
- server pgsql2 100.64.0.1:5432 maxconn 100 check port 8008
- server pg_new1 10.100.0.2:5432 maxconn 100 check port 8008
- server pg_new2 10.100.0.1:5432 maxconn 100 check port 8008
+ server pg_new1 10.100.0.2:5432 maxconn 300 check port 8008
+ server pg_new2 10.100.0.1:5432 maxconn 300 check port 8008
'';
};