From 42de0db728738e5af64fc41bdeb56e268ed77261 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:22:48 +0000 Subject: [PATCH 1/2] Initial plan From 9c5d4cff3cdff10fcb615574e575e023b90a2d0b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 10 Nov 2025 08:27:50 +0000 Subject: [PATCH 2/2] docs: add objbench subcommand documentation for datanode Co-authored-by: fengjiachun <3860496+fengjiachun@users.noreply.github.com> --- docs/reference/command-lines/datanode.md | 47 ++++++++++++++++-- .../reference/command-lines/datanode.md | 48 +++++++++++++++++-- 2 files changed, 86 insertions(+), 9 deletions(-) diff --git a/docs/reference/command-lines/datanode.md b/docs/reference/command-lines/datanode.md index c61a70a719..6907923f40 100644 --- a/docs/reference/command-lines/datanode.md +++ b/docs/reference/command-lines/datanode.md @@ -5,7 +5,13 @@ description: Comprehensive guide to GreptimeDB datanode command-line interface, # Datanode -## Subcommand options +The `greptime datanode` command provides subcommands for managing and benchmarking datanode instances. + +## start + +Start the datanode service. + +### Options You can list all the options from the following command: @@ -28,9 +34,9 @@ greptime datanode start --help All the `addr` options are in the form of `ip:port`. -## Examples +### Examples -### Start service with configurations +#### Start service with configurations Starts a datanode instance with customized configurations: @@ -44,4 +50,37 @@ Starts a datanode instance with command line arguments specifying the gRPC servi greptime datanode start --rpc-bind-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --metasrv-addrs=0.0.0.0:3002 --node-id=1 ``` -The `datanode.example.toml` configuration file comes from the `config` directory of the `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` repository. You can find more example configuration files there. The `-c` option specifies the configuration file, for more information check [Configuration](/user-guide/deployments-administration/configuration.md). \ No newline at end of file +The `datanode.example.toml` configuration file comes from the `config` directory of the `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` repository. You can find more example configuration files there. The `-c` option specifies the configuration file, for more information check [Configuration](/user-guide/deployments-administration/configuration.md). + +## objbench + +The `objbench` subcommand is a benchmarking tool for measuring read/write performance of specific files on object storage. This is useful for diagnosing performance issues and testing storage layer performance. + +### Options + +| Option | Description | +| ------------------------------ | ------------------------------------------------------------------------------------------------ | +| `--config ` | Path to the datanode configuration file (TOML format) | +| `--source ` | Source SST file path in object storage (e.g., `data/greptime/public/1024/1024_0000000000/metadata/.parquet`) | +| `-v`/`--verbose` | Enable verbose output | +| `--pprof-file ` | Output file path for pprof flamegraph (enables profiling). Generates an SVG flamegraph file | + +### Examples + +#### Basic benchmark + +Measure the read/write performance of a specific file: + +```sh +greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet +``` + +#### Benchmark with profiling + +Measure performance and generate a flamegraph for performance analysis: + +```sh +greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet --pprof-file=./flamegraph.svg +``` + +This will generate a flamegraph in SVG format that can be opened in a web browser for performance analysis. \ No newline at end of file diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/reference/command-lines/datanode.md b/i18n/zh/docusaurus-plugin-content-docs/current/reference/command-lines/datanode.md index 7e802f1566..d212142404 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/reference/command-lines/datanode.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/reference/command-lines/datanode.md @@ -5,7 +5,13 @@ description: GreptimeDB datanode 命令行界面完整指南,包括配置选 # Datanode -## 子命令选项 +`greptime datanode` 命令提供了用于管理和基准测试 datanode 实例的子命令。 + +## start + +启动 datanode 服务。 + +### 选项 你可以通过以下命令列出所有选项: @@ -28,10 +34,9 @@ greptime datanode start --help 所有的 `addr` 类选项都是 `ip:port` 形式的字符串。 +### 示例 -## 示例 - -### 使用配置启动服务 +#### 使用配置启动服务 使用自定义配置启动 Datanode 实例: @@ -45,4 +50,37 @@ greptime datanode start -c config/datanode.example.toml greptime datanode start --rpc-bind-addr=0.0.0.0:4001 --mysql-addr=0.0.0.0:4002 --metasrv-addrs=0.0.0.0:3002 --node-id=1 ``` -`datanode.example.toml` 配置文件来自 `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` 仓库的 `config` 目录。你可以在那里找到更多示例配置文件。`-c` 选项指定配置文件,更多信息请参考 [Configuration](/user-guide/deployments-administration/configuration.md)。 \ No newline at end of file +`datanode.example.toml` 配置文件来自 `[GreptimeDB](https://github.com/GreptimeTeam/greptimedb/)` 仓库的 `config` 目录。你可以在那里找到更多示例配置文件。`-c` 选项指定配置文件,更多信息请参考 [Configuration](/user-guide/deployments-administration/configuration.md)。 + +## objbench + +`objbench` 子命令是一个用于测量对象存储上特定文件读写性能的基准测试工具。这对于诊断性能问题和测试存储层性能非常有用。 + +### 选项 + +| 选项 | 描述 | +| ------------------------------ | ---------------------------------------------------------------------------------------------------- | +| `--config ` | datanode 配置文件路径(TOML 格式) | +| `--source ` | 对象存储中的源 SST 文件路径(例如 `data/greptime/public/1024/1024_0000000000/metadata/.parquet`)| +| `-v`/`--verbose` | 启用详细输出 | +| `--pprof-file ` | pprof 火焰图的输出文件路径(启用性能分析)。生成 SVG 格式的火焰图文件 | + +### 示例 + +#### 基础基准测试 + +测量特定文件的读写性能: + +```sh +greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet +``` + +#### 带性能分析的基准测试 + +测量性能并生成用于性能分析的火焰图: + +```sh +greptime datanode objbench --config ./datanode.toml --source data/greptime/public/1024/1024_0000000000/metadata/8fb41bc7-a106-4b9e-879b-392da799f958.parquet --pprof-file=./flamegraph.svg +``` + +这将生成一个 SVG 格式的火焰图,可以在 Web 浏览器中打开进行性能分析。 \ No newline at end of file