Skip to content

Commit

Permalink
Limit varnish memory on explorer backends.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgi committed Nov 29, 2021
1 parent 1d661f9 commit 5bc8e13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/explorer.nix
Expand Up @@ -65,6 +65,8 @@ in {

services.varnish = {
enable = globals.withSmash;
extraModules = [ pkgs.varnish-modules ];
extraCommandLine = "-s malloc,${toString (config.node.memory * 1024 / 4)}M";
config = ''
vcl 4.1;
Expand Down Expand Up @@ -643,6 +645,9 @@ in {
});
};

# Ensure the worker processes don't hit TCP file descriptor limits
systemd.services.nginx.serviceConfig.LimitNOFILE = 65535;

# Avoid flooding (and rotating too quicky) default journal with nginx logs:
# nginx logs: journalctl --namespace nginx
systemd.services.nginx.serviceConfig.LogNamespace = "nginx";
Expand Down

0 comments on commit 5bc8e13

Please sign in to comment.