Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

maple start --in-memory: generate chDB settings that suit a throwaway store

オープン 初心者向け
#1,888 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
clickhouse, typescript
領域
cli

調査の方向性

apps/cli/src/commands/server.ts#L1535-L1538 から始めてください。ここではインメモリ分岐が設定生成をスキップしています。L689-L705 の resolveChdbConfigFile を、倣うべきモデルとして読んでください。ストアの隣に生成された設定ファイルを書き出すインメモリ経路を追加し、表にある 4 つの <merge_tree> の値を書き込んでください。ユーザーが指定した --chdb-config-file は変更しないでください。完了条件は、maple start --in-memory がそのファイルを生成し、system.merge_tree_settings で設定が変更された状態として表示されることです。CLI サーバーコマンドの既存テストを実行し、data-dir モードに影響がないことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

Written by an AI agent (Claude) on behalf of @jasonkuhrt.

maple start --in-memory keeps one run's telemetry and deletes it on exit, but its chDB runs with chDB's defaults, which suit a long-lived store. Each OTLP export is a synchronous INSERT per datasource that fans out through the materialized views into 16 to 20 new parts, so even a small dev workload writes about 315 files per insert. To get settings that suit a throwaway store, each caller has to write a chDB config and pass it in:

maple start --in-memory --offline --chdb-config-file ./throwaway-store.chdb.xml
<!-- throwaway-store.chdb.xml -->
<clickhouse>
  <merge_tree>
    <min_bytes_for_wide_part>10737418240</min_bytes_for_wide_part>
    <min_parts_to_merge_at_once>20</min_parts_to_merge_at_once>
    <cleanup_delay_period>1</cleanup_delay_period>
    <max_cleanup_delay_period>5</max_cleanup_delay_period>
  </merge_tree>
</clickhouse>

Cause

Data-dir mode generates a chDB config (resolveChdbConfigFile, for checkpoints), while in-memory mode passes on only a user-supplied file (apps/cli/src/commands/server.ts#L1535-L1538):

const chdbConfigFile =
	inMemory === undefined
		? yield* resolveChdbConfigFile(dataDir, Option.getOrUndefined(a.chdbConfigFile))
		: Option.getOrUndefined(a.chdbConfigFile)

Proposal

When --in-memory is set and no --chdb-config-file is given, generate a config beside the in-memory store holding the four <merge_tree> settings above, the way resolveChdbConfigFile generates one for data-dir mode. A user-supplied file stays untouched.

Setting Value What it does for a throwaway store
min_bytes_for_wide_part 10 GiB (chDB default 10 MiB) Parts stay compact, one data file for all columns. A merged wide traces part is about 200 files and is rewritten on nearly every merge; a new compact one is 29.
min_parts_to_merge_at_once 20 A merge waits for 20 parts instead of rewriting on every insert.
cleanup_delay_period / max_cleanup_delay_period 1 s / 5 s (chDB default 30 s / 300 s) Merged-away parts were over 90% of what sat on disk; they now go within seconds.

Costs: up to about 20 active parts per partition per table, and compact parts read single columns more slowly. Neither shows at the size of one run's telemetry.

Measurements

A harness ran Maple v0.3.0's schema (local schema v41) on libchdb 26.7 directly, 15k rows preloaded, 5 rows inserted every 2 s, 150 s per variant, on an M-series Mac under heavy unrelated load. File counts were stable between repeats; CPU was noisy.

Variant Parts per insert Files per insert CPU-s per row
chDB defaults 20.0 314 0.08
chDB defaults, repeat 20.1 316 0.11
compact parts 20.1 284 0.07
min_parts_to_merge_at_once 20 17.5 251 0.06
compact + min_parts_to_merge_at_once 20 17.6 246 0.07
same + cleanup delay 1 s 17.4 244 0.11
  • Files per insert: 315 → 244, about 22% fewer.
  • Files standing at the end of the run: 11,096 → 2,492 with the 1 s cleanup delay.
  • The harness under-counts merges (0.19 merges per insert on traces, against about 0.9 on a live store), so the compact-parts gain on a live store is likely larger.
  • maple start --in-memory --chdb-config-file <file> on v0.2.0 shows all four overrides as changed in system.merge_tree_settings.

We run Maple this way, with the file above, for every dev stack and every test.

Related: #1852 (per-export cost), #1764 (added --in-memory).

主要言語
TypeScript
スター
1.8k
フォーク
120
平均マージ
8時間 11分
マージ済み PR(30日)
667

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

MapleTechLabs/maple のほかの issue

MapleTechLabs/maple の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。