imbajin commented on code in PR #420: URL: https://github.com/apache/incubator-hugegraph-doc/pull/420#discussion_r2425196290
########## content/cn/blog/hugegraph/ToplingDB/ToplingDB Configuration YAML.md: ########## @@ -0,0 +1,217 @@ +--- +date: 2025-09-30 +title: "ToplingDB YAML configuration file" +linkTitle: "ToplingDB的YAML配置文件" +--- + +RocksDB 提供了丰富的参数配置,但大多数情况下,这些配置需要通过硬编码完成。 + +[ToplingDB](https://github.com/topling/toplingdb) 在此基础上引入了 **SidePlugin + YAML** 的方式,使得配置更加模块化和可组合。 + +本文重点介绍 **ToplingDB 扩展参数** 的部分,帮助读者理解这些配置的意义。 + +## 0. HugeGraph 中提供的rocksdb_plus.yaml + +下文只包括HugeGraph中所使用的配置参数,ToplingDB支持的完整配置请参考:[SidePlugin Wiki](https://github.com/topling/sideplugin-wiki-en/wiki) + +```yaml +http: # Web Server 相关配置 + # normally parent path of db path + document_root: /dev/shm/rocksdb_resource # 静态资源目录, HugeGraph中通过`preload_topling.sh`进行静态资源提取 + listening_ports: '2011' # Web Server监听端口,用于管理/监控 +setenv: # 环境变量设置 + StrSimpleEnvNameNotOverwrite: StringValue + IntSimpleEnvNameNotOverwrite: 16384 + OverwriteThisEnv: + #comment: overwrite is default to false + overwrite: true + value: force overwrite this env by overwrite true +Cache: # Cache 相关配置 + lru_cache: # 定义一个 LRU 缓存实例 + class: LRUCache + params: + capacity: 8G # 缓存容量 8GB + num_shard_bits: -1 # 分片数量,-1 表示自动 + strict_capacity_limit: false + high_pri_pool_ratio: 0.5 + use_adaptive_mutex: false + metadata_charge_policy: kFullChargeCacheMetadata # 元数据也计入缓存容量 +Statistics: # 数据采样配置 + stat: + class: default + params: + discard_tickers: # 丢弃的统计计数器,减少开销 + - rocksdb.block.cache + - rocksdb.block.cachecompressed + - rocksdb.block + - rocksdb.memtable.payload.bytes.at.flush + - rocksdb.memtable.garbage.bytes.at.flush + - rocksdb.txn + - rocksdb.blobdb Review Comment: 配置文档建议 - 对于关键的配置参数,建议补充说明: 1. `mem_cap: 16G` - 建议说明这个值应该如何根据实际系统内存进行调整 2. `max_background_jobs: 8` - 建议说明该值与 CPU 核心数的关系 3. `listening_ports: '2011'` - 建议提醒用户确保该端口未被占用,并说明如何修改 这些补充说明能帮助用户更好地根据自己的环境进行配置调优。 ########## content/cn/blog/hugegraph/ToplingDB/ToplingDB Quick Start.md: ########## @@ -0,0 +1,39 @@ +--- +date: 2025-10-09 +title: "ToplingDB Quick Start" +linkTitle: "ToplingDB Quick Start" +--- + +> [ToplingDB](https://github.com/topling/toplingdb)是对 RocksDB 的可配置、可观测扩展,支持通过 YAML 文件进行动态调优,并通过内置 Web Server 实现实时监控 + +修改 `hugegraph.properties` + +```properties +backend=rocksdb +serializer=binary +rocksdb.data_path=. +rocksdb.wal_path=. +# 配置文件路径 +rocksdb.option_path=./conf/graphs/rocksdb_plus.yaml +# 是否开启Web Server +rocksdb.open_http=true +``` + +初始化数据库(第一次启动时或在 `conf/graphs/` 下手动添加了新配置时需要进行初始化) + +```bash +cd *hugegraph-${version} +bin/init-store.sh +``` + +启动 server + +```bash +bin/start-hugegraph.sh +Starting HugeGraphServer... +Connecting to HugeGraphServer (http://127.0.0.1:8080/graphs)....OK +``` + +提示的 url 与 `rest-server.properties` 中配置的 `restserver.url` 一致 + +Web Server 的监听端口在 YAML 文件中通过 `http.listening_ports` 字段进行配置 Review Comment: 文档完整性建议 - 建议在快速开始文档中补充以下内容: 1. **前置条件**: 说明需要的 HugeGraph 版本要求 2. **验证步骤**: 添加如何验证 ToplingDB 是否成功启动的方法(例如访问 Web Server 的 URL) 3. **常见问题**: 列出可能遇到的常见启动错误及解决方案 4. **性能对比**: 简要说明 ToplingDB 相比 RocksDB 的优势场景 这些补充能让新用户更容易上手。 ########## .github/workflows/auto-pr-review.yml: ########## @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +name: "Auto PR Commenter" + +on: + pull_request_target: + types: [opened] Review Comment: GitHub Actions 工作流建议 - 当前配置只在 PR 打开时触发自动审查。建议考虑: 1. 添加 `synchronize` 事件,这样在 PR 更新时也能触发审查: ```yaml on: pull_request_target: types: [opened, synchronize] ``` 2. 考虑添加权限限制和安全检查,因为 `pull_request_target` 在 fork 仓库的 PR 上也会运行 3. 建议添加超时设置以防止工作流无限运行: ```yaml jobs: add-review-comment: runs-on: ubuntu-latest timeout-minutes: 5 ``` -- 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]
