From 4b3b53d1b36cabe2f988bdefb708bad5ddcfabc1 Mon Sep 17 00:00:00 2001 From: Yuanning Gao <1132781055@qq.com> Date: Fri, 15 May 2026 15:25:02 +0800 Subject: [PATCH] update Bytehouse --- bytehouse/NOTES.md | 284 -------------- bytehouse/README.md | 77 +--- bytehouse/benchmark.sh | 80 ++++ bytehouse/common.sh | 359 ++++++++++++++++++ bytehouse/config.sh | 14 + bytehouse/config.xml | 95 +++++ bytehouse/create.sql | 224 +++++------ bytehouse/query.sh | 18 + bytehouse/results/20220716/l.json | 235 ------------ bytehouse/results/20220716/m.json | 235 ------------ bytehouse/results/20220716/s.json | 235 ------------ bytehouse/results/20220716/xs.json | 235 ------------ bytehouse/results/20220727/l.json | 236 ------------ bytehouse/results/20220727/m.json | 236 ------------ bytehouse/results/20220727/s.json | 236 ------------ bytehouse/results/20220727/xs.json | 236 ------------ .../results/20260515/c7a.metal-48xl.json | 57 +++ bytehouse/run.sh | 68 +++- bytehouse/template.json | 12 + bytehouse/users.xml | 21 + 20 files changed, 846 insertions(+), 2347 deletions(-) delete mode 100644 bytehouse/NOTES.md create mode 100755 bytehouse/benchmark.sh create mode 100755 bytehouse/common.sh create mode 100644 bytehouse/config.sh create mode 100644 bytehouse/config.xml create mode 100644 bytehouse/query.sh delete mode 100644 bytehouse/results/20220716/l.json delete mode 100644 bytehouse/results/20220716/m.json delete mode 100644 bytehouse/results/20220716/s.json delete mode 100644 bytehouse/results/20220716/xs.json delete mode 100644 bytehouse/results/20220727/l.json delete mode 100644 bytehouse/results/20220727/m.json delete mode 100644 bytehouse/results/20220727/s.json delete mode 100644 bytehouse/results/20220727/xs.json create mode 100644 bytehouse/results/20260515/c7a.metal-48xl.json create mode 100644 bytehouse/template.json create mode 100644 bytehouse/users.xml diff --git a/bytehouse/NOTES.md b/bytehouse/NOTES.md deleted file mode 100644 index c6cdcf1c33..0000000000 --- a/bytehouse/NOTES.md +++ /dev/null @@ -1,284 +0,0 @@ -Bytehouse is a derivative of ClickHouse. -It is based on very old ClickHouse version (20.4.54418) and many features are unsupported. - -https://bytehouse.cloud/signup - -Sign Up. Only Asia-Pacific South-East 1 AWS region is available. Verify email. - -Create virtual warehouse. XL. - -Go to "Databases" and create database "test". - -Go to "SQL Worksheet" and copy-paste create.sql query there. - -Note: S3 import does not support public buckets. And it requires pasting secret access key, which we are not going to do. So, switch to using CLI. - -Create a machine in ap-southeast-1 region and install Bytehouse CLI: - -``` -curl -o bytehouse-cli -L https://github.com/bytehouse-cloud/cli/releases/download/v1.5.21/bytehouse-linux-amd64 -chmod +x bytehouse-cli -echo "alias bytehouse-cli=\"$(pwd)/bytehouse-cli\"" > ~/.bashrc -alias bytehouse-cli="$(pwd)/bytehouse-cli" -``` - -``` -export user='aleksei.milovidov' -export password='bGm45*sn%4j' # No worries, I've changed it. -export account='AWSPPCOZ' -export warehouse='test' -``` - -Unfortunately, it refused to work. -``` -$ ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure -./bytehouse-cli: line 1: Not: command not found -``` - -So, the further testing is not possible. Good luck. - -... after one minute. - -No, I will not give up. - -``` -$ cat bytehouse-cli -Not Foundubuntu@ip-172-31-22-83:~$ -``` - -Looks like their documentation is wrong and the links are broken: - -``` -ubuntu@ip-172-31-22-83:~$ curl https://github.com/bytehouse-cloud/cli/releases/download/v1.5.21/bytehouse-linux-amd64 -Not Foundubuntu@ip-172-31-22-83:~$ -``` - -The GitHub repository https://github.com/bytehouse-cloud/cli/ is hilarious. - -``` -wget --continue --progress=dot:giga https://github.com/bytehouse-cloud/cli/releases/download/v1.5.34/bytehouse-cli_1.5.34_Linux_x86_64.tar.gz -tar xvf bytehouse-cli_1.5.34_Linux_x86_64.tar.gz -``` - -Wow, it started to work. - -The CLI is using a well known Python command line toolkit and looks like a ~~christmas~~ Spring Festival tree. - -It gives misleading and badly formatted error messages: -``` -[code: 0, name: , no virtual warehouse selected, stack trace: ] -``` - -Ok, I can specify the warehouse in the command line: - -``` -./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" -``` - -But it does not help. Not only activating the warehouse took 5 minutes, but it does not work regardless: - -``` -ByteHouse » SELECT 1; - -SELECT 1 - -[log_id: f8af9bf5-8dc5-499a-8f02-8fdf36c76202] -Log: [Message: Turning on the virtual warehouse..., Time: 2022-07-15 21:20:05] -Log: [Message: Virtual warehouse resumed successfully, Time: 2022-07-15 21:25:12] -0 rows in set. Elapsed: 5m7.466406844s. Processed: 0 rows, 0.00 B (0.00 rows/s, 0.00 B/s). -[code: 910, name: DB::Exception, No local available worker group for vw-1092010213-test, stack trace: ] -─── End of Execution ─── - -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T21:25:12Z ── -ByteHouse » -ByteHouse » SELECT 1; - -SELECT 1 - -[log_id: 522a9c0e-5b90-4d0f-8713-f43e840812b5] -─── End of Execution ─── - -send query: write tcp 172.31.22.83:40018->3.33.240.187:19000: i/o timeout -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T21:44:57Z ── -ByteHouse » SELECT 1; - -SELECT 1 - -[log_id: 81128728-0eba-417b-9a4c-cb9708d9724c] -─── End of Execution ─── - -send query: write tcp 172.31.22.83:40018->3.33.240.187:19000: i/o timeout -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T21:45:02Z ── -``` - -> End of Execution - -No, it is only the beginning of execution. - -I will try to exit and start the CLI again. - -Note: the CLI does not support history, so I have to type "SELECT 1" again which is annoying. - -``` -[dial] secure=true, skip_verify=false, strategy=random, ident=1, server=0 -> 3.33.240.187:19000 -Server Information: ByteHouse 20.4.54418 -cannot resolve from server dynamically, using default settings from driver -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T22:00:52Z ── -ByteHouse » SELECT 1; - -SELECT 1 - -[log_id: 79c8bdb2-c244-4b59-97d0-b090f9c01dc7] -Log: [Message: Turning on the virtual warehouse..., Time: 2022-07-15 22:00:57] -0 rows in set. Elapsed: 5m39.997921614s. Processed: 0 rows, 0.00 B (0.00 rows/s, 0.00 B/s). -[code: 0, name: , EOF, stack trace: ] -─── End of Execution ─── - -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T22:06:37Z ── -ByteHouse » SELECT 1; - -SELECT 1 - -[log_id: 22f63d36-1e4e-4b70-9a89-84422720645d] -─── End of Execution ─── - -send query: write tcp 172.31.22.83:40028->3.33.240.187:19000: i/o timeout -▼ aleksei.milovidov@AWSPPCOZ « λ test « ap-southeast-1 « 2022-07-15T22:06:47Z ── -``` - -Now the warehouse did not even create. Give up? - -Let's try to run a query from the Web UI just to warm up the warehouse, then run a CLI in attempt to catch it... - -Yes, it works. - -But another attempt give the same error in the UI: - -``` -[code: 910, name: DB::Exception, No local available worker group for vw-1092010213-test, stack trace: ] -``` - -And it has stuck with this error. - -Ok, I will destroy the "warehouse" and create another. Now with size L and with timeout 1 hour. - -``` -ubuntu@ip-172-31-22-83:~$ time ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" --query "INSERT INTO test.hits FORMAT TSV" < hits.tsv[dial] secure=true, skip_verify=false, strategy=random, ident=1, server=0 -> 15.197.198.100:19000 -Server Information: ByteHouse 20.4.54418 - -INSERT INTO test.hits -FORMAT TSV - -[log_id: 5c1a1452-2b43-4b67-8f95-3e5e82c71d60] -─── End of Execution ─── - -insert: get format reader: driver-go(format.BlockStreamFmtReaderFactory): unrecognised input format: [TSV] - -real 0m0.561s -user 0m0.295s -sys 0m0.007s -ubuntu@ip-172-31-22-83:~$ time ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" --query "INSERT INTO test.hits FORMAT TabSeparated" < hits.tsv -[dial] secure=true, skip_verify=false, strategy=random, ident=1, server=0 -> 3.33.240.187:19000 -Server Information: ByteHouse 20.4.54418 - -INSERT INTO test.hits -FORMAT TabSeparated - -[log_id: 5fb9d1fe-2852-4530-bf29-441c98296297] -─── End of Execution ─── - -insert: get format reader: driver-go(format.BlockStreamFmtReaderFactory): unrecognised input format: [TABSEPARATED] - -real 0m0.512s -user 0m0.286s -sys 0m0.017s -``` - -Trash. - -Will try CSV. - -``` -wget --continue --progress=dot:giga 'https://datasets.clickhouse.com/hits_compatible/hits.csv.gz' -gzip -d -f hits.csv.gz -``` - -Now it started to work: - -``` -echo -n "Load time: " -command time -f '%e' ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" --query "INSERT INTO test.hits FORMAT CSV" < hits.csv -``` - -``` -99,997,497 total rows sent, 0 rows/s (81.14 GB, 0.00 B/s) -total rows sent: 99,997,497, average speed = 134,320 rows/s -Elapsed: 12m24.754608947s. 81.14 GB (108.94 MB/s). -─── End of Execution ─── - -real 12m25.310s -``` - -But SELECT queries don't work at all: - -``` -▼ aleksei.milovidov@AWSPPCOZ « ▯ test « λ test « ap-southeast-1 « 2022-07-15T23:17:25Z ── -ByteHouse » SELECT count() FROM hits - -SELECT count() -FROM hits - -[log_id: af5f0930-6de3-49d3-bcaf-af90d272f8b0] -0 rows in set. Elapsed: 4.059µs. Processed: 0 rows, 0.00 B (0.00 rows/s, 0.00 B/s). -[code: 0, name: , EOF, stack trace: ] -─── End of Execution ─── - -▼ aleksei.milovidov@AWSPPCOZ « ▯ test « λ test « ap-southeast-1 « 2022-07-15T23:17:31Z ── -ByteHouse » SELECT count(*) FROM hits - -SELECT count(*) -FROM hits - -[log_id: 8ce7ebab-8387-4fc5-8cdb-7dbe4cb4f5ec] -0 rows in set. Elapsed: 670ns. Processed: 0 rows, 0.00 B (0.00 rows/s, 0.00 B/s). -[code: 0, name: , EOF, stack trace: ] -─── End of Execution ─── - -▼ aleksei.milovidov@AWSPPCOZ « ▯ test « λ test « ap-southeast-1 « 2022-07-15T23:17:35Z ── -``` - -They start to work if you exit from the CLI and start over again. - -``` -ByteHouse » SELECT count() FROM hits - -SELECT count() -FROM hits - -[log_id: 461e8fee-d256-4955-93e5-92ccd6b948bc] -┌─count()──┐ -│ 99997497 │ -└──────────┘ -Profile Info: [Rows: 1, Bytes: 8, Blocks: 1, Applied Limit: false, Rows Before Limit: 0, Calculated Rows Before Limit: true] -Progress: 4.00 rows, 16.42 KB (0.00 rows/s, 0.00 B/s). -1 rows in set. Elapsed: 164.202317ms. Processed: 4 rows, 16.42 KB (24.36 rows/s, 99.97 KB/s). -End of Stream -─── End of Execution ─── -``` - -``` -./run.sh 2>&1 | tee log.txt -``` - -The statistics of the number of rows, and bytes processed is wrong. -Also it shows 200 million records in the UI while I only have 100 million. - -``` -cat log.txt | grep --text -F 'Elapsed' | - grep --text -oP 'Elapsed: [\d\.]+(ms|s)\. Processed: \d+ row' | - sed -r -e 's/Elapsed: ([0-9\.]+)(ms|s)\. Processed: ([0-9]+) row/\1 \2 \3/' | - awk '{ if ($3 == 0) { print "null" } else if ($2 == "ms") { print $1 / 1000 } else { print $1 } }' | - awk '{ if (i % 3 == 0) { printf "[" }; printf $1; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }' -``` - -TLDR: Bytehouse has some good and some bad parts. Everything good is derived from ClickHouse. And everything that they added on top of it is bad and makes the system almost unusable. diff --git a/bytehouse/README.md b/bytehouse/README.md index c395bce2f3..59beededf8 100644 --- a/bytehouse/README.md +++ b/bytehouse/README.md @@ -1,73 +1,18 @@ -Bytehouse is a derivative of ClickHouse. -It is based on very old ClickHouse version (20.4.54418) and many features are unsupported. +# ByteHouse ClickBench Reproduction -## Status +## Reproduce The Result -ByteHouse's international cloud (bytehouse.cloud) is no longer reachable -from outside the China region. The service still operates within China -via Volcengine. All existing results in this directory were collected -against the international cloud and have been re-tagged with -`"historical"`. Future submissions running against a self-managed -ByteHouse instance (or via Volcengine) should not be tagged historical. +If you want to reproduce the benchmark result, please send an email to [gaoyuanning@bytedance.com](mailto:gaoyuanning@bytedance.com) to get the EC2 login information. -https://bytehouse.cloud/signup +After logging in to the EC2 instance: -Sign Up. Only Asia-Pacific South-East 1 AWS region is available. Verify email. - -Create virtual warehouse. Size L. - -Go to "Databases" and create database "test". - -Go to "SQL Worksheet" and copy-paste create.sql query there. - -Note: S3 import does not support public buckets. And it requires pasting secret access key, which we are not going to do. So, switch to using CLI. - -Create a machine in ap-southeast-1 region and install Bytehouse CLI: - -``` -wget --continue --progress=dot:giga https://github.com/bytehouse-cloud/cli/releases/download/v1.5.34/bytehouse-cli_1.5.34_Linux_x86_64.tar.gz -tar xvf bytehouse-cli_1.5.34_Linux_x86_64.tar.gz -``` - -``` -export user='...' -export password='...' -export account='AWS...' -export warehouse='test' -``` - -``` -wget --continue --progress=dot:giga 'https://datasets.clickhouse.com/hits_compatible/hits.csv.gz' -gzip -d -f hits.csv.gz +```bash +git clone +cd ClickBench/bytehouse +./benchmark.sh ``` -Load the data: - -``` -echo -n "Load time: " -command time -f '%e' ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" --query "INSERT INTO test.hits FORMAT CSV" < hits.csv -``` - -``` -99,997,497 total rows sent, 0 rows/s (81.14 GB, 0.00 B/s) -total rows sent: 99,997,497, average speed = 134,320 rows/s -Elapsed: 12m24.754608947s. 81.14 GB (108.94 MB/s). -─── End of Execution ─── - -real 12m25.310s -``` - -Run the benchmark: - -``` -./run.sh 2>&1 | tee log.txt - -cat log.txt | grep --text -F 'Elapsed' | - grep --text -oP 'Elapsed: [\d\.]+(ms|s)\. Processed: \d+ row' | - sed -r -e 's/Elapsed: ([0-9\.]+)(ms|s)\. Processed: ([0-9]+) row/\1 \2 \3/' | - awk '{ if ($3 == 0) { print "null" } else if ($2 == "ms") { print $1 / 1000 } else { print $1 } }' | - awk '{ if (i % 3 == 0) { printf "[" }; printf $1; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }' -``` +## Notes -Note: cluster size L is the maximum that can be created. -An attempt to create XL gives "Failed AWAITING RESOURCES". +- Please use the EC2 environment provided through email for reproduction. +- Run the benchmark inside the `bytehouse` directory. diff --git a/bytehouse/benchmark.sh b/bytehouse/benchmark.sh new file mode 100755 index 0000000000..2eb20bbaa4 --- /dev/null +++ b/bytehouse/benchmark.sh @@ -0,0 +1,80 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ -x /usr/local/bin/bh-repro && "${BH_REPRO_BYPASS:-0}" != "1" ]]; then + exec sudo /usr/local/bin/bh-repro benchmark "$@" +fi + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SCRIPT_DIR}" + +LOCK_FILE="${BENCHMARK_LOCK_FILE:-${SCRIPT_DIR}/.benchmark.lock}" +LOCK_DIR="" +LOCK_FD="" + +source "${SCRIPT_DIR}/common.sh" + +acquire_lock() { + mkdir -p "$(dirname "${LOCK_FILE}")" + + if command -v flock >/dev/null 2>&1; then + exec {LOCK_FD}>"${LOCK_FILE}" + if ! flock -n "${LOCK_FD}"; then + echo "Another ./benchmark.sh process is already running (lock: ${LOCK_FILE})." >&2 + exit 1 + fi + return 0 + fi + + LOCK_DIR="${LOCK_FILE}.d" + if mkdir "${LOCK_DIR}" 2>/dev/null; then + printf '%s\n' "$$" > "${LOCK_DIR}/pid" + return 0 + fi + + if [[ -f "${LOCK_DIR}/pid" ]]; then + local owner_pid + owner_pid="$(<"${LOCK_DIR}/pid")" + if [[ -n "${owner_pid}" ]] && ! kill -0 "${owner_pid}" 2>/dev/null; then + rm -rf "${LOCK_DIR}" + if mkdir "${LOCK_DIR}" 2>/dev/null; then + printf '%s\n' "$$" > "${LOCK_DIR}/pid" + return 0 + fi + fi + fi + + echo "Another ./benchmark.sh process is already running (lock: ${LOCK_FILE})." >&2 + exit 1 +} + +cleanup() { + if [[ "${CLEANUP_SERVER_ON_EXIT}" == "1" ]]; then + bytehouse::stop_server + fi + + if [[ -n "${LOCK_DIR}" ]]; then + rm -rf "${LOCK_DIR}" + fi + + if [[ -n "${LOCK_FD}" ]] && command -v flock >/dev/null 2>&1; then + flock -u "${LOCK_FD}" 2>/dev/null || true + fi +} + +acquire_lock +trap cleanup EXIT + +bytehouse::setup_runtime +bytehouse::download_data_if_needed + +bytehouse::start_server +bytehouse::create_table + +echo -n "Load time: " +bytehouse::load_data + +"${SCRIPT_DIR}/run.sh" + +echo "Data size: $(bytehouse::table_size_bytes)" diff --git a/bytehouse/common.sh b/bytehouse/common.sh new file mode 100755 index 0000000000..69791fd740 --- /dev/null +++ b/bytehouse/common.sh @@ -0,0 +1,359 @@ +#!/usr/bin/env bash + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +BUNDLE_DIR="${SCRIPT_DIR}/bundle" +if [[ ! -d "${BUNDLE_DIR}" ]]; then + BUNDLE_DIR="/opt/bytehouse" +fi +CONFIG_FILE="${CONFIG_FILE:-${SCRIPT_DIR}/config.sh}" +SERVER_CONFIG_TEMPLATE="${SERVER_CONFIG_TEMPLATE:-${SCRIPT_DIR}/config.xml}" +SERVER_USERS_TEMPLATE="${SERVER_USERS_TEMPLATE:-${SCRIPT_DIR}/users.xml}" + +if [[ ! -f "${CONFIG_FILE}" ]]; then + echo "Missing ByteHouse benchmark config: ${CONFIG_FILE}" >&2 + exit 1 +fi + +# shellcheck source=/dev/null +source "${CONFIG_FILE}" + +CLICKHOUSE_BIN="${CLICKHOUSE_BIN:-${BUNDLE_DIR}/bin/bytehouse}" +CLICKHOUSE_LIB_DIR="${CLICKHOUSE_LIB_DIR:-${BUNDLE_DIR}/lib}" + +QUERY_FILE="${QUERY_FILE:-${SCRIPT_DIR}/queries.sql}" +CREATE_SQL_FILE="${CREATE_SQL_FILE:-${SCRIPT_DIR}/create.sql}" +DATA_FILE="${DATA_FILE:-${SCRIPT_DIR}/hits.parquet}" +RESULT_CSV="${RESULT_CSV:-${SCRIPT_DIR}/result.csv}" +RESULT_MATRIX_CSV="${RESULT_MATRIX_CSV:-${SCRIPT_DIR}/result_matrix.csv}" + +TABLE_NAME="${TABLE_NAME:-hits}" +LOCAL_TABLE_NAME="${LOCAL_TABLE_NAME:-hits_local}" +CLUSTER_NAME="${CLUSTER_NAME:-bytehouse_single}" +DATA_FORMAT="${DATA_FORMAT:-Parquet}" +HITS_DATA_URL="${HITS_DATA_URL:-https://datasets.clickhouse.com/hits_compatible/hits.parquet}" + +SERVER_HOST="${SERVER_HOST:-127.0.0.1}" +SERVER_PORT="${SERVER_PORT:-19000}" +SERVER_HTTP_PORT="${SERVER_HTTP_PORT:-18123}" +SERVER_MYSQL_PORT="${SERVER_MYSQL_PORT:-19004}" +SERVER_HA_TCP_PORT="${SERVER_HA_TCP_PORT:-19019}" +SERVER_EXCHANGE_PORT="${SERVER_EXCHANGE_PORT:-19001}" +SERVER_EXCHANGE_STATUS_PORT="${SERVER_EXCHANGE_STATUS_PORT:-19002}" +SERVER_INTERSERVER_HTTP_PORT="${SERVER_INTERSERVER_HTTP_PORT:-18124}" +SERVER_KEEPER_TCP_PORT="${SERVER_KEEPER_TCP_PORT:-19181}" +SERVER_KEEPER_RAFT_PORT="${SERVER_KEEPER_RAFT_PORT:-19234}" +RUNTIME_DIR="${RUNTIME_DIR:-${SCRIPT_DIR}/.runtime}" +SERVER_DATA_DIR="${SERVER_DATA_DIR:-${RUNTIME_DIR}/data}" +SERVER_TMP_DIR="${SERVER_TMP_DIR:-${RUNTIME_DIR}/tmp}" +SERVER_USER_FILES_DIR="${SERVER_USER_FILES_DIR:-${RUNTIME_DIR}/user_files}" +SERVER_LOG_DIR="${SERVER_LOG_DIR:-${RUNTIME_DIR}/logs}" +SERVER_FORMAT_SCHEMA_DIR="${SERVER_FORMAT_SCHEMA_DIR:-${RUNTIME_DIR}/format_schemas}" +SERVER_KEEPER_LOG_DIR="${SERVER_KEEPER_LOG_DIR:-${RUNTIME_DIR}/keeper/log}" +SERVER_KEEPER_SNAPSHOT_DIR="${SERVER_KEEPER_SNAPSHOT_DIR:-${RUNTIME_DIR}/keeper/snapshot}" +SERVER_CONFIG_FILE="${SERVER_CONFIG_FILE:-${RUNTIME_DIR}/config.xml}" +SERVER_USERS_FILE="${SERVER_USERS_FILE:-${RUNTIME_DIR}/users.xml}" +SERVER_PID_FILE="${SERVER_PID_FILE:-${RUNTIME_DIR}/server.pid}" +SERVER_LOG_FILE="${SERVER_LOG_FILE:-${SERVER_LOG_DIR}/server.log}" +SERVER_ERROR_LOG_FILE="${SERVER_ERROR_LOG_FILE:-${SERVER_LOG_DIR}/server.err.log}" + +QUERY_CLIENT_FLAGS="${QUERY_CLIENT_FLAGS:-}" +declare -a QUERY_CLIENT_FLAG_ARGS=() +if [[ -n "${QUERY_CLIENT_FLAGS}" ]]; then + read -r -a QUERY_CLIENT_FLAG_ARGS <<< "${QUERY_CLIENT_FLAGS}" +fi + +export LD_LIBRARY_PATH="${CLICKHOUSE_LIB_DIR}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" + +bytehouse::require_file() { + local path="$1" + local description="$2" + + if [[ ! -f "${path}" ]]; then + echo "Missing ${description}: ${path}" >&2 + exit 1 + fi +} + +bytehouse::setup_runtime() { + bytehouse::require_file "${CLICKHOUSE_BIN}" "ByteHouse binary" + bytehouse::require_file "${QUERY_FILE}" "ClickBench query file" + bytehouse::require_file "${CREATE_SQL_FILE}" "ClickBench create.sql" + bytehouse::require_file "${SERVER_CONFIG_TEMPLATE}" "ByteHouse config.xml template" + bytehouse::require_file "${SERVER_USERS_TEMPLATE}" "ByteHouse users.xml template" +} + +bytehouse::download_data_if_needed() { + if [[ "${FORCE_REDOWNLOAD_DATA:-0}" == "1" ]]; then + rm -f "${DATA_FILE}" + fi + + if [[ -f "${DATA_FILE}" ]]; then + return 0 + fi + + echo "Downloading dataset to ${DATA_FILE} ..." >&2 + if command -v wget >/dev/null 2>&1; then + wget --continue --progress=dot:giga -O "${DATA_FILE}" "${HITS_DATA_URL}" + elif command -v curl >/dev/null 2>&1; then + curl -L --fail --output "${DATA_FILE}" "${HITS_DATA_URL}" + else + echo "Neither wget nor curl is available for downloading ${HITS_DATA_URL}" >&2 + exit 1 + fi +} + +bytehouse::prepare_server_runtime() { + rm -rf "${SERVER_DATA_DIR}" "${SERVER_TMP_DIR}" "${SERVER_USER_FILES_DIR}" "${SERVER_LOG_DIR}" "${SERVER_FORMAT_SCHEMA_DIR}" "${SERVER_KEEPER_LOG_DIR}" "${SERVER_KEEPER_SNAPSHOT_DIR}" + mkdir -p \ + "${SERVER_DATA_DIR}" \ + "${SERVER_TMP_DIR}" \ + "${SERVER_USER_FILES_DIR}" \ + "${SERVER_LOG_DIR}" \ + "${SERVER_FORMAT_SCHEMA_DIR}" \ + "${SERVER_KEEPER_LOG_DIR}" \ + "${SERVER_KEEPER_SNAPSHOT_DIR}" + + rm -f "${SERVER_CONFIG_FILE}" "${SERVER_USERS_FILE}" "${SERVER_PID_FILE}" +} + +bytehouse::stage_data_file() { + bytehouse::require_file "${DATA_FILE}" "ClickBench data file" + cp -f "${DATA_FILE}" "${SERVER_USER_FILES_DIR}/$(basename "${DATA_FILE}")" +} + +bytehouse::write_server_config() { + local config_content + local users_content + + config_content="$(<"${SERVER_CONFIG_TEMPLATE}")" + config_content="${config_content//__SERVER_LOG_FILE__/${SERVER_LOG_FILE}}" + config_content="${config_content//__SERVER_ERROR_LOG_FILE__/${SERVER_ERROR_LOG_FILE}}" + config_content="${config_content//__SERVER_HOST__/${SERVER_HOST}}" + config_content="${config_content//__SERVER_HTTP_PORT__/${SERVER_HTTP_PORT}}" + config_content="${config_content//__SERVER_PORT__/${SERVER_PORT}}" + config_content="${config_content//__SERVER_MYSQL_PORT__/${SERVER_MYSQL_PORT}}" + config_content="${config_content//__SERVER_HA_TCP_PORT__/${SERVER_HA_TCP_PORT}}" + config_content="${config_content//__SERVER_EXCHANGE_STATUS_PORT__/${SERVER_EXCHANGE_STATUS_PORT}}" + config_content="${config_content//__SERVER_EXCHANGE_PORT__/${SERVER_EXCHANGE_PORT}}" + config_content="${config_content//__SERVER_INTERSERVER_HTTP_PORT__/${SERVER_INTERSERVER_HTTP_PORT}}" + config_content="${config_content//__SERVER_DATA_DIR__/${SERVER_DATA_DIR}}" + config_content="${config_content//__SERVER_TMP_DIR__/${SERVER_TMP_DIR}}" + config_content="${config_content//__SERVER_USER_FILES_DIR__/${SERVER_USER_FILES_DIR}}" + config_content="${config_content//__SERVER_FORMAT_SCHEMA_DIR__/${SERVER_FORMAT_SCHEMA_DIR}}" + config_content="${config_content//__CLUSTER_NAME__/${CLUSTER_NAME}}" + config_content="${config_content//__SERVER_KEEPER_TCP_PORT__/${SERVER_KEEPER_TCP_PORT}}" + config_content="${config_content//__SERVER_KEEPER_LOG_DIR__/${SERVER_KEEPER_LOG_DIR}}" + config_content="${config_content//__SERVER_KEEPER_SNAPSHOT_DIR__/${SERVER_KEEPER_SNAPSHOT_DIR}}" + config_content="${config_content//__SERVER_KEEPER_RAFT_PORT__/${SERVER_KEEPER_RAFT_PORT}}" + config_content="${config_content//__SERVER_USERS_FILE__/${SERVER_USERS_FILE}}" + + printf '%s\n' "${config_content}" > "${SERVER_CONFIG_FILE}" + + users_content="$(<"${SERVER_USERS_TEMPLATE}")" + printf '%s\n' "${users_content}" > "${SERVER_USERS_FILE}" +} + +bytehouse::server_is_running() { + if [[ ! -f "${SERVER_PID_FILE}" ]]; then + return 1 + fi + + local pid + pid="$(cat "${SERVER_PID_FILE}")" + if [[ -z "${pid}" ]] || ! kill -0 "${pid}" 2>/dev/null; then + return 1 + fi + + if ! bytehouse::client --query "SELECT 1" >/dev/null 2>&1; then + return 1 + fi + + bytehouse::verify_server_identity >/dev/null 2>&1 +} + +bytehouse::require_running_server() { + if ! bytehouse::server_is_running; then + echo "ByteHouse server is not running. Start it with ./benchmark.sh first, or keep CLEANUP_SERVER_ON_EXIT=0 for query-only reruns." >&2 + exit 1 + fi +} + +bytehouse::require_table_loaded() { + local exists + + exists="$(bytehouse::client --query "EXISTS TABLE ${LOCAL_TABLE_NAME} FORMAT TSVRaw" 2>/dev/null | tr -d '[:space:]')" + if [[ "${exists}" != "1" ]]; then + echo "Table ${LOCAL_TABLE_NAME} does not exist. Run ./benchmark.sh to create and load data first." >&2 + exit 1 + fi +} + +bytehouse::client() { + "${CLICKHOUSE_BIN}" client \ + --host "${SERVER_HOST}" \ + --port "${SERVER_PORT}" \ + "$@" +} + +bytehouse::verify_server_identity() { + local actual_user_files_path + local actual_tcp_port + + actual_user_files_path="$(bytehouse::client --query "SELECT value FROM system.server_settings WHERE name = 'user_files_path' FORMAT TSVRaw" 2>/dev/null | tr -d '\r')" + actual_tcp_port="$(bytehouse::client --query "SELECT value FROM system.server_settings WHERE name = 'tcp_port' FORMAT TSVRaw" 2>/dev/null | tr -d '\r')" + + if [[ -n "${actual_tcp_port}" && "${actual_tcp_port}" != "${SERVER_PORT}" ]]; then + echo "Connected to unexpected ClickHouse TCP port: ${actual_tcp_port} (expected ${SERVER_PORT})." >&2 + echo "This usually means another local ClickHouse service is running and the benchmark is connected to the wrong instance." >&2 + exit 1 + fi + + if [[ -n "${actual_user_files_path}" && "${actual_user_files_path}" != "${SERVER_USER_FILES_DIR}/" ]]; then + echo "Connected server user_files_path is ${actual_user_files_path}, expected ${SERVER_USER_FILES_DIR}/." >&2 + echo "This usually means the benchmark is connected to another ClickHouse service instead of the Ce ByteHouse instance started by the script." >&2 + exit 1 + fi +} + +bytehouse::wait_for_server() { + local attempt + + for attempt in $(seq 1 60); do + if bytehouse::client --query "SELECT 1" >/dev/null 2>&1; then + bytehouse::verify_server_identity + return 0 + fi + sleep 1 + done + + echo "ByteHouse server did not become ready in time." >&2 + if [[ -f "${SERVER_LOG_FILE}" ]]; then + echo "--- server log ---" >&2 + tail -n 50 "${SERVER_LOG_FILE}" >&2 || true + fi + if [[ -f "${SERVER_ERROR_LOG_FILE}" ]]; then + echo "--- server error log ---" >&2 + tail -n 50 "${SERVER_ERROR_LOG_FILE}" >&2 || true + fi + exit 1 +} + +bytehouse::start_server() { + bytehouse::stop_server + bytehouse::prepare_server_runtime + bytehouse::stage_data_file + bytehouse::write_server_config + + "${CLICKHOUSE_BIN}" server \ + --config-file "${SERVER_CONFIG_FILE}" \ + --daemon \ + --pidfile "${SERVER_PID_FILE}" + + bytehouse::wait_for_server +} + +bytehouse::stop_server() { + if [[ -f "${SERVER_PID_FILE}" ]]; then + local pid + local attempt + pid="$(cat "${SERVER_PID_FILE}")" + if [[ -n "${pid}" ]] && kill -0 "${pid}" 2>/dev/null; then + kill "${pid}" 2>/dev/null || true + for attempt in $(seq 1 30); do + if ! kill -0 "${pid}" 2>/dev/null; then + break + fi + sleep 1 + done + if kill -0 "${pid}" 2>/dev/null; then + kill -9 "${pid}" 2>/dev/null || true + fi + fi + rm -f "${SERVER_PID_FILE}" + fi +} + +bytehouse::create_table() { + bytehouse::client --multiquery < "${CREATE_SQL_FILE}" +} + +bytehouse::import_data() { + local data_name + local insert_threads + local -a insert_settings=() + local -a client_args=() + + data_name="$(basename "${DATA_FILE}")" + + if [[ -n "${IMPORT_MAX_THREADS}" && "${IMPORT_MAX_THREADS}" == "0" ]]; then + insert_threads=$(( $(nproc) / 4 )) + (( insert_threads < 1 )) && insert_threads=1 + insert_settings+=("max_insert_threads = ${insert_threads}") + client_args+=(--max_insert_threads "${insert_threads}") + elif [[ -n "${IMPORT_MAX_THREADS}" ]]; then + insert_threads="${IMPORT_MAX_THREADS}" + insert_settings+=("max_insert_threads = ${insert_threads}") + client_args+=(--max_insert_threads "${insert_threads}") + fi + + if [[ -n "${IMPORT_MIN_INSERT_BLOCK_SIZE_ROWS}" && "${IMPORT_MIN_INSERT_BLOCK_SIZE_ROWS}" != "0" ]]; then + insert_settings+=("min_insert_block_size_rows = ${IMPORT_MIN_INSERT_BLOCK_SIZE_ROWS}") + fi + + if [[ -n "${IMPORT_MIN_INSERT_BLOCK_SIZE_BYTES}" && "${IMPORT_MIN_INSERT_BLOCK_SIZE_BYTES}" != "0" ]]; then + insert_settings+=("min_insert_block_size_bytes = ${IMPORT_MIN_INSERT_BLOCK_SIZE_BYTES}") + fi + + if [[ -n "${IMPORT_MAX_INSERT_BLOCK_SIZE}" && "${IMPORT_MAX_INSERT_BLOCK_SIZE}" != "0" ]]; then + insert_settings+=("max_insert_block_size = ${IMPORT_MAX_INSERT_BLOCK_SIZE}") + fi + + bytehouse::client \ + --query "INSERT INTO ${LOCAL_TABLE_NAME} SELECT * FROM file('${data_name}', ${DATA_FORMAT})$(if ((${#insert_settings[@]} > 0)); then printf ' SETTINGS %s' "$(IFS=', '; echo "${insert_settings[*]}")"; fi)" \ + "${client_args[@]}" 2>&1 | tail -n1 +} + +bytehouse::optimize_table_final() { + if [[ "${OPTIMIZE_TABLE_FINAL}" != "1" ]]; then + return 0 + fi + + bytehouse::client \ + --query "OPTIMIZE TABLE ${LOCAL_TABLE_NAME} FINAL SETTINGS ${OPTIMIZE_TABLE_FINAL_SETTINGS}" >/dev/null +} + +bytehouse::load_data() { + { + TIMEFORMAT='%R' + time { + bytehouse::import_data >/dev/null + bytehouse::optimize_table_final + } + } 2>&1 | tail -n1 +} + +bytehouse::table_size_bytes() { + bytehouse::client \ + --query "SELECT total_bytes FROM system.tables WHERE database = currentDatabase() AND name = '${LOCAL_TABLE_NAME}'" 2>/dev/null | tr -d '[:space:]' +} + +bytehouse::maybe_drop_caches() { + [[ "${DROP_CACHES}" != "1" ]] && return 0 + + if sudo -n /usr/local/sbin/drop-caches.sh 2>/dev/null; then + return 0 + fi + echo "DROP_CACHES=1 requested, but dropping caches is not permitted; continuing without it." >&2 +} + +bytehouse::run_query() { + local query="$1" + + bytehouse::client \ + --time \ + --format Null \ + "${QUERY_CLIENT_FLAG_ARGS[@]}" \ + --query "${query}" 2>&1 | tail -n1 +} diff --git a/bytehouse/config.sh b/bytehouse/config.sh new file mode 100644 index 0000000000..91b51d8b7d --- /dev/null +++ b/bytehouse/config.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# Benchmark execution +: "${TRIES:=3}" +: "${DROP_CACHES:=1}" +: "${CLEANUP_SERVER_ON_EXIT:=0}" + +# Load/import tuning +: "${OPTIMIZE_TABLE_FINAL:=0}" +: "${OPTIMIZE_TABLE_FINAL_SETTINGS:=optimize_throw_if_noop = 0}" +: "${IMPORT_MAX_THREADS:=0}" +: "${IMPORT_MIN_INSERT_BLOCK_SIZE_ROWS:=0}" +: "${IMPORT_MIN_INSERT_BLOCK_SIZE_BYTES:=0}" +: "${IMPORT_MAX_INSERT_BLOCK_SIZE:=0}" diff --git a/bytehouse/config.xml b/bytehouse/config.xml new file mode 100644 index 0000000000..f8824f8a09 --- /dev/null +++ b/bytehouse/config.xml @@ -0,0 +1,95 @@ + + + warning + __SERVER_LOG_FILE__ + __SERVER_ERROR_LOG_FILE__ + false + + + bytehouse_clickbench + __SERVER_HOST__ + __SERVER_HTTP_PORT__ + __SERVER_PORT__ + __SERVER_MYSQL_PORT__ + __SERVER_HA_TCP_PORT__ + __SERVER_EXCHANGE_STATUS_PORT__ + __SERVER_EXCHANGE_PORT__ + __SERVER_INTERSERVER_HTTP_PORT__ + __SERVER_HOST__ + + __SERVER_DATA_DIR__/ + __SERVER_TMP_DIR__/ + __SERVER_USER_FILES_DIR__/ + __SERVER_FORMAT_SCHEMA_DIR__/ + + + + + + ::/0 + + default + default + 1 + + + + + + + + + + + + + <__CLUSTER_NAME__> + + + __SERVER_HOST__ + __SERVER_PORT__ + __SERVER_HTTP_PORT__ + __SERVER_EXCHANGE_STATUS_PORT__ + __SERVER_EXCHANGE_PORT__ + __SERVER_HA_TCP_PORT__ + __SERVER_HOST__ + + + + + + + __SERVER_KEEPER_TCP_PORT__ + 1 + __SERVER_KEEPER_LOG_DIR__ + __SERVER_KEEPER_SNAPSHOT_DIR__ + + + 1 + __SERVER_HOST__ + __SERVER_KEEPER_RAFT_PORT__ + + + + 10000 + 30000 + + + + + + __SERVER_HOST__ + __SERVER_KEEPER_TCP_PORT__ + + + + __SERVER_USERS_FILE__ + + + shard_0 + 1 + 0 + __SERVER_HOST__ + 1 + + diff --git a/bytehouse/create.sql b/bytehouse/create.sql index 3505b3a4d2..d450c66f1f 100644 --- a/bytehouse/create.sql +++ b/bytehouse/create.sql @@ -1,110 +1,118 @@ -CREATE TABLE test.hits +DROP TABLE IF EXISTS hits_local; +DROP TABLE IF EXISTS hits; + +CREATE TABLE hits_local ( - `WatchID` Int64, - `JavaEnable` Int16, - `Title` String, - `GoodEvent` Int16, - `EventTime` DateTime, - `EventDate` Date, - `CounterID` Int32, - `ClientIP` Int32, - `RegionID` Int32, - `UserID` Int64, - `CounterClass` Int16, - `OS` Int16, - `UserAgent` Int16, - `URL` String, - `Referer` String, - `IsRefresh` Int16, - `RefererCategoryID` Int16, - `RefererRegionID` Int32, - `URLCategoryID` Int16, - `URLRegionID` Int32, - `ResolutionWidth` Int16, - `ResolutionHeight` Int16, - `ResolutionDepth` Int16, - `FlashMajor` Int16, - `FlashMinor` Int16, - `FlashMinor2` String, - `NetMajor` Int16, - `NetMinor` Int16, - `UserAgentMajor` Int16, - `UserAgentMinor` String, - `CookieEnable` Int16, - `JavascriptEnable` Int16, - `IsMobile` Int16, - `MobilePhone` Int16, - `MobilePhoneModel` String, - `Params` String, - `IPNetworkID` Int32, - `TraficSourceID` Int16, - `SearchEngineID` Int16, - `SearchPhrase` String, - `AdvEngineID` Int16, - `IsArtifical` Int16, - `WindowClientWidth` Int16, - `WindowClientHeight` Int16, - `ClientTimeZone` Int16, - `ClientEventTime` DateTime, - `SilverlightVersion1` Int16, - `SilverlightVersion2` Int16, - `SilverlightVersion3` Int32, - `SilverlightVersion4` Int16, - `PageCharset` String, - `CodeVersion` Int32, - `IsLink` Int16, - `IsDownload` Int16, - `IsNotBounce` Int16, - `FUniqID` Int64, - `OriginalURL` String, - `HID` Int32, - `IsOldCounter` Int16, - `IsEvent` Int16, - `IsParameter` Int16, - `DontCountHits` Int16, - `WithHash` Int16, - `HitColor` String, - `LocalEventTime` DateTime, - `Age` Int16, - `Sex` Int16, - `Income` Int16, - `Interests` Int16, - `Robotness` Int16, - `RemoteIP` Int32, - `WindowName` Int32, - `OpenerName` Int32, - `HistoryLength` Int16, - `BrowserLanguage` String, - `BrowserCountry` String, - `SocialNetwork` String, - `SocialAction` String, - `HTTPError` Int16, - `SendTiming` Int32, - `DNSTiming` Int32, - `ConnectTiming` Int32, - `ResponseStartTiming` Int32, - `ResponseEndTiming` Int32, - `FetchTiming` Int32, - `SocialSourceNetworkID` Int16, - `SocialSourcePage` String, - `ParamPrice` Int64, - `ParamOrderID` String, - `ParamCurrency` String, - `ParamCurrencyID` Int16, - `OpenstatServiceName` String, - `OpenstatCampaignID` String, - `OpenstatAdID` String, - `OpenstatSourceID` String, - `UTMSource` String, - `UTMMedium` String, - `UTMCampaign` String, - `UTMContent` String, - `UTMTerm` String, - `FromTag` String, - `HasGCLID` Int16, - `RefererHash` Int64, - `URLHash` Int64, - `CLID` Int32 + WatchID BIGINT NOT NULL, + JavaEnable SMALLINT NOT NULL, + Title TEXT NOT NULL, + GoodEvent SMALLINT NOT NULL, + EventTime TIMESTAMP NOT NULL, + EventDate Date NOT NULL, + CounterID INTEGER NOT NULL, + ClientIP INTEGER NOT NULL, + RegionID INTEGER NOT NULL, + UserID BIGINT NOT NULL, + CounterClass SMALLINT NOT NULL, + OS SMALLINT NOT NULL, + UserAgent SMALLINT NOT NULL, + URL TEXT NOT NULL, + Referer TEXT NOT NULL, + IsRefresh SMALLINT NOT NULL, + RefererCategoryID SMALLINT NOT NULL, + RefererRegionID INTEGER NOT NULL, + URLCategoryID SMALLINT NOT NULL, + URLRegionID INTEGER NOT NULL, + ResolutionWidth SMALLINT NOT NULL, + ResolutionHeight SMALLINT NOT NULL, + ResolutionDepth SMALLINT NOT NULL, + FlashMajor SMALLINT NOT NULL, + FlashMinor SMALLINT NOT NULL, + FlashMinor2 TEXT NOT NULL, + NetMajor SMALLINT NOT NULL, + NetMinor SMALLINT NOT NULL, + UserAgentMajor SMALLINT NOT NULL, + UserAgentMinor VARCHAR(255) NOT NULL, + CookieEnable SMALLINT NOT NULL, + JavascriptEnable SMALLINT NOT NULL, + IsMobile SMALLINT NOT NULL, + MobilePhone SMALLINT NOT NULL, + MobilePhoneModel TEXT NOT NULL, + Params TEXT NOT NULL, + IPNetworkID INTEGER NOT NULL, + TraficSourceID SMALLINT NOT NULL, + SearchEngineID SMALLINT NOT NULL, + SearchPhrase TEXT NOT NULL, + AdvEngineID SMALLINT NOT NULL, + IsArtifical SMALLINT NOT NULL, + WindowClientWidth SMALLINT NOT NULL, + WindowClientHeight SMALLINT NOT NULL, + ClientTimeZone SMALLINT NOT NULL, + ClientEventTime TIMESTAMP NOT NULL, + SilverlightVersion1 SMALLINT NOT NULL, + SilverlightVersion2 SMALLINT NOT NULL, + SilverlightVersion3 INTEGER NOT NULL, + SilverlightVersion4 SMALLINT NOT NULL, + PageCharset TEXT NOT NULL, + CodeVersion INTEGER NOT NULL, + IsLink SMALLINT NOT NULL, + IsDownload SMALLINT NOT NULL, + IsNotBounce SMALLINT NOT NULL, + FUniqID BIGINT NOT NULL, + OriginalURL TEXT NOT NULL, + HID INTEGER NOT NULL, + IsOldCounter SMALLINT NOT NULL, + IsEvent SMALLINT NOT NULL, + IsParameter SMALLINT NOT NULL, + DontCountHits SMALLINT NOT NULL, + WithHash SMALLINT NOT NULL, + HitColor CHAR NOT NULL, + LocalEventTime TIMESTAMP NOT NULL, + Age SMALLINT NOT NULL, + Sex SMALLINT NOT NULL, + Income SMALLINT NOT NULL, + Interests SMALLINT NOT NULL, + Robotness SMALLINT NOT NULL, + RemoteIP INTEGER NOT NULL, + WindowName INTEGER NOT NULL, + OpenerName INTEGER NOT NULL, + HistoryLength SMALLINT NOT NULL, + BrowserLanguage TEXT NOT NULL, + BrowserCountry TEXT NOT NULL, + SocialNetwork TEXT NOT NULL, + SocialAction TEXT NOT NULL, + HTTPError SMALLINT NOT NULL, + SendTiming INTEGER NOT NULL, + DNSTiming INTEGER NOT NULL, + ConnectTiming INTEGER NOT NULL, + ResponseStartTiming INTEGER NOT NULL, + ResponseEndTiming INTEGER NOT NULL, + FetchTiming INTEGER NOT NULL, + SocialSourceNetworkID SMALLINT NOT NULL, + SocialSourcePage TEXT NOT NULL, + ParamPrice BIGINT NOT NULL, + ParamOrderID TEXT NOT NULL, + ParamCurrency TEXT NOT NULL, + ParamCurrencyID SMALLINT NOT NULL, + OpenstatServiceName TEXT NOT NULL, + OpenstatCampaignID TEXT NOT NULL, + OpenstatAdID TEXT NOT NULL, + OpenstatSourceID TEXT NOT NULL, + UTMSource TEXT NOT NULL, + UTMMedium TEXT NOT NULL, + UTMCampaign TEXT NOT NULL, + UTMContent TEXT NOT NULL, + UTMTerm TEXT NOT NULL, + FromTag TEXT NOT NULL, + HasGCLID SMALLINT NOT NULL, + RefererHash BIGINT NOT NULL, + URLHash BIGINT NOT NULL, + CLID INTEGER NOT NULL ) -ENGINE = CnchMergeTree -ORDER BY (CounterID, EventDate, UserID, EventTime, WatchID); +ENGINE = MergeTree +ORDER BY (CounterID, EventDate, UserID, EventTime, WatchID) +SETTINGS + fsync_after_insert = 1; + +CREATE TABLE hits AS hits_local +ENGINE = Distributed('bytehouse_single', 'default', 'hits_local', rand()); diff --git a/bytehouse/query.sh b/bytehouse/query.sh new file mode 100644 index 0000000000..9e733c0e0e --- /dev/null +++ b/bytehouse/query.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [[ -x /usr/local/bin/bh-repro && "${BH_REPRO_BYPASS:-0}" != "1" ]]; then + exec sudo /usr/local/bin/bh-repro query "$@" +fi + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SCRIPT_DIR}" + +source "${SCRIPT_DIR}/common.sh" + +bytehouse::setup_runtime +bytehouse::require_running_server +bytehouse::require_table_loaded + +"${SCRIPT_DIR}/run.sh" diff --git a/bytehouse/results/20220716/l.json b/bytehouse/results/20220716/l.json deleted file mode 100644 index 8715df88fc..0000000000 --- a/bytehouse/results/20220716/l.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-16", - "machine": "L", - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.147, - 0.127, - 0.128 - ], - [ - 0.203, - 0.146, - 0.144 - ], - [ - 0.201, - 0.139, - 0.169 - ], - [ - 0.201, - 0.131, - 0.148 - ], - [ - 1.119, - 1.177, - 1.105 - ], - [ - 1.081, - 1.008, - 1.023 - ], - [ - 0.173, - 0.148, - 0.128 - ], - [ - 0.178, - 0.142, - 0.177 - ], - [ - 1.91, - 1.859, - 1.867 - ], - [ - 1.201, - 1.162, - 1.191 - ], - [ - 0.313, - 0.303, - 0.323 - ], - [ - 0.332, - 0.338, - 0.323 - ], - [ - 1.207, - 1.263, - 1.233 - ], - [ - 4.079, - 4.069, - 4.096 - ], - [ - 1.528, - 1.631, - 1.586 - ], - [ - 1.59, - 1.593, - 1.569 - ], - [ - 4.723, - 4.743, - 4.698 - ], - [ - 4.649, - 4.67, - 4.62 - ], - [ - 9.897, - 9.95, - 10.004 - ], - [ - 0.149, - 0.158, - 0.169 - ], - [ - 0.811, - 0.556, - 0.462 - ], - [ - 0.569, - 0.603, - 0.572 - ], - [ - 1.297, - 1.13, - 1.136 - ], - [ - 4.453, - 3.341, - 3.291 - ], - [ - 0.202, - 0.222, - 0.192 - ], - [ - 0.226, - 0.2, - 0.2 - ], - [ - 0.195, - 0.239, - 0.251 - ], - [ - 0.549, - 0.586, - 0.557 - ], - [ - 6.189, - 6.074, - 6.042 - ], - [ - 1.536, - 1.594, - 1.509 - ], - [ - 1.233, - 1.14, - 1.148 - ], - [ - 2.414, - 2.35, - 2.364 - ], - [ - 15.901, - 15.801, - 15.891 - ], - [ - 5.637, - 5.497, - 5.545 - ], - [ - 5.627, - 5.632, - 5.6 - ], - [ - 2.451, - 2.461, - 2.543 - ], - [ - 0.286, - 0.277, - 0.278 - ], - [ - 0.229, - 0.189, - 0.229 - ], - [ - 0.177, - 0.182, - 0.179 - ], - [ - 0.507, - 0.498, - 0.502 - ], - [ - 0.153, - 0.234, - 0.183 - ], - [ - 0.171, - 0.166, - 0.159 - ], - [ - null, - null, - null - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220716/m.json b/bytehouse/results/20220716/m.json deleted file mode 100644 index 2d04945d4d..0000000000 --- a/bytehouse/results/20220716/m.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-16", - "machine": "M", - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.307, - 0.122, - 0.122 - ], - [ - 0.177, - 0.152, - 0.146 - ], - [ - 0.204, - 0.166, - 0.163 - ], - [ - 0.213, - 0.146, - 0.135 - ], - [ - 1.458, - 1.393, - 1.34 - ], - [ - 1.53, - 1.46, - 1.405 - ], - [ - 0.164, - 0.167, - 0.178 - ], - [ - 0.107, - 0.158, - 0.129 - ], - [ - 2.399, - 2.299, - 2.353 - ], - [ - 1.547, - 1.561, - 1.516 - ], - [ - 0.408, - 0.352, - 0.423 - ], - [ - 0.44, - 0.391, - 0.417 - ], - [ - 1.691, - 1.774, - 1.725 - ], - [ - 4.923, - 4.986, - 4.898 - ], - [ - 2.136, - 2.206, - 2.215 - ], - [ - 2.025, - 2.09, - 2.033 - ], - [ - 6.069, - 6.158, - 5.995 - ], - [ - 5.992, - 5.93, - 5.898 - ], - [ - 13.126, - 13.047, - 12.947 - ], - [ - 0.168, - 0.14, - 0.171 - ], - [ - 1.485, - 0.935, - 0.941 - ], - [ - 1.169, - 1.164, - 1.201 - ], - [ - 3.038, - 2.592, - 2.647 - ], - [ - 10.401, - 7.818, - 8.003 - ], - [ - 0.466, - 0.361, - 0.377 - ], - [ - 0.276, - 0.245, - 0.328 - ], - [ - 0.266, - 0.334, - 0.353 - ], - [ - 1.161, - 1.162, - 1.145 - ], - [ - 13.972, - 14.247, - 14.049 - ], - [ - 3.54, - 3.519, - 3.524 - ], - [ - 1.6, - 1.617, - 1.548 - ], - [ - 3.222, - 3.013, - 3.056 - ], - [ - 20.072, - 20.142, - 20.14 - ], - [ - 8.16, - 8.138, - 8.1 - ], - [ - 8.265, - 8.095, - 8.134 - ], - [ - 3.166, - 3.24, - 3.16 - ], - [ - 0.35, - 0.333, - 0.322 - ], - [ - 0.211, - 0.179, - 0.193 - ], - [ - 0.191, - 0.208, - 0.201 - ], - [ - 0.554, - 0.513, - 0.602 - ], - [ - 0.189, - 0.187, - 0.199 - ], - [ - 0.153, - 0.183, - 0.163 - ], - [ - null, - null, - null - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220716/s.json b/bytehouse/results/20220716/s.json deleted file mode 100644 index 6ad08a7794..0000000000 --- a/bytehouse/results/20220716/s.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-16", - "machine": "S", - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.245, - 0.138, - 0.142 - ], - [ - 0.144, - 0.153, - 0.136 - ], - [ - 0.244, - 0.213, - 0.177 - ], - [ - 0.286, - 0.158, - 0.145 - ], - [ - 2.877, - 2.839, - 2.773 - ], - [ - 3.135, - 3.052, - 2.866 - ], - [ - 0.204, - 0.155, - 0.156 - ], - [ - 0.163, - 0.161, - 0.151 - ], - [ - 4.697, - 4.665, - 4.513 - ], - [ - 3.899, - 3.8, - 3.796 - ], - [ - 0.718, - 0.756, - 0.752 - ], - [ - 0.834, - 0.808, - 0.746 - ], - [ - 3.34, - 3.273, - 3.278 - ], - [ - 9.57, - 9.411, - 9.321 - ], - [ - 4.209, - 4.25, - 4.23 - ], - [ - 4.01, - 3.921, - 3.896 - ], - [ - 11.829, - 11.743, - 11.724 - ], - [ - 11.842, - 11.88, - 11.596 - ], - [ - 24.71, - 24.382, - 24.6 - ], - [ - 0.136, - 0.155, - 0.161 - ], - [ - 2.102, - 1.397, - 1.382 - ], - [ - 1.633, - 1.64, - 1.626 - ], - [ - 4.39, - 3.695, - 3.648 - ], - [ - 15.817, - 12.054, - 12.029 - ], - [ - 0.54, - 0.528, - 0.489 - ], - [ - 0.4, - 0.427, - 0.41 - ], - [ - 0.541, - 0.548, - 0.517 - ], - [ - 1.663, - 1.581, - 1.519 - ], - [ - 21.525, - 22.038, - 21.011 - ], - [ - 5.252, - 5.242, - 5.556 - ], - [ - 3.226, - 3.152, - 3.081 - ], - [ - 5.333, - 5.44, - 5.372 - ], - [ - 37.838, - 37.92, - 37.885 - ], - [ - 14.878, - 14.888, - 14.82 - ], - [ - 14.84, - 14.814, - 14.73 - ], - [ - 5.273, - 5.226, - 5.276 - ], - [ - 0.441, - 0.341, - 0.501 - ], - [ - 0.215, - 0.199, - 0.19 - ], - [ - 0.181, - 0.145, - 0.191 - ], - [ - 0.677, - 0.726, - 0.666 - ], - [ - 0.145, - 0.156, - 0.19 - ], - [ - 0.171, - 0.152, - 0.148 - ], - [ - null, - null, - null - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220716/xs.json b/bytehouse/results/20220716/xs.json deleted file mode 100644 index 7d4c81f593..0000000000 --- a/bytehouse/results/20220716/xs.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-16", - "machine": "XS", - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.224, - 0.146, - 0.143 - ], - [ - 0.169, - 0.15, - 0.178 - ], - [ - 0.271, - 0.205, - 0.236 - ], - [ - 0.297, - 0.162, - 0.143 - ], - [ - 4.352, - 4.427, - 4.333 - ], - [ - 3.633, - 3.39, - 3.389 - ], - [ - 0.186, - 0.146, - 0.159 - ], - [ - 0.157, - 0.149, - 0.167 - ], - [ - 7.539, - 7.351, - 7.426 - ], - [ - 4.699, - 4.932, - 4.98 - ], - [ - 1.03, - 0.954, - 0.922 - ], - [ - 1.019, - 1.075, - 1.008 - ], - [ - 4.174, - 4.239, - 4.257 - ], - [ - 14.523, - 14.403, - 14.595 - ], - [ - 5.783, - 5.77, - 5.819 - ], - [ - 6.067, - 6.187, - 6.228 - ], - [ - 18.114, - 18.272, - 18.153 - ], - [ - null, - null, - null - ], - [ - null, - null, - null - ], - [ - null, - null, - null - ], - [ - null, - null, - null - ], - [ - null, - 3.266, - 1.835 - ], - [ - 4.97, - 3.644, - 3.586 - ], - [ - 17.989, - 12.691, - 12.631 - ], - [ - 0.563, - 0.549, - 0.515 - ], - [ - 0.447, - 0.437, - 0.446 - ], - [ - 0.547, - 0.55, - 0.623 - ], - [ - 1.557, - 1.549, - 1.71 - ], - [ - 21.941, - 22.953, - 22.602 - ], - [ - 5.71, - 5.548, - 5.241 - ], - [ - 4.18, - 4.23, - 4.324 - ], - [ - 8.745, - 8.559, - 8.673 - ], - [ - 59.626, - 58.891, - 58.809 - ], - [ - 20.735, - 20.409, - 20.451 - ], - [ - 20.443, - 20.527, - 20.534 - ], - [ - 7.473, - 7.328, - 7.4 - ], - [ - 0.586, - 0.401, - 0.422 - ], - [ - 0.217, - 0.217, - 0.182 - ], - [ - 0.169, - 0.183, - 0.185 - ], - [ - 0.828, - 0.783, - 0.829 - ], - [ - 0.176, - 0.19, - 0.186 - ], - [ - 0.157, - 0.193, - 0.149 - ], - [ - null, - null, - null - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220727/l.json b/bytehouse/results/20220727/l.json deleted file mode 100644 index aab69a15bd..0000000000 --- a/bytehouse/results/20220727/l.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-27", - "machine": "L", - "cluster_size": 8, - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.239, - 0.087, - 0.222 - ], - [ - 0.182, - 0.105, - 0.131 - ], - [ - 0.2, - 0.138, - 0.121 - ], - [ - 0.38, - 0.14, - 0.106 - ], - [ - 0.345, - 0.315, - 0.348 - ], - [ - 0.499, - 0.346, - 0.376 - ], - [ - 0.163, - 0.199, - 0.104 - ], - [ - 0.135, - 0.121, - 0.132 - ], - [ - 0.498, - 0.443, - 0.451 - ], - [ - 0.925, - 0.931, - 0.938 - ], - [ - 0.208, - 0.138, - 0.154 - ], - [ - 0.184, - 0.166, - 0.189 - ], - [ - 0.375, - 0.44, - 0.408 - ], - [ - 2.876, - 2.879, - 2.856 - ], - [ - 0.514, - 0.481, - 0.525 - ], - [ - 0.379, - 0.403, - 0.409 - ], - [ - 1.078, - 0.981, - 0.998 - ], - [ - 0.97, - 0.991, - 1.019 - ], - [ - 2.329, - 2.028, - 2.058 - ], - [ - 0.121, - 0.087, - 0.117 - ], - [ - 1.242, - 0.409, - 0.381 - ], - [ - 0.333, - 0.362, - 0.368 - ], - [ - 0.724, - 0.616, - 0.609 - ], - [ - 8.372, - 1.94, - 1.919 - ], - [ - 0.215, - 0.166, - 0.183 - ], - [ - 0.159, - 0.173, - 0.16 - ], - [ - 0.173, - 0.217, - 0.178 - ], - [ - 0.364, - 0.392, - 0.392 - ], - [ - 3.258, - 3.055, - 3.158 - ], - [ - 0.969, - 0.944, - 1.001 - ], - [ - 0.335, - 0.344, - 0.435 - ], - [ - 0.563, - 0.597, - 0.546 - ], - [ - 2.824, - 2.784, - 2.773 - ], - [ - 2.042, - 1.985, - 1.963 - ], - [ - 1.972, - 1.905, - 2.0 - ], - [ - 0.66, - 0.638, - 0.638 - ], - [ - 0.273, - 0.291, - 0.275 - ], - [ - 0.197, - 0.204, - 0.245 - ], - [ - 0.158, - 0.19, - 0.22 - ], - [ - 0.42, - 0.41, - 0.391 - ], - [ - 0.185, - 0.152, - 0.138 - ], - [ - 0.302, - 0.146, - 0.132 - ], - [ - 0.153, - 0.138, - 0.14 - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220727/m.json b/bytehouse/results/20220727/m.json deleted file mode 100644 index 9dea02fb9d..0000000000 --- a/bytehouse/results/20220727/m.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-27", - "machine": "M", - "cluster_size": 4, - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.204, - 0.124, - 0.111 - ], - [ - 0.162, - 0.12, - 0.129 - ], - [ - 0.138, - 0.124, - 0.1 - ], - [ - 0.424, - 0.193, - 0.148 - ], - [ - 0.626, - 0.636, - 0.701 - ], - [ - 0.7, - 0.614, - 0.563 - ], - [ - 0.226, - 0.107, - 0.105 - ], - [ - 0.115, - 0.129, - 0.135 - ], - [ - 0.908, - 0.89, - 0.93 - ], - [ - 1.072, - 1.196, - 1.085 - ], - [ - 0.185, - 0.229, - 0.228 - ], - [ - 0.21, - 0.22, - 0.229 - ], - [ - 0.777, - 0.751, - 0.808 - ], - [ - 3.443, - 3.529, - 3.431 - ], - [ - 0.918, - 0.941, - 0.964 - ], - [ - 0.814, - 0.826, - 0.83 - ], - [ - 2.154, - 2.196, - 2.145 - ], - [ - 2.002, - 2.01, - 1.968 - ], - [ - 5.072, - 5.071, - 4.954 - ], - [ - 0.127, - 0.107, - 0.105 - ], - [ - 1.344, - 0.761, - 0.738 - ], - [ - 0.847, - 0.866, - 0.79 - ], - [ - 2.173, - 1.909, - 1.956 - ], - [ - 6.798, - 6.03, - 5.961 - ], - [ - 0.232, - 0.241, - 0.225 - ], - [ - 0.224, - 0.213, - 0.165 - ], - [ - 0.249, - 0.236, - 0.234 - ], - [ - 0.886, - 0.895, - 0.934 - ], - [ - 8.905, - 8.909, - 9.119 - ], - [ - 2.729, - 2.7, - 2.805 - ], - [ - 0.599, - 0.679, - 0.657 - ], - [ - 1.12, - 1.13, - 1.114 - ], - [ - 6.566, - 6.552, - 6.493 - ], - [ - 4.601, - 4.529, - 4.554 - ], - [ - 4.544, - 4.497, - 4.527 - ], - [ - 1.338, - 1.347, - 1.313 - ], - [ - 0.298, - 0.295, - 0.279 - ], - [ - 0.163, - 0.188, - 0.158 - ], - [ - 0.21, - 0.197, - 0.14 - ], - [ - 0.395, - 0.434, - 0.453 - ], - [ - 0.175, - 0.175, - 0.145 - ], - [ - 0.159, - 0.126, - 0.119 - ], - [ - 0.188, - 0.14, - 0.117 - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220727/s.json b/bytehouse/results/20220727/s.json deleted file mode 100644 index dd6a868f50..0000000000 --- a/bytehouse/results/20220727/s.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-27", - "machine": "S", - "cluster_size": 2, - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.465, - 0.116, - 0.103 - ], - [ - 0.126, - 0.12, - 0.178 - ], - [ - 0.19, - 0.153, - 0.15 - ], - [ - 0.241, - 0.125, - 0.139 - ], - [ - 1.069, - 1.034, - 1.106 - ], - [ - 1.562, - 1.206, - 1.221 - ], - [ - 0.152, - 0.122, - 0.117 - ], - [ - 0.13, - 0.117, - 0.132 - ], - [ - 1.599, - 1.514, - 1.542 - ], - [ - 1.341, - 1.417, - 1.509 - ], - [ - 0.273, - 0.302, - 0.371 - ], - [ - 0.323, - 0.317, - 0.346 - ], - [ - 1.35, - 1.463, - 1.394 - ], - [ - 6.526, - 6.562, - 6.603 - ], - [ - 1.657, - 1.617, - 1.658 - ], - [ - 1.301, - 1.328, - 1.417 - ], - [ - 4.2, - 4.116, - 4.145 - ], - [ - 4.083, - 3.939, - 4.009 - ], - [ - 7.324, - 7.22, - 7.239 - ], - [ - 0.124, - 0.102, - 0.12 - ], - [ - 1.358, - 0.815, - 0.825 - ], - [ - 0.95, - 0.89, - 0.994 - ], - [ - 2.508, - 1.891, - 1.924 - ], - [ - 9.532, - 6.816, - 6.81 - ], - [ - 0.288, - 0.257, - 0.323 - ], - [ - 0.287, - 0.252, - 0.301 - ], - [ - 0.352, - 0.289, - 0.325 - ], - [ - 0.888, - 0.853, - 0.902 - ], - [ - 11.996, - 11.335, - 10.928 - ], - [ - 3.223, - 3.274, - 3.039 - ], - [ - 1.076, - 1.121, - 1.066 - ], - [ - 1.584, - 1.634, - 1.636 - ], - [ - 11.265, - 11.25, - 11.265 - ], - [ - 6.284, - 6.419, - 6.503 - ], - [ - 6.301, - 6.381, - 6.45 - ], - [ - 1.645, - 1.66, - 1.591 - ], - [ - 0.29, - 0.268, - 0.259 - ], - [ - 0.209, - 0.2, - 0.271 - ], - [ - 0.168, - 0.156, - 0.173 - ], - [ - 0.459, - 0.45, - 0.456 - ], - [ - 0.151, - 0.149, - 0.137 - ], - [ - 0.13, - 0.127, - 0.131 - ], - [ - 0.159, - 0.147, - 0.111 - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20220727/xs.json b/bytehouse/results/20220727/xs.json deleted file mode 100644 index 2fc3736c89..0000000000 --- a/bytehouse/results/20220727/xs.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "system": "ByteHouse", - "date": "2022-07-27", - "machine": "XS", - "cluster_size": 1, - "proprietary": "yes", - "hardware": "cpu", - "tuned": "no", - "tags": [ - "managed", - "column-oriented", - "ClickHouse derivative", - "C++", - "historical" - ], - "load_time": 745, - "data_size": 27190000000, - "result": [ - [ - 0.334, - 0.14, - 0.09 - ], - [ - 0.122, - 0.142, - 0.121 - ], - [ - 0.263, - 0.251, - 0.159 - ], - [ - 0.501, - 0.2, - 0.219 - ], - [ - 2.543, - 2.468, - 2.505 - ], - [ - 2.105, - 1.866, - 1.868 - ], - [ - 0.157, - 0.138, - 0.11 - ], - [ - 0.158, - 0.144, - 0.128 - ], - [ - 3.764, - 3.757, - 3.743 - ], - [ - 5.197, - 5.259, - 5.139 - ], - [ - 0.533, - 0.525, - 0.503 - ], - [ - 0.625, - 0.555, - 0.562 - ], - [ - 2.032, - 2.09, - 2.048 - ], - [ - 9.476, - 9.242, - 9.257 - ], - [ - 2.594, - 2.517, - 2.54 - ], - [ - 2.787, - 2.553, - 2.685 - ], - [ - 7.066, - 7.059, - 6.987 - ], - [ - 7.108, - 7.044, - 7.038 - ], - [ - null, - null, - null - ], - [ - null, - 0.209, - 0.104 - ], - [ - 2.984, - 1.572, - 1.647 - ], - [ - 1.726, - 1.633, - 1.798 - ], - [ - 5.146, - 3.894, - 3.656 - ], - [ - 18.92, - 13.498, - 13.139 - ], - [ - 0.51, - 0.499, - 0.483 - ], - [ - 0.365, - 0.425, - 0.369 - ], - [ - 0.534, - 0.504, - 0.524 - ], - [ - 1.537, - 1.582, - 1.604 - ], - [ - 23.25, - 22.08, - 21.513 - ], - [ - 5.463, - 5.731, - 5.901 - ], - [ - 2.113, - 2.06, - 2.033 - ], - [ - 3.506, - 3.609, - 3.409 - ], - [ - 20.424, - 19.854, - 19.813 - ], - [ - 10.042, - 10.562, - 10.16 - ], - [ - 10.287, - 10.111, - 10.401 - ], - [ - 3.369, - 3.553, - 3.392 - ], - [ - 0.249, - 0.232, - 0.272 - ], - [ - 0.193, - 0.176, - 0.19 - ], - [ - 0.136, - 0.175, - 0.146 - ], - [ - 0.446, - 0.419, - 0.43 - ], - [ - 0.163, - 0.191, - 0.18 - ], - [ - 0.187, - 0.132, - 0.121 - ], - [ - 0.15, - 0.167, - 0.139 - ] - ], - "comment": "Historical: ByteHouse cloud (bytehouse.cloud) result; the service is no longer reachable from outside the China region." -} diff --git a/bytehouse/results/20260515/c7a.metal-48xl.json b/bytehouse/results/20260515/c7a.metal-48xl.json new file mode 100644 index 0000000000..70ec35acb7 --- /dev/null +++ b/bytehouse/results/20260515/c7a.metal-48xl.json @@ -0,0 +1,57 @@ +{ + "system": "ByteHouse", + "date": "2026-05-15", + "machine": "c7a.metal-48xl", + "cluster_size": 1, + "proprietary": "no", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","ClickHouse derivative"], + "load_time": 145.932, + "data_size": 14943625726, + "result": [ + [0.020, 0.003, 0.003], + [0.037, 0.025, 0.024], + [0.034, 0.053, 0.026], + [0.314, 0.041, 0.023], + [0.655, 0.047, 0.046], + [1.287, 0.073, 0.070], + [0.037, 0.050, 0.021], + [0.027, 0.023, 0.023], + [0.274, 0.080, 0.079], + [1.277, 0.212, 0.220], + [0.400, 0.069, 0.066], + [0.681, 0.063, 0.062], + [0.994, 0.087, 0.086], + [2.068, 0.148, 0.149], + [1.219, 0.097, 0.092], + [0.428, 0.047, 0.048], + [1.834, 0.146, 0.144], + [1.659, 0.110, 0.117], + [3.373, 0.278, 0.275], + [0.053, 0.013, 0.013], + [9.506, 0.126, 0.131], + [10.454, 0.165, 0.138], + [17.038, 0.174, 0.154], + [10.973, 0.133, 0.123], + [1.762, 0.023, 0.022], + [1.411, 0.059, 0.054], + [1.701, 0.022, 0.024], + [0.269, 0.059, 0.038], + [8.447, 0.521, 0.528], + [0.105, 0.103, 0.085], + [0.433, 0.092, 0.067], + [3.890, 0.077, 0.074], + [3.904, 0.341, 0.294], + [9.246, 0.347, 0.345], + [9.276, 0.342, 0.337], + [0.122, 0.043, 0.044], + [0.077, 0.043, 0.042], + [0.064, 0.033, 0.027], + [0.023, 0.017, 0.015], + [0.125, 0.084, 0.090], + [0.030, 0.015, 0.016], + [0.022, 0.013, 0.013], + [0.021, 0.013, 0.014] +] +} \ No newline at end of file diff --git a/bytehouse/run.sh b/bytehouse/run.sh index a5e3e63d52..bb67b4aa35 100755 --- a/bytehouse/run.sh +++ b/bytehouse/run.sh @@ -1,8 +1,66 @@ -#!/bin/bash +#!/usr/bin/env bash -TRIES=3 -cat queries.sql | while read -r query; do - for i in $(seq 1 $TRIES); do - ./bytehouse-cli --user "$user" --account "$account" --password "$password" --region ap-southeast-1 --secure --warehouse "$warehouse" --database test --query "${query}" +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SCRIPT_DIR}" + +source "${SCRIPT_DIR}/common.sh" + +bytehouse::setup_runtime + +: > "${RESULT_CSV}" +: > "${RESULT_MATRIX_CSV}" + +declare -a attempt_sums=() +declare -a attempt_sum_invalid=() + +for attempt in $(seq 1 "${TRIES}"); do + attempt_sums[${attempt}]=0 + attempt_sum_invalid[${attempt}]=0 +done + +query_num=1 +while IFS= read -r query || [[ -n "${query}" ]]; do + [[ -z "${query}" ]] && continue + + declare -a row_results=() + + bytehouse::maybe_drop_caches + + echo -n "[" + for attempt in $(seq 1 "${TRIES}"); do + if result="$(bytehouse::run_query "${query}")"; then + row_results[${attempt}]="${result}" + echo -n "${result}" + echo "${query_num},${attempt},${result}" >> "${RESULT_CSV}" + if [[ "${attempt_sum_invalid[${attempt}]}" == "0" ]]; then + attempt_sums[${attempt}]="$(awk -v a="${attempt_sums[${attempt}]}" -v b="${result}" 'BEGIN { print a + b }')" + fi + else + row_results[${attempt}]="null" + echo -n "null" + echo "${query_num},${attempt},null" >> "${RESULT_CSV}" + attempt_sum_invalid[${attempt}]=1 + [[ -n "${result}" ]] && echo "Query ${query_num} attempt ${attempt} failed: ${result}" >&2 + fi + + if [[ "${attempt}" != "${TRIES}" ]]; then + echo -n ", " + fi done + echo "]," + printf '%s\n' "$(IFS=,; echo "${row_results[*]}")" >> "${RESULT_MATRIX_CSV}" + + query_num=$((query_num + 1)) +done < "${QUERY_FILE}" + +declare -a sum_results=() +for attempt in $(seq 1 "${TRIES}"); do + if [[ "${attempt_sum_invalid[${attempt}]}" == "1" ]]; then + sum_results[${attempt}]="null" + else + sum_results[${attempt}]="${attempt_sums[${attempt}]}" + fi done +printf '%s\n' "$(IFS=,; echo "${sum_results[*]}")" >> "${RESULT_MATRIX_CSV}" diff --git a/bytehouse/template.json b/bytehouse/template.json new file mode 100644 index 0000000000..ca877188ec --- /dev/null +++ b/bytehouse/template.json @@ -0,0 +1,12 @@ +{ + "system": "ByteHouse", + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": [ + "C++", + "column-oriented", + "ClickHouse derivative", + "lukewarm-cold-run" + ] +} diff --git a/bytehouse/users.xml b/bytehouse/users.xml new file mode 100644 index 0000000000..1226a1bacc --- /dev/null +++ b/bytehouse/users.xml @@ -0,0 +1,21 @@ + + + + + + + + + + ::/0 + + default + default + 1 + + + + + + +