Sizing and tuning

How a log line becomes searchable, which settings change that delay and the memory and CPU use, and how to measure your own best configuration.

Verified against v1.0.0-rc.1 · sources

On this page

Time until a line is searchable, memory and CPU depend on your ingest volume and batch settings. Measure on your own load (section 4) and change one setting at a time. For install steps see Install with Docker and Install and upgrade; for deployment variants (single node, dual copies, standby) see High availability; see also the comparison.

1. The model#

  1. A shipper sends lines to the gate. The gate masks them and acks after the write to its disk log (WAL) is flushed. An ack means "on disk at the gate", not "searchable".
  2. The gate seals a batch when it reaches DRILLO_BATCH_ROWS rows or is DRILLO_BATCH_MS old, whichever comes first.
  3. The batch is inserted into ClickHouse. The lines are searchable after the insert finishes.

So the delay is about: batch age (up to DRILLO_BATCH_MS) + insert time + any backlog waiting for ClickHouse. At a low rate the batch age dominates. At a rate the host cannot keep up with, the backlog dominates and the delay keeps growing; that is a sizing problem, not a setting. Measured on synthetic data: about 1.8 to 2.6 s at 0.05 GB at the maximum ingest rate, and 9.4 s at 0.25 GB at the maximum rate, which was mostly backlog (CPU about 280%). At realistic rates the gate does not back up (COC-377, synthetic, 5 samples per cell, measured with DRILLO_BATCH_MS=1000, the pre-COC-394 default):

Rate (events/s)Under load, median / maxIdle, median
1,0000.90 / 1.10 s0.22 s
3,0000.53 / 1.00 s0.22 s
10,0000.39 / 0.52 s0.23 s

With DRILLO_BATCH_MS=250 the loaded median was 0.12 s at 3,000 and 0.22 s at 10,000 events/s, with about 3 times as many ClickHouse parts. With 100 ms it made about 5 times the parts, 3 to 10 times the merge time and a mild backlog at 10,000 events/s (ack lag 3.5 s), so we do not recommend it. The first 1,000 events/s step of the 250 and 100 runs was contaminated and is not used. A default of 250 was recommended in COC-377 and is the shipped default as of COC-394. Under maximum-rate bursts the delay can reach seconds while the gate drains its backlog.

2. Performance and sizing matrix#

Find your daily volume and retention. Every cell carries the label from the data owner (COC-378): MEASURED, ESTIMATED or NOT TESTED. Where nothing was measured the cell says NOT TESTED, and we do not fill gaps. Retention above your plan cap (Free 14 days, Paid 365 days) is not available. Source: docs/bench/sizing-matrix.md.

Read first: synthetic templated logs (about 107 bytes per event); one Apple-silicon Mac (arm64, not x86_64, not Docker Desktop on a server) with other processes sharing the Docker VM; each rate test ran 120 seconds, not 5 minutes; the largest data size tested was 1 GB. Anything above 1 GB is extrapolation, and most cells below are NOT TESTED for that reason.

Daily volumeRetentionRecommended hostIngest headroomTime to searchableQuery latency (Q3, Q4, Q5)MemoryCPUHot disk
1 GB/day (about 120 events/s)7 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 250x (MEASURED lower bound)under 0.6 s (MEASURED, small data)Q3 about 0.2 s, Q4 about 1.4 s, Q5 about 2.1 s (ESTIMATED)NOT TESTED (about 530 to 600 MiB ClickHouse peak at 0.6 GB data or less, MEASURED)NOT TESTED above 1 GB retainedabout 2.0 GB (ESTIMATED)
1 GB/day (about 120 events/s)30 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 250x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 8.6 GB (ESTIMATED)
1 GB/day (about 120 events/s)90 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 250x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 26 GB (ESTIMATED)
1 GB/day (about 120 events/s)365 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 250x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 104 GB (ESTIMATED)
5 GB/day (about 580 events/s)7 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 51x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 10 GB (ESTIMATED)
5 GB/day (about 580 events/s)30 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 51x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 43 GB (ESTIMATED)
5 GB/day (about 580 events/s)90 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 51x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 129 GB (ESTIMATED)
5 GB/day (about 580 events/s)365 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 51x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 522 GB (ESTIMATED)
25 GB/day (about 2,900 events/s)7 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 10x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 50 GB (ESTIMATED)
25 GB/day (about 2,900 events/s)30 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 10x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 214 GB (ESTIMATED)
25 GB/day (about 2,900 events/s)90 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 10x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 644 GB (ESTIMATED)
25 GB/day (about 2,900 events/s)365 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 10x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 2,610 GB (ESTIMATED)
100 GB/day (about 11,600 events/s)7 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 2.6x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 200 GB (ESTIMATED)
100 GB/day (about 11,600 events/s)30 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 2.6x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 858 GB (ESTIMATED)
100 GB/day (about 11,600 events/s)90 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 2.6x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 2,574 GB (ESTIMATED)
100 GB/day (about 11,600 events/s)365 days1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTEDat least 2.6x (MEASURED lower bound)under 0.6 s (MEASURED, small data)NOT TESTEDNOT TESTED above 1 GB retainedNOT TESTED above 1 GB retainedabout 10,439 GB (ESTIMATED)

How to read it:

  • Ingest headroom is 30,000 events/s divided by your rate. It is a lower bound: the limit was not found, and nothing above 30,000 events/s was tested. At 30,000 events/s, ClickHouse peaked at 69% of one CPU and the gate at 61%, with zero dropped events.
  • A larger host showed no benefit at these rates: 2 CPU / 3 GB was within noise of 1 CPU / 1.5 GB, because neither was saturated. We do not claim a benefit from the larger host.
  • Disk is 0.22 of raw size measured (about 0.20 with the tuned layout), times 1.3 headroom. Real logs compress differently.
  • Move to a bigger host or another design when ClickHouse CPU median passes about 70% of its cap, when ack lag grows, or when query times become unacceptable. No host size is recommended for more than 1 GB retained: RAM and CPU there are NOT TESTED.

