[pmg-devel] [PATCH pmg-api] config: adjust max_filters calculation to reflect current memory usage

Markus Frank m.frank at proxmox.com
Wed Jan 10 12:56:54 CET 2024


One pmg-smtp-filter process uses at least 220 MiB.
When having 100000 rules one process can take up to 330 MiB.
Therefore using 300 for the calculation more closely
reflects the current memory usage of one filter process.

Related OOM killer problem found in forum:
https://forum.proxmox.com/threads/123531/

Signed-off-by: Markus Frank <m.frank at proxmox.com>
---
 src/PMG/Config.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PMG/Config.pm b/src/PMG/Config.pm
index 7339e0d..90e39bb 100644
--- a/src/PMG/Config.pm
+++ b/src/PMG/Config.pm
@@ -458,7 +458,7 @@ sub get_max_filters {
     # estimate optimal number of filter servers
 
     my $max_servers = 5;
-    my $servermem = 120;
+    my $servermem = 300;
     my $memory = physical_memory();
     my $add_servers = int(($memory - 512)/$servermem);
     $max_servers += $add_servers if $add_servers > 0;
-- 
2.39.2





More information about the pmg-devel mailing list