Skip to content

Commit 711802e

Browse files
Merge pull request #183 from ClickHouse/parallel_replica
Added support for parallel replicas
2 parents ca52383 + 0498afb commit 711802e

File tree

7 files changed

+80
-21
lines changed

7 files changed

+80
-21
lines changed

clickhouse-cloud/cloud-api.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@
66

77
PROVIDER=${PROVIDER:-aws}
88
REGION=${REGION:-eu-central-1}
9-
TIER=${TIER:-production}
10-
MEMORY=${MEMORY:-48}
9+
TIER=${TIER:-development}
10+
MEMORY=${MEMORY:-0}
11+
PARALLEL_REPLICA=${PARALLEL_REPLICA:-false}
1112

1213
command -v jq || exit 1
1314
command -v curl || exit 1
1415
command -v clickhouse-client || exit 1
1516

16-
echo "Provisioning a service in ${PROVIDER}, region ${REGION}, ${TIER} tier, memory ${MEMORY}"
17+
echo "Provisioning a service in ${PROVIDER}, region ${REGION}, ${TIER} tier, memory ${MEMORY}, with parallel replicas set to ${PARALLEL_REPLICA}"
1718

18-
TMPDIR="${PROVIDER}-${REGION}-${TIER}-${MEMORY}-$$"
19+
TMPDIR="${PROVIDER}-${REGION}-${TIER}-${MEMORY}-${PARALLEL_REPLICA}-$$"
1920
mkdir -p "${TMPDIR}"
2021

22+
echo $TMPDIR
23+
2124
curl -X POST -H 'Content-Type: application/json' -d '
2225
{
2326
"name": "ClickBench-'${PROVIDER}'-'${REGION}'-'${TIER}'-'${MEMORY}'-'$$'",
@@ -29,6 +32,8 @@ curl -X POST -H 'Content-Type: application/json' -d '
2932
}
3033
' --silent --show-error --user "${KEY_ID}:${KEY_SECRET}" "https://api.clickhouse.cloud/v1/organizations/${ORGANIZATION}/services" | tee "${TMPDIR}"/service.json | jq
3134

35+
echo ${KEY_ID}:${KEY_SECRET}" "https://api.clickhouse.cloud/v1/organizations/${ORGANIZATION}/services
36+
3237
[ $(jq .status "${TMPDIR}"/service.json) != 200 ] && exit 1
3338

3439
export SERVICE_ID=$(jq --raw-output .result.service.id "${TMPDIR}"/service.json)
@@ -53,6 +58,11 @@ do
5358
sleep 1
5459
done
5560

61+
if [ ${PARALLEL_REPLICA} = true ]; then
62+
echo "Enabling parallel replica to the default user"
63+
clickhouse-client --host "$FQDN" --password "$PASSWORD" --secure --query "ALTER USER default SETTINGS allow_experimental_parallel_reading_from_replicas=2;"
64+
fi
65+
5666
echo "Running the benchmark"
5767

5868
./benchmark.sh 2>&1 | tee "${TMPDIR}"/result

clickhouse-cloud/combinations.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,22 @@ REGION='eu-central-1'
99

1010
TIER=development
1111
MEMORY=0
12-
export PROVIDER TIER REGION MEMORY
12+
13+
# Handle Parralel replica
14+
PARALLEL_REPLICA=true
15+
16+
export PROVIDER TIER REGION MEMORY PARRALEL_REPLICA
17+
./cloud-api.sh &
18+
19+
# Disable parallel replica for the remaining of the benchmark for AWS
20+
PARALLEL_REPLICA=false
21+
1322
./cloud-api.sh &
1423

1524
TIER=production
1625
for MEMORY in 24 48 96 192 360 720
1726
do
18-
export PROVIDER TIER REGION MEMORY
27+
export PROVIDER TIER REGION MEMORY PARALLEL_REPLICA
1928
./cloud-api.sh &
2029
done
2130

@@ -24,12 +33,19 @@ REGION='europe-west4'
2433

2534
TIER=development
2635
MEMORY=0
27-
export PROVIDER TIER REGION MEMORY
36+
37+
# Handle Paralel replica for GCP
38+
PARALLEL_REPLICA=true
39+
40+
export PROVIDER TIER REGION MEMORY PARALLEL_REPLICA
2841
./cloud-api.sh &
2942

