2020-04-03 13:23:32 +00:00
|
|
|
|
---
|
2022-08-26 19:07:59 +00:00
|
|
|
|
slug: /zh/operations/performance-test
|
2022-04-10 23:08:18 +00:00
|
|
|
|
sidebar_position: 54
|
|
|
|
|
sidebar_label: "\u6D4B\u8BD5\u786C\u4EF6"
|
2020-04-03 13:23:32 +00:00
|
|
|
|
---
|
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
# 如何使用 ClickHouse 测试您的硬件 {#how-to-test-your-hardware-with-clickhouse}
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
你可以在任何服务器上运行基本的 ClickHouse 性能测试,而无需安装 ClickHouse 软件包。
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
## 自动运行
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
你可以使用一个简单脚本来运行基准测试。
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
1. 下载脚本
|
|
|
|
|
```
|
2022-07-12 18:25:40 +00:00
|
|
|
|
wget https://raw.githubusercontent.com/ClickHouse/ClickBench/main/hardware/hardware.sh
|
2021-11-11 11:47:24 +00:00
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
2. 运行脚本
|
|
|
|
|
```
|
|
|
|
|
chmod a+x ./hardware.sh
|
|
|
|
|
./hardware.sh
|
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
3. 复制输出的信息并将它发送给 feedback@clickhouse.com
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
所有的结果都在这里公布: https://clickhouse.com/benchmark/hardware/
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
## 人工运行
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
或者,你可以按照以下步骤实施基准测试。
|
|
|
|
|
```bash
|
|
|
|
|
# For amd64:
|
|
|
|
|
wget https://builds.clickhouse.com/master/amd64/clickhouse
|
|
|
|
|
# For aarch64:
|
|
|
|
|
wget https://builds.clickhouse.com/master/aarch64/clickhouse
|
2022-03-01 10:29:46 +00:00
|
|
|
|
# For powerpc64le:
|
|
|
|
|
wget https://builds.clickhouse.com/master/powerpc64le/clickhouse
|
|
|
|
|
# For freebsd:
|
|
|
|
|
wget https://builds.clickhouse.com/master/freebsd/clickhouse
|
|
|
|
|
# For freebsd-aarch64:
|
|
|
|
|
wget https://builds.clickhouse.com/master/freebsd-aarch64/clickhouse
|
|
|
|
|
# For freebsd-powerpc64le:
|
|
|
|
|
wget https://builds.clickhouse.com/master/freebsd-powerpc64le/clickhouse
|
|
|
|
|
# For macos:
|
|
|
|
|
wget https://builds.clickhouse.com/master/macos/clickhouse
|
|
|
|
|
# For macos-aarch64:
|
|
|
|
|
wget https://builds.clickhouse.com/master/macos-aarch64/clickhouse
|
2021-11-11 11:47:24 +00:00
|
|
|
|
# Then do:
|
|
|
|
|
chmod a+x clickhouse
|
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
2. 下载基准文件
|
|
|
|
|
```bash
|
2022-07-04 11:37:42 +00:00
|
|
|
|
wget https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/benchmark/hardware/benchmark-new.sh
|
2021-11-11 11:47:24 +00:00
|
|
|
|
chmod a+x benchmark-new.sh
|
2022-07-04 11:37:42 +00:00
|
|
|
|
wget https://raw.githubusercontent.com/ClickHouse/ClickHouse/master/benchmark/hardware/queries.sql
|
2021-11-11 11:47:24 +00:00
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
3. 根据 [Yandex.Metrica 数据集](../getting-started/example-datasets/metrica.md) 中的说明下载测试数据(“ hits ” 数据表包含 1 亿行记录)。
|
|
|
|
|
```bash
|
|
|
|
|
wget https://datasets.clickhouse.com/hits/partitions/hits_100m_obfuscated_v1.tar.xz
|
|
|
|
|
tar xvf hits_100m_obfuscated_v1.tar.xz -C .
|
|
|
|
|
mv hits_100m_obfuscated_v1/* .
|
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
4. 运行服务器:
|
|
|
|
|
```bash
|
|
|
|
|
./clickhouse server
|
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
5. 检查数据:在另一个终端中通过 ssh 登陆服务器
|
|
|
|
|
```bash
|
|
|
|
|
./clickhouse client --query "SELECT count() FROM hits_100m_obfuscated"
|
|
|
|
|
100000000
|
|
|
|
|
```
|
|
|
|
|
6. 运行基准测试:
|
|
|
|
|
```bash
|
|
|
|
|
./benchmark-new.sh hits_100m_obfuscated
|
|
|
|
|
```
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
7. 将有关硬件配置的型号和信息发送到 clickhouse-feedback@yandex-team.com
|
2020-04-03 13:23:32 +00:00
|
|
|
|
|
2021-11-11 11:47:24 +00:00
|
|
|
|
所有结果都在这里公布:https://clickhouse.com/benchmark/hardware/
|