在Debian系統優化Filebeat資源占用可從配置、系統、監控三方面入手,具體如下:
close_inactive
(如5m
)關閉長時間未更新的文件處理器,ignore_older
(如168h
)忽略舊文件。queue.type
設為persisted
,調整queue.max_bytes
和flush.min_events
;增大bulk_max_size
(如2048
)提升批量發送效率。harvester.limit
限制并行處理的文件數量,禁用不必要的模塊(如filebeat.modules
中關閉不需要的模塊)。multiline
參數(如pattern
、max_lines
),避免內存溢出。/etc/sysctl.conf
,優化vm.swappiness
等參數以提升內存管理效率。lsof
檢查并釋放異常文件句柄。參考來源: