feat(users/flokli/nixos-tvix-cache): put metadata on SSD

Move the Directory and PathInfo storage to the SSD, and only bind-mount
the blob storage from the HDD.

This should improve IO for random access.

Change-Id: Icf9408a879dec8a52541953682ffac25b31e73d3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12921
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
This commit is contained in:
Florian Klink 2024-12-27 12:46:22 +01:00 committed by clbot
parent 22023fdc8d
commit b2a2225b8b

View file

@ -107,22 +107,22 @@
};
systemd.tmpfiles.rules = [
# Put the data in the big disk
# Put the blobs on the big disk
"d /tank/nar-bridge 0755 nar-bridge nar-bridge -"
"d /tank/nar-bridge/blobs.object_store 0755 nar-bridge nar-bridge -"
# Cache responses on NVME
"d /var/cache/nginx 0755 ${config.services.nginx.user} ${config.services.nginx.group} -"
];
fileSystems."/var/lib/nar-bridge" = {
device = "/tank/nar-bridge";
options = [
"bind"
"nofail"
];
};
systemd.services.nar-bridge = {
unitConfig.RequiresMountsFor = "/var/lib/nar-bridge";
unitConfig = {
# Keep most data on the SSD which is at /var/lib/nar-bridge, but bind-mount the blobs in
RequiresMountsFor = "/tank";
BindPaths = [
"/tank/nar-bridge/blobs.object_store:/var/lib/nar-bridge/blobs.object_store"
];
};
# twice the normal allowed limit, same as nix-daemon
serviceConfig.LimitNOFILE = "1048576";
};