From 340f993b64975fdd5c878a98d179783984cb9790 Mon Sep 17 00:00:00 2001 From: Jiping Yin Date: Sun, 29 Sep 2024 16:28:07 +0800 Subject: [PATCH] Add map_prealloc_disabled to template.yaml --- server/agent_config/example.yaml | 19 ++++++++++--------- server/agent_config/template.yaml | 21 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/server/agent_config/example.yaml b/server/agent_config/example.yaml index 29dcd50a175..4494f361d13 100644 --- a/server/agent_config/example.yaml +++ b/server/agent_config/example.yaml @@ -1477,15 +1477,6 @@ static_config: # The configuration is only effective if DWARF is enabled. dwarf-shard-map-size: 128 - # Disable the feature of pre-allocating memory during hash map creation - # Default: false - # Note: - # When full map preallocation is too expensive, setting 'map_prealloc_disabled' to true will - # prevent memory pre-allocation during map definition, but it may result in some performance - # degradation. This configuration only applies to maps of type 'BPF_MAP_TYPE_HASH'. - # Currently applicable to socket trace and uprobe Golang/OpenSSL trace functionalities. - map_prealloc_disabled: false - # Java compliant update latency time # Default: 60s. Range: [5, 3600]s # Note: @@ -1650,6 +1641,16 @@ static_config: # eBPF hook on the CPU consumption of the application process. syscall-trace-id-disabled: false + # Disable Pre-allocating Memory + # Default: false + # Note: + # When full map preallocation is too expensive, setting 'map_prealloc_disabled' to true will + # prevent memory pre-allocation during map definition, but it may result in some performance + # degradation. This configuration only applies to maps of type 'BPF_MAP_TYPE_HASH'. + # Currently applicable to socket trace and uprobe Golang/OpenSSL trace functionalities. + # Disabling memory preallocation will reduce memory usage by approximately 60MB. + map-prealloc-disabled: false + ###################################### ## Agent Running in Standalone Mode ## ###################################### diff --git a/server/agent_config/template.yaml b/server/agent_config/template.yaml index aea301823be..a4cafe2dbd9 100644 --- a/server/agent_config/template.yaml +++ b/server/agent_config/template.yaml @@ -2339,6 +2339,27 @@ inputs: # 当 trace_id 注入所有请求时,所有请求的 syscall_trace_id 计算逻辑可以关闭。这将大大减少 # eBPF hook 进程的 CPU 消耗。 syscall_trace_id_disabled: false + # type: bool + # name: + # en: Disable Pre-allocating Memory + # ch: 禁用预分配内存 + # unit: + # range: [] + # enum_options: [] + # modification: agent_restart + # ee_feature: false + # description: + # en: |- + # When full map preallocation is too expensive, setting 'map_prealloc_disabled' to true will + # prevent memory pre-allocation during map definition, but it may result in some performance + # degradation. This configuration only applies to maps of type 'BPF_MAP_TYPE_HASH'. + # Currently applicable to socket trace and uprobe Golang/OpenSSL trace functionalities. + # Disabling memory preallocation will approximately reduce memory usage by 60MB. + # ch: |- + # 当完整的map预分配过于昂贵时,将 `map_prealloc_disabled` 设置为 true 可以防止在定义map时进行 + # 内存预分配,但这可能会导致一些性能下降。此配置仅适用于 `BPF_MAP_TYPE_HASH` 类型的 bpf map。 + # 目前适用于 socket trace 和 uprobe Golang/OpenSSL trace 功能。禁用内存预分配大约会减少60M的内存占用。 + map_prealloc_disabled: false # type: section # name: # en: Preprocess