meilisearch: add io limit

This commit is contained in:
2023-09-24 20:47:46 +08:00
parent ad7be5bc2b
commit 469b765f99
2 changed files with 11 additions and 1 deletions

View File

@@ -360,6 +360,7 @@
xrdp = { enable = true; hostname = "vps7.chn.moe"; };
vaultwarden.enable = true;
vaultwarden-proxy.enable = true;
meilisearch.ioLimitDevice = "/dev/mapper/root";
};
};})
];

View File

@@ -11,6 +11,7 @@ inputs:
};}));
default = {};
};
ioLimitDevice = mkOption { type = types.nullOr types.nonEmptyStr; default = null; };
};
config =
let
@@ -60,7 +61,15 @@ inputs:
IOWeight = 1;
Nice = 19;
Slice = "-.slice";
};
}
// (if meilisearch.ioLimitDevice != null then
{
IOReadBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
IOWriteBandwidthMax = "${meilisearch.ioLimitDevice} 20M";
# iostat -dx 1
IOReadIOPSMax = "${meilisearch.ioLimitDevice} 100";
IOWriteIOPSMax = "${meilisearch.ioLimitDevice} 100";
} else {});
};
})
(attrsToList meilisearch.instances));