Ver Fonte

prosody: make GC options configurable

Co-authored-by: Mustafa Ayberk Kale <mustafa.kale@turkcell.com.tr>
Mustafa Ayberk Kale há 2 anos atrás
pai
commit
832b178
2 ficheiros alterados com 29 adições e 0 exclusões
  1. 6 0
      docker-compose.yml
  2. 23 0
      prosody/rootfs/defaults/prosody.cfg.lua

+ 6 - 0
docker-compose.yml

@@ -171,6 +171,12 @@ services:
             - ENABLE_RECORDING
             - ENABLE_XMPP_WEBSOCKET
             - ENABLE_JAAS_COMPONENTS
+            - GC_TYPE
+            - GC_INC_TH
+            - GC_INC_SPEED
+            - GC_INC_STEP_SIZE
+            - GC_GEN_MIN_TH
+            - GC_GEN_MAX_TH
             - GLOBAL_CONFIG
             - GLOBAL_MODULES
             - JIBRI_RECORDER_USER

+ 23 - 0
prosody/rootfs/defaults/prosody.cfg.lua

@@ -1,6 +1,12 @@
 {{ $LOG_LEVEL := .Env.LOG_LEVEL | default "info" }}
 {{ $XMPP_PORT := .Env.XMPP_PORT | default "5222" -}}
 {{ $ENABLE_IPV6 := .Env.ENABLE_IPV6 | default "true" | toBool -}}
+{{ $GC_TYPE := .Env.GC_TYPE | default "incremental" -}}
+{{ $GC_INC_TH := .Env.GC_INC_TH | default 150 -}}
+{{ $GC_INC_SPEED := .Env.GC_INC_SPEED | default 250 -}}
+{{ $GC_INC_STEP_SIZE := .Env.GC_INC_STEP_SIZE | default 13 -}}
+{{ $GC_GEN_MIN_TH := .Env.GC_GEN_MIN_TH | default 20 -}}
+{{ $GC_GEN_MAX_TH := .Env.GC_GEN_MAX_TH | default 100 -}}
 
 -- Prosody Example Configuration File
 --
@@ -105,6 +111,23 @@ limits = {
   };
 }
 
+--Prosody garbage collector settings
+--For more information see https://prosody.im/doc/advanced_gc
+{{ if eq $GC_TYPE "generational" }}
+gc = {
+    mode = "generational";
+    minor_threshold = {{ $GC_GEN_MIN_TH }};
+    major_threshold = {{ $GC_GEN_MAX_TH }};
+}
+{{ else }}
+gc = {
+	mode = "incremental";
+	threshold = {{ $GC_INC_TH }};
+	speed = {{ $GC_INC_SPEED }};
+	step_size = {{ $GC_INC_STEP_SIZE }};
+}
+{{ end }}
+
 pidfile = "/config/data/prosody.pid";
 
 -- Force clients to use encrypted connections? This option will