Skip to main content

Configuration

eBPF Agent Meltdown

Meltdown Principle

The eBPF Agent meltdown strategy determines whether to perform Agent meltdown based on the Node's host CPU usage and available memory size.

  • The default CPU threshold is 75%~85%. When the Node's CPU usage exceeds 85%, Agent meltdown is triggered.

  • The default available memory threshold is 1GB~2GB. When the Node's available memory is less than 1GB, Agent meltdown is triggered.

  • After Agent meltdown, when the host CPU usage drops below 75% and available memory exceeds 2GB, the Agent resumes normal operation.

Note: When meltdown occurs, the eBPF Agent process will exit. After meltdown recovery, the eBPF Agent process will restart.

Configuration Modification

Modify ebpf_cpu_blow_threshold and ebpf_mem_blow_threshold in tingyun-common-config in tingyunagent.yaml.

apiVersion: v1
kind: ConfigMap
metadata:
name: tingyun-common-config
namespace: tingyun
data:
VERSION: |
2.4.1.0
tingyun-common.yaml: |
# Whether to enable the EBPF network data collection function, true or false
# If you enable the EBPF function, you also need to modify the Daemonset tingyun-linux-agent requests cpu to 0.5, memory to 1Gi, and restart the Daemonset tingyun-linux-agent
ebpf_enabled: false

# EBPF network module CPU meltdown threshold: enable threshold, disable threshold
# Unit: percent
# When the Node's CPU usage exceeds the disable threshold, the EBPF network module switches to meltdown state
# When in meltdown state, and CPU usage drops below the enable threshold and available memory exceeds the enable threshold, the EBPF network module is enabled
ebpf_cpu_blow_threshold: 75,85

# EBPF network module available memory meltdown threshold: disable threshold, enable threshold
# Unit: bytes
# When the Node's available memory is less than the disable threshold, the EBPF network module switches to meltdown state
# When in meltdown state, and CPU usage drops below the enable threshold and available memory exceeds the enable threshold, the EBPF network module is enabled
ebpf_mem_blow_threshold: 1073741824,2147483648

Then update using the yaml file.

kubectl apply -f tingyunagent.yaml

If the tingyunagent.yaml installation file is lost, you can use the edit configmap command to modify the configuration.

kubectl edit configmap tingyun-common-config -n tingyun

View meltdown logs:

kubectl -n tingyun exec -ti tingyun-linux-agent-vrtwk -- cat /opt/agent/ebpf/restart.log

Sample output:

ebpf agent stop, because of feature disable                  # ebpf_enabled is false
ebpf agent start, because of crash restart or blow recover # ebpf_enabled is true, Agent started
ebpf agent stop, because of trigger cpu blow # CPU high triggers meltdown
ebpf agent start, because of crash restart or blow recover # Meltdown recovery, Agent started
ebpf agent stop, because of trigger memory blow # Insufficient available memory triggers meltdown
ebpf agent start, because of crash restart or blow recover # Meltdown recovery, Agent started
ebpf agent not start because of memory blow # Insufficient available memory, Agent not started

Log Level and Audit Mode

Modify the configuration items log.level and log.audit in the ebpf.conf file in tingyun-sys-config in tingyunagent.yaml.

apiVersion: v1
kind: ConfigMap
metadata:
name: tingyun-sys-config
namespace: tingyun
data:
ebpf.conf: |
#
# Config item: log.filecount
# Purpose: Number of log files to retain
# Default: 10
# Requires pod restart after modification
log.filecount=3
#
# Config item: log.filesize
# Purpose: Size of a single log file
# Default: 100
# Unit: MB
# Requires pod restart after modification
log.filesize=100
#
# Config item: log.level
# Purpose: Log data filter level
# Possible values: debug, info, warning, error
# Default: info
# Requires pod restart after modification
log.level=info
#
# Config item: log.audit
# Purpose: Enable audit mode logs
# Possible values: true, false
# Default: false
# Requires pod restart after modification
log.audit=false

Then update using the yaml file.

kubectl apply -f tingyunagent.yaml

If the tingyunagent.yaml installation file is lost, you can use the edit configmap command to modify the configuration.

kubectl edit configmap tingyun-sys-config -n tingyun

Then delete the existing tingyun-linux-agent pod to let the pod be recreated.

kubectl -n tingyun delete pod tingyun-linux-agent-ddefb

View work logs:

kubectl -n tingyun exec -ti tingyun-linux-agent-vrtwk -- cat /opt/agent/ebpf/logs/ebpf-agent.log