Query latency against data size, one 1 CPU / 1.5 GB ClickHouse, idle, p50 in ms (MEASURED, up to 1 GB):

DataQ1Q2Q3 (needle)Q4 (broad scan)Q5 (high cardinality)
0.05 GB4.12.74.724.822.5
0.25 GB4.34.111.467.576.7
1 GB4.83.636.8219306

Q1 and Q2 stayed flat at about 3 to 7 ms. Q3 to Q5 grew roughly in line with data (about 34, 202 and 305 ms per GB). The 1 GB per day, 7 days row uses that slope (ESTIMATED); rows beyond 10 times the tested size are NOT TESTED.

3. Settings reference#

SettingWhat it doesDefaultTrade-offCheck the effect
DRILLO_BATCH_MS (gate)Maximum age of an open batch1000Lower: lines searchable sooner, more and smaller ClickHouse parts, more merge work. Higher: fewer parts, longer delay.Time one tagged line (section 4); system.parts count
DRILLO_BATCH_ROWS (gate)Rows that seal a batch early10,000Higher: fewer inserts at high volume, more memory per batch.Insert rate in the gate stats; peak RAM
DRILLO_SEG_MB (gate)Size of one WAL segment file64Larger: fewer files; slower to free diskWAL directory file count
DRILLO_WAL_MAX_MB (gate)WAL quota. When full the gate answers 429 with Retry-After4096Larger: absorbs longer ClickHouse stalls, uses more disk429 count; WAL size on disk
DRILLO_MAX_INFLIGHT_MB (gate)Bytes of requests in flight; over it gives 429256Larger: more memory, fewer 429s429 count; gate RAM
DRILLO_MAX_CONNS (gate)Open connections4096Shippers should reuse a few connections; the benchmarks used 4Connection count
DRILLO_HOT_DAYS, DRILLO_RETENTION_DAYS (set at drillo migrate)Days on fast disk and days kept. Retention is capped by plan: Free 14, Paid 3651 and min(30, plan cap)Longer retention: more disk. Migrate refuses a value above the cap and never deletes existing datadrillo status; disk use
DRILLO_SEARCH_AGG (api)legacy switches the histogram and facet queries back to the older multi-query pathsingle queryOnly for troubleshooting a slow or wrong histogramSearch time with and without
ClickHouse small-host file deploy/clickhouse/config.d/drillo.xmlSmaller caches, fewer background threads, trimmed system logs, query cache off, tuned for 1 CPU / 1.5 GBas shippedRevert by deleting the block and restarting; a bigger host can raise caches and pool sizesdocker stats; query p50
Resource caps (docker update)CPU and RAM limits per container, see Install with DockernoneToo low: backlog and slower queries. Lost when a container is recreateddocker stats
Query cacheOff in the shipped file. Opt-in by setting a non-zero query_cache size in drillo.xmloffFaster repeated queries, more RAM, results can be stale until they expireRepeat one query and compare

Defaults above were read from source on 2026-11-27; confirm with docs/env-reference.md for your build.

4. Check your own setup#

  1. Send one tagged line (see the masking test line in Install with Docker) with a unique word and note the time t0 when the call returns.
  2. Search for that word every second. The time it first appears minus t0 is your delay.
  3. Gate state: /ready only answers ready and does not show a backlog. The reply to each ingest call shows accepted and first_seq; read the gate container log for 429 and flush lines. {{a gate stats endpoint is not confirmed; add it if one exists}}
  4. Count parts in ClickHouse: SELECT table, count() FROM system.parts WHERE active GROUP BY table (run it in the drillo-ch container). Hundreds of small active parts means batches are too small.
  5. Watch docker stats drillo-ch drillo-gate during a real load.

Repeat after each single change.

5. Symptoms and fixes#

SymptomLikely causeWhat to try
Searchable delay keeps growingClickHouse cannot keep up; backlog in the gateGive ClickHouse more CPU; raise DRILLO_BATCH_ROWS; reduce shipper volume. Not fixed by a lower DRILLO_BATCH_MS
Shippers see 429WAL quota or in-flight limit reachedFix the backlog first; then raise DRILLO_WAL_MAX_MB or DRILLO_MAX_INFLIGHT_MB. Shippers must honour Retry-After
Many small active parts, "too many parts" errorsBatches too smallRaise DRILLO_BATCH_MS or DRILLO_BATCH_ROWS; use fewer shipper connections
First query after a restart is slowCold cachesExpected; the small-host file keeps caches small. Raise cache sizes on bigger hosts
Memory near the capClickHouse caches and mergesCheck docker stats; keep the small-host file; raise the cap or lower retention
Histogram or facets look slow or wrongNew single-query pathSet DRILLO_SEARCH_AGG=legacy, compare, report it

6. Limits of this guide#

Synthetic, templated data. Tested up to 0.28 GB on one host. Not tested on x86_64 or Docker Desktop. Database caps were 1 CPU / 1.5 GB. Results on your logs, disk and shippers will differ. No figure here is a guarantee.

Sources

This page was checked against: crates/gate/src/main.rs, crates/api/src/handlers.rs, deploy/clickhouse/config.d/drillo.xml, docs/bench/coc362f-results.md.

Report an inaccuracy (opens a new issue in the Drillo repository; nothing is sent from this page)