Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 11 min read Announcement hardMaster

Announcing Silk: a silky smooth fiber runtime for ClickHouse

Silk is a C++ stackful-fiber runtime for ClickHouse. It pins one scheduler thread per CPU, uses io_uring as its I/O foundation, steals work in order of CPU topology cost (hyperthread sibling, then same socket, then cross-socket), and does zero heap allocation in the steady-state hot path through mmap'd stack pools, stack-resident futures and intrusive containers. Its benchmarks report about 3.6 ns per yield, 5.9M file IOPS and roughly 4-15x boost::asio throughput, and it argues that Photon's cache-aliasing penalty comes from slab-allocated stacks rather than from stackful fibers. The tradeoffs are that it runs only on Linux, uses a process-wide singleton scheduler and caps fiber parameters at 64 bytes. Its first target is ClickHouse's distributed cache, where internal tests showed about 65% better p99.9 latency than a thread pool.

Assumes: C++ concurrency and memory orderingio_uring basicsNUMA and CPU topologycoroutines vs threads

Related posts

  • Optimizing ClickHouse for Intel's ultra-high core count processors

    ClickHouse hardMaster

    Intel engineers profiled all 43 ClickBench queries on 160–480 vCPU Xeon systems and landed a series of ClickHouse optimizations targeting lock contention, memory management and other scaling bottlenecks. Examples include double-checked locking with shared locks in the query condition cache (spinlock time cut from 76% to 1%, Q10/Q11 up ~85–89%), thread-local profiler timers, and raising jemalloc's lg_extent_max_active_fit to 8 to match two-level hash table reuse (Q35 up 96%, page faults down 71%). Individual fixes gave up to 10x on single queries and 2–10% geomean gains each, all merged upstream.

  • Designing the new async-native ClickHouse Python client

    ClickHouse mediumAdept

    The new async-native clickhouse-connect client replaces the legacy thread-pool wrapper with aiohttp for network I/O and a half-sync/half-async design: an async producer streams response chunks into a bounded queue (10 chunks of up to 1MB) while the existing synchronous Native-format parser consumes them in an executor thread, with the same queue reversed for inserts. This caps buffered memory at about 10MB, pipelines download and parsing, and propagates errors across the boundary. Benchmarks against ClickHouse Cloud show parity at concurrency 1 and a 1.16x geometric-mean speedup overall, up to 1.51x on mixed workloads. P95 latency is also far more stable than with the legacy client. The release candidate v0.12.0rc1 is available for testing.

  • To Thread or Not to Thread: An In-Depth Look at Ruby’s Execution Models

    Shopify Engineering mediumAdept

    Threaded Ruby servers like Puma and Sidekiq save memory over forking servers, but the gap is smaller than RSS suggests once copy-on-write sharing is measured properly with PSS and /proc/$PID/smaps_rollup. In one Shopify production app an extra Unicorn worker cost about 427MiB versus about 257MiB for an extra thread, not the ~750MiB RSS implied, and preloading plus eager loading improves CoW efficiency. Processes still offer clean request timeouts and avoid Global VM Lock contention, which hurts latency more than commonly assumed because Ruby web requests are less I/O-heavy than believed and GC also holds the GVL. Ractors and Fibers are not drop-in replacements, and a proposed GVL instrumentation API for Ruby 3.2 would let teams measure the latency cost of threads.

  • Large-scale distributed builds with Microsoft Build Accelerator

    Engineering@Microsoft easyNovice

    Microsoft's BuildXL distributes and caches builds for its largest codebases. Runtime file access monitoring fails the build whenever a process reads unpredicted inputs or writes conflicting outputs, which makes incremental builds trustworthy enough to ship from. Its key caching change is a two-phase cache lookup: the fingerprint combines statically predicted inputs with dynamically observed ones, such as the subset of headers a C++ compiler actually reads. This avoids both over-approximated inputs and hand-maintained dependency annotations. Together with CloudBuild, it cut builds that took over 24 hours down to minutes, at the scale of millions of process invocations.

  • Building ClickCannon - a tool for benchmarking ClickHouse

    ClickHouse mediumAdept

    ClickCannon is an open-source Go tool for benchmarking ClickHouse insert and query workloads, built to produce hardware sizing recommendations for ClickStack observability deployments. It replays real OpenTelemetry data stored as ZSTD-compressed Native format at a precisely controlled uncompressed throughput. A feedback-loop rate limiter combines a sliding window with a token-bucket gate. Independently scaled disk and insert worker pools exchange reusable ch-go blocks through Go channels, which avoids allocations. Block and connection retirement kept memory flat across 30-day runs, and configurable workflows with think times, time ranges and latency percentile targets simulate concurrent users querying while data arrives.

The quest for software engineering knowledge.

Look:
Layout: