Skip to content

Commit d871b97

Browse files
Merge branch 'main' of github.com:ClickHouse/ClickBench
2 parents 16e995a + dc6449e commit d871b97

File tree

3 files changed

+77
-12
lines changed

3 files changed

+77
-12
lines changed

.github/workflows/clickhouse-cloud.yml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: "Run ClickBench on ClickHouse Cloud"
22
on:
33
workflow_dispatch: # This allows manual trigger from the UI
4+
inputs:
5+
max_parallel:
6+
description: "Max concurrent services (0 = no cap)"
7+
required: false
8+
default: "0"
49
schedule:
510
- cron: '10 10 * * *'
611

@@ -13,6 +18,7 @@ jobs:
1318
env:
1419
CI_COMMIT_MESSAGE: "[bot] update results for ClickHouse Cloud"
1520
CI_COMMIT_AUTHOR: github
21+
MAX_PARALLEL: ${{ github.event.inputs.max_parallel || '0' }}
1622
steps:
1723
- uses: actions/checkout@v3
1824
- run: |
@@ -24,21 +30,52 @@ jobs:
2430
echo "Required secrets are not set. Skipping workflow."
2531
exit 0
2632
fi
27-
2833
cd clickhouse-cloud
2934
curl https://clickhouse.com/ | sh
3035
sudo ./clickhouse install -y
36+
- name: Install diagnostics tools
37+
run: |
38+
sudo apt-get update -y
39+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y sysstat iproute2 traceroute moreutils procps dnsutils
40+
- name: Start diagnostics collectors
41+
working-directory: clickhouse-cloud
42+
run: |
43+
mkdir -p diag
44+
# CPU usage per core every second
45+
(mpstat -P ALL 1 > diag/mpstat.log 2>&1 &)
46+
# System runq/mem/io snapshot every second
47+
(vmstat 1 > diag/vmstat.log 2>&1 &)
48+
# Network device and TCP stats every second (ignore if sar not available)
49+
(sar -n DEV 1 > diag/sar_net_dev.log 2>&1 &) || true
50+
(sar -n TCP,ETCP 1 > diag/sar_tcp.log 2>&1 &) || true
51+
# Socket summary snapshot once per second
52+
(for i in $(seq 1 3600); do date +%FT%T%z >> diag/ss.log; ss -s >> diag/ss.log; sleep 1; done) &
3153
3254
bash combinations.sh
3355
bash collect-results.sh
3456
57+
- name: Upload diagnostics and raw run outputs
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: clickhouse-cloud-diag-${{ github.run_id }}
61+
path: |
62+
clickhouse-cloud/diag/**
63+
clickhouse-cloud/csp-*/netdebug.txt
64+
clickhouse-cloud/csp-*/chclient_errors.log
65+
clickhouse-cloud/csp-*/result
66+
clickhouse-cloud/csp-*/state
67+
clickhouse-cloud/results/*.json
68+
if-no-files-found: ignore
69+
- name: Commit results
70+
working-directory: clickhouse-cloud
71+
run: |
3572
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
3673
git config --global user.email "${{ env.CI_COMMIT_AUTHOR }}@users.noreply.github.com"
37-
3874
git pull
39-
git add results/*.json
40-
if git status | grep -q modified
41-
then
75+
git add results/*.json || true
76+
if git status --porcelain | grep -qE "^ M|^A |^\?\? "; then
4277
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
4378
git push
79+
else
80+
echo "No changes to commit."
4481
fi

clickhouse-cloud/cloud-api.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,27 @@ done
8686

8787
echo "Waiting for clickhouse-server to start"
8888

89+
# Collect quick network/TLS diagnostics for this run
90+
{
91+
echo "==== NET DEBUG $(date -Iseconds) ===="
92+
echo "Host: $(hostname)"
93+
echo "Kernel: $(uname -a)"
94+
echo "ulimit -n: $(ulimit -n 2>/dev/null || echo n/a)"
95+
echo "FQDN: ${FQDN}"
96+
echo "IP route:"; ip route || true
97+
echo "IP addr:"; ip -brief address || ip addr || true
98+
echo "DNS resolution for ${FQDN}:"; getent hosts "${FQDN}" || nslookup "${FQDN}" 2>&1 || host "${FQDN}" 2>&1 || true
99+
echo "Socket summary:"; ss -s || true
100+
echo "Public IP (best-effort):"; curl -fsS --max-time 3 https://ifconfig.me || echo "n/a"
101+
echo "OpenSSL s_client (short):"; timeout 10s openssl s_client -connect "${FQDN}:9440" -servername "${FQDN}" -brief </dev/null 2>&1 || true
102+
echo "Traceroute TCP:9440:"; timeout 20s traceroute -T -p 9440 -n "${FQDN}" 2>&1 || traceroute -n "${FQDN}" 2>&1 || true
103+
} > "${TMPDIR}/netdebug.txt" 2>&1
104+
89105
for i in {1..1000}
90106
do
91-
clickhouse-client --host "$FQDN" --password "$PASSWORD" --secure --query "SELECT 1" && break
107+
if clickhouse-client --host "$FQDN" --password "$PASSWORD" --secure --query "SELECT 1" 1>/dev/null 2>>"${TMPDIR}/chclient_errors.log"; then
108+
break
109+
fi
92110
sleep 1
93111
if [[ $i == 1000 ]]
94112
then

clickhouse-cloud/combinations.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,22 @@ PROVIDER=aws
88
REGION='us-east-1'
99
PARALLEL_REPLICA=false
1010

11+
# Optional cap on parallel jobs; set MAX_PARALLEL=N in the environment to enable.
12+
throttle() {
13+
local max=${MAX_PARALLEL:-0}
14+
if [[ -n "$max" && "$max" =~ ^[0-9]+$ && $max -gt 0 ]]; then
15+
while [[ $(jobs -rp | wc -l) -ge $max ]]; do
16+
sleep 1
17+
done
18+
fi
19+
}
20+
1121
for REPLICAS in 1
1222
do
1323
for MEMORY in 8 12
1424
do
1525
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
16-
./cloud-api.sh &
26+
throttle; ./cloud-api.sh &
1727
sleep 10 # Prevent "Too many requests" to the API
1828
done
1929
done
@@ -23,7 +33,7 @@ do
2333
for MEMORY in 8 12 16 32 64 120 236
2434
do
2535
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
26-
./cloud-api.sh &
36+
throttle; ./cloud-api.sh &
2737
sleep 10
2838
done
2939
done
@@ -36,7 +46,7 @@ do
3646
for MEMORY in 8 12
3747
do
3848
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
39-
./cloud-api.sh &
49+
throttle; ./cloud-api.sh &
4050
sleep 10
4151
done
4252
done
@@ -46,7 +56,7 @@ do
4656
for MEMORY in 8 12 16 32 64 120 236
4757
do
4858
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
49-
./cloud-api.sh &
59+
throttle; ./cloud-api.sh &
5060
sleep 10
5161
done
5262
done
@@ -59,7 +69,7 @@ do
5969
for MEMORY in 8 12
6070
do
6171
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
62-
./cloud-api.sh &
72+
throttle; ./cloud-api.sh &
6373
sleep 10
6474
done
6575
done
@@ -69,7 +79,7 @@ do
6979
for MEMORY in 8 12 16 32 64 120
7080
do
7181
export PROVIDER REPLICAS REGION MEMORY PARALLEL_REPLICA
72-
./cloud-api.sh &
82+
throttle; ./cloud-api.sh &
7383
sleep 10
7484
done
7585
done

0 commit comments

Comments
 (0)