CentOS上Filebeat性能提升指南
一 基线检查与快速定位
二 配置参数优化
filebeat.inputs:
- type: log
paths:
- /var/log/*.log
harvester_buffer_size: 32KB
harvester.max_bytes: 1MB
max_concurrent_files: 100
filebeat.spool_size: 250000
filebeat.idle_timeout: 1s
queue.mem.events: 4096
queue.mem.flush.min_events: 3072
queue.mem.flush.timeout: 1s
output.elasticsearch:
hosts: ["es-node:9200"]
worker: 3
bulk_max_size: 10000
flush_interval: 1s
compression: gzip
processors:
- multiline:
pattern: '^\s'
negate: true
match: after
- json:
keys_under_root: true
overwrite_keys: true
logging.level: warning
filebeat.modules:
- module: system
enabled: false
三 系统与网络优化
* soft nofile 65536
* hard nofile 65536
[Service]
LimitNOFILE=65536
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_congestion_control = cubic
四 监控与迭代
monitoring.enabled: true
monitoring.elasticsearch.hosts: ["es-mon:9200"]
五 常见陷阱与排查