43+
# Disable parallel replica for the remaining of the benchmark for AWS
44+
PARALLEL_REPLICA=false
45+
3046
TIER=production
3147
for MEMORY in 24 48 96 192 360 708
3248
do
33-
export PROVIDER TIER REGION MEMORY
49+
export PROVIDER TIER REGION MEMORY PARALLEL_REPLICA
3450
./cloud-api.sh &
3551
done

clickhouse-cloud/results/aws.dev.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11

22
{
33
"system": "ClickHouse Cloud (aws)",
4-
"date": "2023-09-03",
4+
"date": "2024-04-17",
55
"machine": "dev",
66
"cluster_size": "serverless",
77
"comment": "",
88

99
"tags": ["C++", "column-oriented", "ClickHouse derivative", "managed", "aws"],
1010

11-
"load_time": 700.114,
12-
"data_size": 9944443104,
11+
"load_time": 699.782,
12+
"data_size": 9945206782,
1313

1414
"result": [
15-
[0.002, 0.002, 0.002], [0.114, 0.112, 0.044], [0.530, 0.223, 0.231], [0.658, 0.321, 0.578], [2.042, 1.725, 1.454], [2.508, 2.023, 2.725], [0.091, 0.091, 0.084], [0.033, 0.081, 0.035], [1.891, 2.362, 2.009], [2.071, 1.951, 2.251], [1.077, 0.666, 0.809], [1.082, 0.890, 0.977], [2.813, 3.022, 2.817], [3.666, 3.734, 3.593], [3.647, 3.371, 2.700], [2.513, 1.743, 1.641], [6.708, 9.375, 8.844], [4.948, 6.079, 5.460], [26.159, 20.860, 17.466], [0.395, 0.080, 0.107], [3.658, 3.448, 6.485], [6.897, 6.948, 4.022], [8.765, 7.751, 4.769], [13.487, 27.999, 20.242], [1.132, 1.961, 1.199], [0.799, 0.705, 0.838], [2.009, 1.063, 1.744], [3.712, 5.554, 3.618], [32.808, 60.019, 32.276], [3.389, 2.354, 3.351], [1.779, 2.202, 2.205], [3.687, 3.694, 2.223], [23.809, 16.334, 16.007], [19.995, 19.951, 17.978], [16.470, 19.988, 19.945], [3.228, 2.638, 3.916], [0.303, 0.103, 0.105], [0.257, 0.093, 0.064], [0.080, 0.136, 0.066], [0.270, 0.275, 0.347], [0.055, 0.205, 0.056], [0.182, 0.059, 0.033], [0.082, 0.176, 0.030]
15+
[0.002, 0.003, 0.002], [0.041, 0.092, 0.025], [0.238, 0.174, 0.236], [0.420, 0.267, 0.250], [1.570, 1.685, 1.769], [2.465, 2.309, 2.340], [0.046, 0.044, 0.032], [0.038, 0.027, 0.026], [1.988, 1.955, 1.889], [2.426, 4.159, 2.624], [0.710, 0.813, 0.675], [0.823, 0.873, 0.926], [2.824, 2.520, 2.726], [4.117, 4.517, 4.625], [3.019, 2.951, 3.127], [2.151, 2.169, 2.042], [7.867, 8.391, 10.103], [3.768, 5.278, 5.184], [25.048, 19.380, 17.496], [0.058, 0.054, 0.061], [3.392, 2.714, 4.742], [5.055, 3.250, 3.269], [6.124, 4.069, 3.715], [11.587, 17.132, 16.485], [0.930, 0.940, 1.483], [1.016, 0.778, 0.849], [1.237, 0.868, 1.011], [3.091, 4.445, 2.841], [48.137, 37.938, 35.947], [0.140, 0.122, 0.121], [2.047, 1.953, 1.926], [3.047, 3.341, 2.675], [20.986, 20.300, 21.071], [18.569, 17.918, 17.646], [17.390, 17.676, 17.134], [3.240, 3.270, 2.784], [0.176, 0.176, 0.188], [0.072, 0.081, 0.091], [0.068, 0.069, 0.061], [0.317, 0.302, 0.264], [0.037, 0.037, 0.032], [0.037, 0.023, 0.031], [0.041, 0.030, 0.023]
1616
]
1717
}
18-
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"system": "ClickHouse Cloud (aws) Parallel Replicas ON",
3+
"date": "2024-04-16",
4+
"machine": "dev",
5+
"cluster_size": "serverless",
6+
"comment": "Parallel replicas turned on",
7+
8+
"tags": ["C++", "column-oriented", "ClickHouse derivative", "managed", "aws", "parallel replicas"],
9+
10+
"load_time": 773.008,
11+
"data_size": 9945084069,
12+
13+
"result": [
14+
[0.003, 0.003, 0.002], [0.038, 0.037, 0.023], [0.148, 0.253, 0.150], [0.311, 0.263, 0.274], [1.697, 1.668, 1.617], [2.665, 2.596, 2.394], [0.039, 0.038, 0.035], [0.034, 0.031, 0.042], [2.090, 2.266, 2.234], [2.437, 4.187, 4.132], [0.934, 0.761, 0.813], [0.891, 0.995, 1.075], [3.181, 2.961, 2.907], [4.572, 5.164, 4.570], [3.670, 3.278, 3.639], [2.406, 2.226, 2.736], [10.465, 12.150, 6.255], [6.246, 3.885, 6.261], [30.169, 19.963, 18.555], [0.070, 0.075, 0.076], [4.983, 4.825, 3.611], [4.371, 6.281, 3.855], [7.947, 5.206, 7.271], [13.755, 21.318, 20.489], [1.162, 1.821, 1.008], [0.903, 0.827, 1.290], [1.177, 1.070, 1.659], [5.615, 5.095, 5.434], [40.234, 48.738, 49.646], [0.170, 0.152, 0.183], [2.432, 2.360, 2.190], [3.975, 3.236, 3.062], [22.129, 24.002, 20.080], [18.607, 18.233, 19.444], [19.007, 20.713, 17.977], [3.954, 3.289, 2.920], [0.184, 0.212, 0.207], [0.141, 0.127, 0.092], [0.085, 0.068, 0.071], [0.374, 0.340, 0.315], [0.047, 0.109, 0.042], [0.028, 0.028, 0.025], [0.023, 0.028, 0.026]
15+
]
16+
}

