+
+export const calculateKeepBufferOverhead = (coreCount: number): number => {
+ // TODO replace with exported server config
+ const buffersPerVCPU = 1;
+
+ // Returns 220 MiB + 64MiB+10% per buffer
+ return (220 << 20) + (buffersPerVCPU * coreCount * (1 << 26) * (11/10))
+};
+
+export const discountRamByPercent = (requestedRamBytes: number): number => {
+ // TODO replace this with exported server config or remove when no longer
+ // used by server in ram calculation
+ const discountPercent = 5;
+
+ return requestedRamBytes * 100 / (100-discountPercent);
+};