ubuntu

Ubuntu Filebeat的性能调优技巧有哪些

小樊
35
2025-12-05 03:08:54
栏目: 智能运维

Ubuntu 上 Filebeat 性能调优要点

一 输入与采集层优化

二 队列与缓存策略

三 输出与网络层优化

四 系统与部署层面优化

五 实用配置示例

# Ubuntu 20.04+ Filebeat 8.x 示例(按需取值)
filebeat.inputs:
- type: filestream
  enabled: true
  paths:
    - /var/log/*.log
  ignore_older: 24h
  close_inactive: 30s
  harvester_buffer_size: 32768
  harvester.max_bytes: 1048576
  processors:
    - decode_json_fields:
        fields: ["message"]
        target: ""
        overwrite_keys: true

# 队列(持久化,削峰填谷)
queue:
  type: persisted
  spool:
    size: 512MiB
    write:
      buffer_size: 10MiB
      flush:
        timeout: 5s
        events: 1024
    read:
      flush:
        timeout: 0s
    codec: cbor

# 输出(Elasticsearch)
output.elasticsearch:
  hosts: ["http://es-node:9200"]
  worker: 2
  bulk_max_size: 10000
  flush_interval: 1s
  compression: true

# 监控自身
monitoring:
  enabled: true
  elasticsearch:
    hosts: ["http://es-node:9200"]

提示:以上为起点值,建议结合目标吞吐(事件/秒)、行大小分布、ES 能力与网络状况逐步压测微调。

0
看了该问题的人还看了