Vector high CPU usage #24668
Replies: 1 comment
-
|
Looking at your config and logs, I can see a few things that are likely contributing to the CPU spike. 1. The disk buffer is causing constant I/O on the hot path Your logs show the disk buffer rolling to new data files every few seconds: This means Vector is continuously writing and reading 128MB files to disk, which is CPU-intensive — especially with For a kubernetes_logs → ClickHouse pipeline at your scale, try switching to a memory buffer with a tight cap first to see if the CPU drops: buffer:
type: memory
max_events: 5000
when_full: drop_newestIf CPU normalizes, the disk buffer + zstd combination was the culprit. 2. The remap transform is running 6 regex matches per event on the hot path Your Case-insensitive regex with word boundary matching (
3. Your logs show Vector constantly finding and stopping watch on files ( For large clusters, increasing this to Diagnostic step: check For what it's worth, the regex-on-hot-path and disk-buffer-overhead pattern is something we ran into when building WarpParse — ended up pre-compiling parsing rules and applying backpressure at the source level rather than buffering to disk. Happy to share more detail if useful. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hi Team,
I am running vector in Agent mode over 266+ nodes. I am doing POC on it, having kubernetes log as source and Clickhouse as Sink. I had deployed vector then the CPU usage was fine but suddenly the CPU spiked from 0.5 core to 3.5+ cores on more than 5-6 vector pods. I want to know what are reason which is causing high cpu usage.
Vector Config
Vector Logs
2026-02-17T08:07:48.601747Z DEBUG sink{component_kind="sink" component_id=prometheus_exporter component_type=prometheus_exporter}:http-request{method=GET path=/metrics}: vector::internal_events::http: Received HTTP request.

2026-02-17T08:07:48.602799Z DEBUG hyper::proto::h1::io: Internal log [flushed 279 bytes] has been suppressed 2 times.
2026-02-17T08:07:48.602810Z DEBUG hyper::proto::h1::io: flushed 5610 bytes
2026-02-17T08:07:52.140096Z DEBUG vector::internal_events::file::source: Files checkpointed. count=35 duration_ms=1
2026-02-17T08:07:54.191920Z DEBUG source{component_kind="source" component_id=kubernetes_logs component_type=kubernetes_logs}:file_server: file_source::file_server: event_throughput=184.000/sec bytes_throughput=201.248k/sec ratios={"discovery": 0.00013266272, "other": 0.0004653868, "reading": 0.013157006, "sending": 0.0025158322, "sleeping": 0.98372906}
2026-02-17T08:07:54.195502Z INFO source{component_kind="source" component_id=kubernetes_logs component_type=kubernetes_logs}:file_server: vector::internal_events::file::source: Found new file to watch. file=/var/log/pods/search-platform_search-service-6fd9b5d799-9gnc7_a1f9aaec-e7a6-4d2b-b93e-9024b98bd25a/search-service/0.log
2026-02-17T08:07:54.197459Z INFO source{component_kind="source" component_id=kubernetes_logs component_type=kubernetes_logs}:file_server: vector::internal_events::file::source: Internal log [Found new file to watch.] is being suppressed to avoid flooding.
2026-02-17T08:07:54.333648Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=30}:http: vector::internal_events::http_client: Sending HTTP request. uri=http://clickhouse-logs-clickhouse-db.observability.svc.cluster.local:8123/?input_format_import_nested_json=1&input_format_skip_unknown_fields=1&query=INSERT+INTO+%22default%22.%22qa_vector_logs%22+FORMAT+JSONEachRow method=POST version=HTTP/1.1 headers={"content-type": "application/x-ndjson", "content-length": "44483", "content-encoding": "zstd", "authorization": Sensitive, "accept-encoding": "zstd,gzip,deflate,br", "user-agent": "Vector/0.51.1 (x86_64-unknown-linux-gnu 44c8f1c 2025-11-13 15:16:05.303418529)"} body=[44483 bytes]
2026-02-17T08:07:54.333688Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=30}:http: hyper::client::pool: reuse idle connection for ("http", clickhouse-logs-clickhouse-db.observability.svc.cluster.local:8123)
2026-02-17T08:07:54.334031Z DEBUG hyper::proto::h1::io: Internal log [flushed 279 bytes] is being suppressed to avoid flooding.
2026-02-17T08:07:54.341944Z DEBUG hyper::proto::h1::io: Internal log [parsed 11 headers] is being suppressed to avoid flooding.
2026-02-17T08:07:54.341963Z DEBUG hyper::proto::h1::conn: Internal log [incoming body is chunked encoding] is being suppressed to avoid flooding.
2026-02-17T08:07:54.341976Z DEBUG hyper::proto::h1::conn: incoming body completed
2026-02-17T08:07:54.341999Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=30}:http: hyper::client::pool: pooling idle connection for ("http", clickhouse-logs-clickhouse-db.observability.svc.cluster.local:8123)
2026-02-17T08:07:54.342024Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=30}:http: vector::internal_events::http_client: HTTP response. status=200 OK version=HTTP/1.1 headers={"date": "Tue, 17 Feb 2026 08:07:54 GMT", "connection": "Keep-Alive", "content-type": "text/plain; charset=UTF-8", "access-control-expose-headers": "X-ClickHouse-Query-Id,X-ClickHouse-Summary,X-ClickHouse-Server-Display-Name,X-ClickHouse-Format,X-ClickHouse-Timezone,X-ClickHouse-Exception-Code", "x-clickhouse-server-display-name": "chi-logs-clickhouse-db-logs-clickhouse-1-0-0.chi-logs-clickhouse-db-logs-clickhouse-1-0.observability.svc.cluster.local", "transfer-encoding": "chunked", "x-clickhouse-query-id": "ab0c3f89-082f-484d-9fc1-be0839fa4efc", "x-clickhouse-timezone": "UTC", "keep-alive": "timeout=300, max=9970", "x-clickhouse-summary": "{"read_rows":"0","read_bytes":"0","written_rows":"0","written_bytes":"0","total_rows_to_read":"0","result_rows":"0","result_bytes":"0","elapsed_ns":"6615007"}"} body=[unknown]
2026-02-17T08:07:54.440446Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=31}:http: vector::internal_events::http_client: Internal log [Sending HTTP request.] is being suppressed to avoid flooding.
2026-02-17T08:07:54.440483Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=31}:http: hyper::client::pool: Internal log [reuse idle connection for ("http", clickhouse-logs-clickhouse-db.observability.svc.cluster.local:8123)] is being suppressed to avoid flooding.
2026-02-17T08:07:54.456323Z DEBUG hyper::proto::h1::conn: Internal log [incoming body completed] is being suppressed to avoid flooding.
2026-02-17T08:07:54.456542Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=31}:http: hyper::client::pool: Internal log [pooling idle connection for ("http", clickhouse-logs-clickhouse-db.observability.svc.cluster.local:8123)] is being suppressed to avoid flooding.
2026-02-17T08:07:54.456572Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}:request{request_id=31}:http: vector::internal_events::http_client: Internal log [HTTP response.] is being suppressed to avoid flooding.
2026-02-17T08:07:54.811944Z DEBUG transform{component_kind="transform" component_id=add_labels component_type=remap}:try_write_record_inner: vector_buffers::variants::disk_v2::writer: Archived record is too large to fit in remaining free space of current data file. current_data_file_size=133707160 max_data_file_size=134217728 archive_on_disk_len=528560
2026-02-17T08:07:54.815398Z DEBUG transform{component_kind="transform" component_id=add_labels component_type=remap}:try_write_record_inner: vector_buffers::variants::disk_v2::writer: Current data file reached maximum size. Rolling to the next data file. current_data_file_size=133707160 max_data_file_size=134217728 last_attempted_write_size=528560
2026-02-17T08:07:54.824386Z DEBUG transform{component_kind="transform" component_id=add_labels component_type=remap}:try_write_record_inner:ensure_ready_for_write: vector_buffers::variants::disk_v2::writer: Opened data file for writing. data_file_path="/var/lib/vector/buffer/v2/clickhouse/buffer-data-2.dat" existing_file_size=0
2026-02-17T08:07:54.824792Z DEBUG transform{component_kind="transform" component_id=add_labels component_type=remap}:try_write_record_inner:ensure_ready_for_write: vector_buffers::variants::disk_v2::writer: Writer now on new data file. new_writer_file_id=2
2026-02-17T08:07:54.829042Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Reached the end of current data file. reader_file_id=1 writer_file_id=2
2026-02-17T08:07:54.829094Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Marking data file for deletion. data_file_path="/var/lib/vector/buffer/v2/clickhouse/buffer-data-1.dat" first_record_id=27339 last_record_id=51669 record_count=1702 event_count=24331 bytes_read=133707160
2026-02-17T08:07:54.829128Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Rolling to next data file.
2026-02-17T08:07:54.831546Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Opened data file for reading. data_file_path="/var/lib/vector/buffer/v2/clickhouse/buffer-data-2.dat"
2026-02-17T08:07:54.939766Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Deleting completed data file. data_file_path="/var/lib/vector/buffer/v2/clickhouse/buffer-data-1.dat" bytes_read=133707160
2026-02-17T08:07:54.954710Z DEBUG sink{component_kind="sink" component_id=clickhouse component_type=clickhouse}: vector_buffers::variants::disk_v2::reader: Flushed after deleting data file, notifying writers and continuing.
2026-02-17T08:07:54.960163Z INFO source{component_kind="source" component_id=kubernetes_logs component_type=kubernetes_logs}:file_server: vector::internal_events::file::source: Stopped watching file. file=/var/log/pods/search-platform_search-service-6fd9b5d799-9gnc7_a1f9aaec-e7a6-4d2b-b93e-9024b98bd25a/search-service/0.log reached_eof="true"
2026-02-17T08:07:56.204718Z DEBUG sink{component_kind="sink" component_id=prometheus_exporter component_type=prometheus_exporter}:http-request{method=GET path=/metrics}: vector::internal_events::http: Internal log [Received HTTP request.] is being suppressed to avoid flooding.
2026-02-17T08:07:57.306973Z INFO source{component_kind="source" component_id=kubernetes_logs component_type=kubernetes_logs}:file_server: vector::internal_events::file::source: Internal log [Stopped watching file.] is being suppressed to avoid flooding.
Loading...
You're using Lens Personal (for individuals or companies with < $10M annual revenue or funding)
Beta Was this translation helpful? Give feedback.
All reactions