clickhouse-cloud/results/gcp.dev.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
21
{
32
"system": "ClickHouse Cloud (gcp)",
4-
"date": "2023-09-03",
3+
"date": "2024-04-17",
54
"machine": "dev",
65
"cluster_size": "serverless",
76
"comment": "",
87

98
"tags": ["C++", "column-oriented", "ClickHouse derivative", "managed", "gcp"],
109

11-
"load_time": 573.697,
12-
"data_size": 9944356651,
10+
"load_time": 648.838,
11+
"data_size": 9945324551,
1312

1413
"result": [
15-
[0.002, 0.003, 0.002], [0.110, 0.884, 0.363], [0.307, 0.166, 0.245], [0.624, 0.485, 0.275], [1.616, 1.292, 1.614], [2.591, 2.192, 2.484], [0.139, 0.069, 0.516], [0.105, 0.037, 0.102], [1.507, 2.259, 1.592], [2.481, 1.774, 1.806], [0.559, 0.777, 0.697], [0.681, 0.570, 0.920], [1.818, 1.888, 1.738], [3.266, 3.113, 4.488], [2.576, 2.658, 3.535], [1.551, 1.555, 1.926], [7.342, 7.817, 6.890], [5.789, 6.373, 4.137], [28.360, 17.620, 27.891], [0.060, 0.053, 0.440], [2.887, 5.945, 5.000], [3.713, 6.440, 3.736], [7.915, 4.291, 4.111], [11.210, 27.281, 19.303], [0.896, 1.808, 1.610], [0.631, 1.026, 1.015], [1.705, 0.942, 0.967], [2.979, 2.904, 5.303], [51.146, 50.490, 50.144], [2.103, 1.933, 3.405], [2.998, 1.414, 2.240], [2.496, 3.989, 2.741], [23.552, 22.336, 13.822], [14.086, 12.553, 19.012], [19.032, 12.498, 12.244], [3.916, 3.466, 3.089], [0.215, 0.081, 0.079], [0.091, 0.236, 0.041], [0.180, 0.046, 0.048], [0.378, 0.158, 0.266], [0.060, 0.032, 0.182], [0.049, 0.132, 0.040], [0.025, 0.218, 0.032]
14+
[0.002, 0.002, 0.020], [0.029, 0.030, 0.025], [0.241, 0.156, 0.140], [0.280, 0.258, 0.260], [1.439, 2.063, 1.470], [2.768, 2.716, 2.345], [0.052, 0.036, 0.052], [0.029, 0.033, 0.032], [2.449, 2.098, 1.741], [2.124, 2.125, 2.256], [0.698, 0.832, 0.727], [0.797, 1.536, 1.605], [2.497, 2.663, 3.722], [5.642, 4.332, 5.847], [4.485, 3.337, 4.167], [2.842, 2.383, 2.137], [11.545, 13.183, 6.508], [3.970, 3.912, 6.959], [32.768, 17.902, 18.856], [0.086, 0.084, 0.079], [4.477, 2.989, 2.976], [5.704, 3.767, 5.666], [3.981, 4.169, 4.121], [12.674, 13.041, 19.551], [1.096, 1.573, 1.763], [0.960, 0.832, 0.643], [1.048, 1.038, 1.602], [3.693, 4.919, 3.412], [51.845, 36.792, 42.678], [0.175, 0.121, 0.122], [2.532, 2.317, 2.335], [4.109, 3.472, 3.177], [26.596, 26.691, 26.748], [16.965, 17.814, 20.525], [15.998, 20.978, 17.541], [3.385, 4.072, 4.071], [0.224, 0.182, 0.145], [0.085, 0.085, 0.105], [0.105, 0.079, 0.078], [0.348, 0.322, 0.363], [0.035, 0.034, 0.045], [0.047, 0.025, 0.036], [0.026, 0.026, 0.024]
1615
]
1716
}
18-
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"system": "ClickHouse Cloud (gcp) Parallel Replicas ON",
3+
"date": "2024-04-16",
4+
"machine": "dev",
5+
"cluster_size": "serverless",
6+
"comment": "Parallel replicas turned on",
7+
8+
"tags": ["C++", "column-oriented", "ClickHouse derivative", "managed", "gcp", "parallel replicas"],
9+
10+
"load_time": 734.459,
11+
"data_size": 9945216628,
12+
13+
"result": [
14+
[0.003, 0.003, 0.002], [0.030, 0.018, 0.037], [0.124, 0.145, 0.102], [0.473, 0.169, 0.146], [1.536, 1.254, 2.041], [2.105, 2.959, 2.142], [0.030, 0.027, 0.039], [0.044, 0.059, 0.036], [1.703, 1.650, 1.706], [1.907, 3.739, 3.971], [0.436, 1.047, 0.872], [1.026, 1.096, 1.047], [2.921, 3.756, 2.239], [3.607, 5.915, 3.517], [2.740, 2.757, 4.892], [1.913, 1.711, 3.406], [12.787, 11.616, 7.435], [5.413, 4.833, 5.044], [24.986, 20.759, 20.747], [0.068, 0.069, 0.057], [3.938, 3.488, 4.151], [4.980, 4.191, 4.316], [5.066, 5.202, 4.871], [14.254, 14.544, 16.389], [1.282, 1.069, 1.443], [0.813, 0.910, 0.529], [2.805, 0.904, 2.059], [9.439, 4.456, 3.652], [37.428, 28.976, 26.878], [0.162, 0.139, 0.270], [1.565, 3.430, 3.146], [5.365, 3.873, 3.970], [34.900, 32.349, 26.192], [13.889, 13.352, 13.601], [13.430, 13.317, 13.507], [2.938, 2.456, 2.497], [0.131, 0.249, 0.212], [0.074, 0.095, 0.066], [0.071, 0.091, 0.068], [0.400, 0.453, 0.420], [0.054, 0.030, 0.028], [0.035, 0.035, 0.021], [0.037, 0.041, 0.023]
15+
]
16+
}

0 commit comments

Comments
 (0)