Are we doing something wrong or having performance problems with Elasticsearch? #25855
QuestionHello, Vector.dev community!
Vector Configlog_schema:
timestamp_key: "@timestamp"
sources:
wazuh_indexing_source:
type: kafka
bootstrap_servers: kafka01:9093, kafka02:9093, kafka03:9093, kafka04:9093
group_id: "indexing_es"
topics:
- topic
auto_offset_reset: 'earliest'
decoding:
codec: json
tls:
enabled: true
ca_file: '/etc/vector/cert/ca.pem'
verify_certificate: true
verify_hostname: true
crt_file: '/etc/vector/cert/user-cert.pem'
key_file: '/etc/vector/cert/priv.pem'
acknowledgements:
enabled: true
sinks:
wazuh_indexing_sink:
type: elasticsearch
inputs:
- wazuh_indexing_source
endpoints:
- https://ingest1:9200
- https://ingest2:9200
- https://ingest3:9200
opensearch_service_type: managed
auth:
strategy: basic
user: admin
password: admin
tls:
ca_file: /etc/vector/cert/root-ca.pem
bulk:
action: "create"
index: "{{ .fields.index_prefix }}%Y.%m.%d"
compression: zstd
request_retry_partial: true
batch:
max_events: 10000
max_bytes: 200000000
timeout_secs: 0.1
request:
rate_limit_duration_secs: 60
rate_limit_num: 300
retry_max_duration_secs: 300
concurrency: 32
buffer:
- type: memory
max_events: 50000 |
Replies: 1 comment 1 reply
|
Two separate issues are visible directly in your config, and they have different root causes. Issue 1 — Rate limiter is capping your throughput Your current settings: This caps Vector at 300 bulk requests per minute, regardless of concurrency. Combined with Fix — remove or raise the rate limit: Also extend the batch timeout so batches actually fill up before flushing: The 200MB max_bytes is also unusually large — Elasticsearch's default Issue 2 — Horizontal scaling is capped by Kafka partition count Two Vector instances each processing 1M events/min instead of 2M combined is the classic Kafka consumer group symptom. Within a single group_id, Kafka assigns partitions 1:1 to consumers — if your topic has N partitions, you get at most N consumers doing useful work. A second consumer beyond that either idles or steals a partition from the first. Check your partition count: If partitions = 1, both Vector instances are racing for the same partition and Kafka assigns it to one at a time. If partitions = 2, each instance gets one — and you see exactly what you're seeing (same total, just split). Fix — increase topic partitions to match (or exceed) the number of Vector replicas you want to run: Then scale Vector to 8 replicas and throughput will scale linearly (Elasticsearch permitting). Summary Problem 1: Buffer backpressure at peak
|
Two separate issues are visible directly in your config, and they have different root causes.
Issue 1 — Rate limiter is capping your throughput
Your current settings:
This caps Vector at 300 bulk requests per minute, regardless of concurrency. Combined with
batch.timeout_secs: 0.1(100ms flush timeout), batches are flushed every 100ms and will almost never reach max_events: 10000 — so each request carries far fewer than 10k events. With small batches and a 300 req/min ceiling you're leaving most of your concurrency headroom unused.Fix — remove or raise the rate limit: