byteayan commented on code in PR #535: URL: https://github.com/apache/hugegraph-doc/pull/535#discussion_r4396842364
########## content/en/docs/quickstart/hugegraph/hugegraph-hstore.md: ########## @@ -209,8 +210,8 @@ This file contains only `rocksdb` and Actuator exposure settings. | Key | Master distribution value | Code default | Meaning | |-----|---------|--------------|---------| -| `rocksdb.total_memory_size` | `32000000000` | `51539607552` | Memory budget shared by all RocksDB instances on this node. When absent or `0`, the node uses the JVM max heap instead. | -| `rocksdb.write_buffer_size` | `32000000` | `33554432` | Memtable size in bytes. When absent or `0`, the node uses `total_memory_size / 1000`. | +| `rocksdb.total_memory_size` | `auto` | Auto-sized, see Meaning | Memory budget, `auto` or a number of bytes, shared by all RocksDB instances on this node, split into the write cache and the block cache by `write_buffer_ratio`. Both caches are off-heap, so `-Xmx` does not limit them, and a fixed 1 GiB Raft log cache comes on top; the Raft log memtables of all partitions share a 256 MiB write buffer charged to that cache, so they don't add to it. The budget is a sizing target, not a hard cap: with `rocksdb.write_buffer_allow_stall` at its default `false`, writes are not stalled when the write cache is full, so native memory can exceed the budget under heavy writes and a container can still be OOM-killed. Setting it to `true` holds the cap more firmly at the cost of write latency. With `auto` (a missing, blank or `0` value means the same), the node uses half of the memory left after the JVM max heap, `MaxDirectMemorySize` (counted as the heap size when unset; `bin/start-hugegraph-sto re.sh` sets it to the heap it picks unless `-j` sets `-Xmx`, `-XX:MaxHeapSize` or the cap itself) and a 1.5 GiB reserve (the 1 GiB Raft log cache plus 512 MiB for other native memory), clamped to 256 MiB to 32 GB. In a container the starting point is the cgroup memory limit when one is set, including a limit set only on a parent cgroup the Store can see; otherwise it is the host's memory. A limit the Store can't see, such as one above a private cgroup namespace, isn't guessed: the Store uses the lowest visible limit and logs a warning, so pin the value there. The startup log shows the budget with its mode, physical limit and source, heap, direct memory, reserve and whether the cgroup view is complete. If neither the JVM nor the cgroup files report a usable memory size, the budget falls back to the JVM max heap, clamped to the same 256 MiB to 32 GB. An `application-pd.yml` kept from an earlier release still sets `32000000000`; set it to `auto` to auto-size. In PD mode PD may also kee p a copy (KV key `S:FS`), uploaded by the first Store to start. A Store loads that copy over its local file only when it has no local file or the file is no newer than `S:Timestamp`; the upload sets no timestamp, and a missing one counts as 0, so changing `S:FS` alone changes nothing. To upgrade, set `HG_STORE_ROCKSDB_TOTAL_MEMORY_SIZE=auto` or `-Drocksdb.total_memory_size=auto` on each Store and restart it; the Store keeps this value above both its local file and PD's copy. Alternatively, set the value to `0` or remove it in `S:FS`, then put the current time in milliseconds into `S:Timestamp` through PD's KV service (gRPC `KvService.put`): every running Store then reloads PD's copy, writes it over its local file and restarts itself with `bin/restart-hugegraph-store.sh` within 60 seconds, and a stopped Store loads it at its next start. Put `auto` in `S:FS` only once every Store runs a release that supports it: an earlier release can't parse `auto` and fails to start, while it reads `0` as its old heap-sized default. The same holds for a copy uploaded by a newer Store when PD had none, since the shipped file says `auto`. The self-restart passes no arguments, so `-j` and `-g` from the original start are dropped, including the `JAVA_OPTS` the Docker entrypoint passes as `-j`, and the launcher's default heap applies; only JVM settings in an exported `JAVA_OPTIONS` carry over, so prefer the per-Store override on Stores started with a custom heap. Any other value is used as given and must be plain bytes, at least `1048576` (1 MiB); a smaller value or one such as `4GB` stops startup. | Review Comment: Done in both rows: the `JAVA_OPTS` clause is gone. The rows now say a Docker Store exits with 143 and takes the restart script with it. A container with a restart policy (the Compose files use `unless-stopped`) comes back through the entrypoint and keeps `JAVA_OPTS`, while one started like the standalone `docker run -d` example in section 3.3, which has no `--restart`, stays down. Docker users are pointed to `HG_STORE_ROCKSDB_TOTAL_MEMORY_SIZE` instead of `S:Timestamp`. Fixed in eab98044 and 5c276159. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
