JackieTien97 opened a new pull request, #18538:
URL: https://github.com/apache/iotdb/pull/18538

   ## Motivation
   
   IoTDB's default configuration and startup parameters assume the machine is 
exclusively dedicated to IoTDB (heap sized from machine memory: DataNode 50% 
uncapped, ConfigNode 30% capped at 8G). On edge machines that also run other 
processes this is far too aggressive. This PR adds an **IoTDB Edge 
distribution** — `apache-iotdb-edge-${version}-all-bin` — whose defaults target 
a total process RSS of ~512 MB, validated on x86 servers and Raspberry Pi 4B 
class devices.
   
   ## Changes
   
   **New entry point (one JVM, both nodes)**
   - `org.apache.iotdb.edge.EdgeNode` (in `iotdb-core/confignode`, which 
already depends on `iotdb-server`): bootstraps the ConfigNode on a background 
thread, waits for its internal RPC port to accept connections, then starts the 
DataNode in the same JVM. This saves a whole JVM's fixed overhead (metaspace, 
code cache, GC structures, thread stacks) — ~140 MB measured. All logs go 
through i18n'd `ConfigNodeMessages` constants (en/zh in key parity).
   - Shared-singleton audit: ports / data dirs / JMX bean names don't collide; 
the internal `MetricService` singleton is safe because both node metric levels 
default to `OFF` in the edge config.
   
   **One pair of lifecycle scripts only**
   - `sbin/start-edge.sh` / `stop-edge.sh` (+ Windows `start-edge.bat` / 
`stop-edge.bat`). No separate ConfigNode/DataNode scripts in this package. 
`start-edge.sh` sets `CONFIGNODE_HOME` explicitly so the ConfigNode resolves 
its directories against the installation dir rather than the process working 
directory (a real pitfall found during testing).
   - `conf/edge-env.sh` (+ `.bat`): fixed small JVM budget, overridable via 
environment variables — `Xmx 224M` / `Xms 64M`, direct 96M, metaspace 160m, 
SerialGC, `Xss320k`, `ActiveProcessorCount=2`.
   
   **Edge-tuned defaults** (`conf/iotdb-system.properties` in the edge package 
only)
   - Small fixed thread pools (query 2, compaction 2/1/1, flush 2, MPP exchange 
2/2, …) instead of CPU-core-based sizing.
   - 1M WAL buffer, 4M tsfile write buffer, 128M compaction target file size.
   - `schema/data_region_group_extension_policy=CUSTOM` with 1 region group per 
database, `series_slot_num=1`.
   - Compaction throughput capped at 8 MB/s to stay polite on shared disks; 
`cn/dn_metric_level=OFF`.
   
   **Packaging**
   - `distribution/src/assembly/edge.xml` + `conf-edge/` resources; the default 
`mvn package -pl distribution -am` build now also produces 
`apache-iotdb-edge-${version}-all-bin` (dir/zip + sha512), alongside the 
unchanged regular packages.
   - `all.xml` excludes the edge scripts from the regular all-bin distribution 
(same pattern as ainode), so regular packages are byte-identical in layout to 
before.
   
   ## Validation
   
   Full test report (5 rounds, 100+ runs, machine specs incl. Raspberry Pi 4B): 
https://timechor.feishu.cn/docx/OdQVdqJqdoBQqBx1ceKcVtUqnPe
   
   - x86 (16C/32G): ≥ 20,000 series at strict 1 Hz mixed read/write 
(write:latest:range = 8:1:1) within 512 MB; single-process RSS 323 MB vs 467 MB 
(tuned two-process) vs 506 MB (stock two-process) at the 10k-series point.
   - Raspberry Pi 4B (4×Cortex-A72/8G/SD): ≥ 10,000 series across tree-aligned 
/ tree-non-aligned / table models, 30-min soak per shape, zero failed points, 
zero OOM; idle RSS ~194 MB.
   - Edge package smoke on Pi: start-edge → CLI insert/select → stop-edge, 
clean shutdown verified.
   - `mvn package -pl distribution -am -DskipTests` passes; all 37 Java modules 
compile under `-P with-zh-locale` (i18n keys in en/zh parity).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to