From 8f29782ef37cd3ae18a61e91b344c6845260eba7 Mon Sep 17 00:00:00 2001 From: SuperQ Date: Mon, 14 Nov 2022 16:01:38 +0100 Subject: [PATCH] Reduce the mmap minimum size Reduce the initial mmap file size from 1MiB to 64KiB. This should reduce the memory and disk overhead for larger numbers of multiprocess workers. Signed-off-by: SuperQ --- prometheus_client/mmap_dict.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus_client/mmap_dict.py b/prometheus_client/mmap_dict.py index e8b2df9e..5c8e0fbd 100644 --- a/prometheus_client/mmap_dict.py +++ b/prometheus_client/mmap_dict.py @@ -3,7 +3,7 @@ import os import struct -_INITIAL_MMAP_SIZE = 1 << 20 +_INITIAL_MMAP_SIZE = 1 << 16 _pack_integer_func = struct.Struct(b'i').pack _pack_double_func = struct.Struct(b'd').pack _unpack_integer = struct.Struct(b'i').unpack_from