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.
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#
- 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".
- The gate seals a batch when it reaches
DRILLO_BATCH_ROWSrows or isDRILLO_BATCH_MSold, whichever comes first. - 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 did not back up (synthetic data, 5 samples per cell, measured with DRILLO_BATCH_MS=1000; the default is now 250):
| Rate (events/s) | Under load, median / max | Idle, median |
|---|---|---|
| 1,000 | 0.90 / 1.10 s | 0.22 s |
| 3,000 | 0.53 / 1.00 s | 0.22 s |
| 10,000 | 0.39 / 0.52 s | 0.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. The shipped default is 250. 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 is labelled MEASURED, ESTIMATED or NOT TESTED. Where nothing was measured the cell says NOT TESTED, and we do not fill gaps. Retention above your licence's cap is not available.
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 volume | Retention | Recommended host | Ingest headroom | Time to searchable | Query latency (Q3, Q4, Q5) | Memory | CPU | Hot disk |
|---|---|---|---|---|---|---|---|---|
| 1 GB/day (about 120 events/s) | 7 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at 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 retained | about 2.0 GB (ESTIMATED) |
| 1 GB/day (about 120 events/s) | 30 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 250x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 8.6 GB (ESTIMATED) |
| 1 GB/day (about 120 events/s) | 90 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 250x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 26 GB (ESTIMATED) |
| 1 GB/day (about 120 events/s) | 365 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 250x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 104 GB (ESTIMATED) |
| 5 GB/day (about 580 events/s) | 7 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 51x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 10 GB (ESTIMATED) |
| 5 GB/day (about 580 events/s) | 30 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 51x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 43 GB (ESTIMATED) |
| 5 GB/day (about 580 events/s) | 90 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 51x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 129 GB (ESTIMATED) |
| 5 GB/day (about 580 events/s) | 365 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 51x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 522 GB (ESTIMATED) |
| 25 GB/day (about 2,900 events/s) | 7 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 10x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 50 GB (ESTIMATED) |
| 25 GB/day (about 2,900 events/s) | 30 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 10x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 214 GB (ESTIMATED) |
| 25 GB/day (about 2,900 events/s) | 90 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 10x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 644 GB (ESTIMATED) |
| 25 GB/day (about 2,900 events/s) | 365 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 10x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 2,610 GB (ESTIMATED) |
| 100 GB/day (about 11,600 events/s) | 7 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 2.6x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 200 GB (ESTIMATED) |
| 100 GB/day (about 11,600 events/s) | 30 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 2.6x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 858 GB (ESTIMATED) |
| 100 GB/day (about 11,600 events/s) | 90 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 2.6x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 2,574 GB (ESTIMATED) |
| 100 GB/day (about 11,600 events/s) | 365 days | 1 CPU / 1.5 GB ClickHouse plus gate for ingest (MEASURED); size beyond 1 GB retained NOT TESTED | at least 2.6x (MEASURED lower bound) | under 0.6 s (MEASURED, small data) | NOT TESTED | NOT TESTED above 1 GB retained | NOT TESTED above 1 GB retained | about 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):
| Data | Q1 | Q2 | Q3 (needle) | Q4 (broad scan) | Q5 (high cardinality) |
|---|---|---|---|---|---|
| 0.05 GB | 4.1 | 2.7 | 4.7 | 24.8 | 22.5 |
| 0.25 GB | 4.3 | 4.1 | 11.4 | 67.5 | 76.7 |
| 1 GB | 4.8 | 3.6 | 36.8 | 219 | 306 |
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#
| Setting | What it does | Default | Trade-off | Check the effect |
|---|---|---|---|---|
DRILLO_BATCH_MS (gate) | Maximum age of an open batch | 250 | Lower: 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 early | 10,000 | Higher: 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 file | 64 | Larger: fewer files; slower to free disk | WAL directory file count |
DRILLO_WAL_MAX_MB (gate) | WAL quota. When full the gate answers 429 with Retry-After | 4096 | Larger: absorbs longer ClickHouse stalls, uses more disk | 429 count; WAL size on disk |
DRILLO_MAX_INFLIGHT_MB (gate) | Bytes of requests in flight; over it gives 429 | 256 | Larger: more memory, fewer 429s | 429 count; gate RAM |
DRILLO_MAX_CONNS (gate) | Open connections | 4096 | Shippers should reuse a few connections; the benchmarks used 4 | Connection count |
DRILLO_HOT_DAYS, DRILLO_RETENTION_DAYS (set at drillo migrate) | Days on fast disk and days kept. Retention is capped by your licence | 1 and min(30, licence cap) | Longer retention: more disk. Migrate refuses a value above the cap and never deletes existing data | drillo status; disk use |
DRILLO_SEARCH_AGG (api) | legacy switches the histogram and facet queries back to the older multi-query path | single query | Only for troubleshooting a slow or wrong histogram | Search time with and without |
ClickHouse small-host file deploy/clickhouse/config.d/drillo.xml | Smaller caches, fewer background threads, trimmed system logs, query cache off, tuned for 1 CPU / 1.5 GB | as shipped | Revert by deleting the block and restarting; a bigger host can raise caches and pool sizes | docker stats; query p50 |
Resource caps (docker update) | CPU and RAM limits per container, see Install with Docker | none | Too low: backlog and slower queries. Lost when a container is recreated | docker stats |
| Query cache | Off in the shipped file. Opt-in by setting a non-zero query_cache size in drillo.xml | off | Faster repeated queries, more RAM, results can be stale until they expire | Repeat one query and compare |
Defaults are those of version 1.0.0.
4. Check your own setup#
- Send one tagged line (see the masking test line in Install with Docker) with a unique word and note the time
t0when the call returns. - Search for that word every second. The time it first appears minus
t0is your delay. - Gate state:
/readyonly answersreadyand does not show a backlog. The reply to each ingest call showsacceptedandfirst_seq; read the gate container log for 429 and flush lines. - Count parts in ClickHouse:
SELECT table, count() FROM system.parts WHERE active GROUP BY table(run it in thedrillo-chcontainer). Hundreds of small active parts means batches are too small. - Watch
docker stats drillo-ch drillo-gateduring a real load.
Repeat after each single change.
5. Symptoms and fixes#
| Symptom | Likely cause | What to try |
|---|---|---|
| Searchable delay keeps growing | ClickHouse cannot keep up; backlog in the gate | Give ClickHouse more CPU; raise DRILLO_BATCH_ROWS; reduce shipper volume. Not fixed by a lower DRILLO_BATCH_MS |
| Shippers see 429 | WAL quota or in-flight limit reached | Fix 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" errors | Batches too small | Raise DRILLO_BATCH_MS or DRILLO_BATCH_ROWS; use fewer shipper connections |
| First query after a restart is slow | Cold caches | Expected; the small-host file keeps caches small. Raise cache sizes on bigger hosts |
| Memory near the cap | ClickHouse caches and merges | Check docker stats; keep the small-host file; raise the cap or lower retention |
| Histogram or facets look slow or wrong | Single-query path | Set 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.
Report an inaccuracy (opens a support ticket in the portal; nothing is sent from this page)