maple start --in-memory: generate chDB settings that suit a throwaway store
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- clickhouse, typescript
- Lĩnh vực
- cli
Hướng nghiên cứu
Bắt đầu tại apps/cli/src/commands/server.ts#L1535-L1538, nơi nhánh in-memory bỏ qua bước tạo cấu hình, và đọc resolveChdbConfigFile ở dòng L689-L705 làm mẫu để làm theo. Thêm một đường dẫn in-memory ghi một tệp cấu hình được tạo ra cạnh store, với bốn giá trị <merge_tree> trong bảng, và giữ nguyên --chdb-config-file do người dùng cung cấp. Hoàn thành khi maple start --in-memory tạo ra tệp đó và các thiết lập hiển thị là đã thay đổi trong system.merge_tree_settings; chạy các bài kiểm thử hiện có của lệnh server CLI để xác nhận chế độ data-dir không bị ảnh hưởng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 insystem.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).
- Ngôn ngữ chính
- TypeScript
- Star
- 1.8k
- Fork
- 120
- Merge trung bình
- 8 giờ 34 phút
- Pull request đã merge (30 ngày)
- 687
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của MapleTechLabs/maple
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
MapleTechLabs/maple#1921 · 1 bình luận · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
docs: make Maple Cloud deployment checks discoverable to agentsCó thể đã có người làm @jasonkuhrt đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
MapleTechLabs/maple#2007 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Already-installed GitHub app leaves Sources waiting for a callbackCó thể đã có người làm @jasonkuhrt đã nhận hôm nay. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
MapleTechLabs/maple#1998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
MapleTechLabs/maple#1874 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
MapleTechLabs/maple#1873 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của MapleTechLabs/maple
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
BeOS .json missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mihaip/infinite-mac#475 ·
-
Let TypeScript accept an initial object in ReactiveDictCó thể đã có người làm @yograj-vijay-yadav đã nhận hôm nay. Đang mởbug good first issue help wanted workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
meteor/meteor#14919 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
marmelab/atomic-crm#401 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
account: profile
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 5 ngày