diff --git a/cedardb-parquet/benchmark.sh b/cedardb-parquet/benchmark.sh index ddd7f28318..8b58049bec 100755 --- a/cedardb-parquet/benchmark.sh +++ b/cedardb-parquet/benchmark.sh @@ -1,4 +1,7 @@ #!/bin/bash # Thin shim — actual flow is in lib/benchmark-common.sh. export BENCH_DOWNLOAD_SCRIPT="download-hits-parquet-single" +export PGHOST="/tmp" +export PGUSER=postgres +export PGDATABASE=postgres exec ../lib/benchmark-common.sh diff --git a/cedardb-parquet/check b/cedardb-parquet/check index f161a08203..1ff9f1a6d4 100755 --- a/cedardb-parquet/check +++ b/cedardb-parquet/check @@ -1,4 +1,4 @@ #!/bin/bash set -e -PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null +psql -c 'SELECT 1' >/dev/null diff --git a/cedardb-parquet/create.sql b/cedardb-parquet/create.sql index d9cdd6cdd4..9c4a44cd75 100644 --- a/cedardb-parquet/create.sql +++ b/cedardb-parquet/create.sql @@ -105,4 +105,4 @@ SELECT "RefererHash" AS RefererHash, "URLHash" AS URLHash, "CLID" AS CLID -FROM '/data/hits.parquet'; +FROM 'hits.parquet'; diff --git a/cedardb-parquet/data-size b/cedardb-parquet/data-size index 7a49e44749..9a5cea2905 100755 --- a/cedardb-parquet/data-size +++ b/cedardb-parquet/data-size @@ -2,4 +2,4 @@ set -eu # No ingestion — reported size is the parquet file itself. -stat -c%s data/hits.parquet +stat -c%s hits.parquet diff --git a/cedardb-parquet/install b/cedardb-parquet/install index 2c6f09a048..5a2497e79f 100755 --- a/cedardb-parquet/install +++ b/cedardb-parquet/install @@ -2,9 +2,15 @@ set -eu sudo apt-get update -y -sudo apt-get install -y docker.io postgresql-client +sudo apt-get install -y postgresql-client -sudo docker pull cedardb/cedardb:latest +# Stop any running instance before reinstalling +./stop || true -mkdir -p data db -chmod -R 777 data db +# Delete potential previously created database +rm -rf ./db + +curl https://get.cedardb.com | bash -s -- -y \ + --install-dir "$PWD" \ + --db-dir "$PWD/db" \ + --with-systemd=system diff --git a/cedardb-parquet/load b/cedardb-parquet/load index ee17527ef5..4850506bd1 100755 --- a/cedardb-parquet/load +++ b/cedardb-parquet/load @@ -1,12 +1,8 @@ #!/bin/bash set -eu -# Stage parquet file under ./data so the docker container sees /data/hits.parquet. -mkdir -p data -mv hits.parquet data/ -chmod -R 777 data - -# create.sql defines a view over the parquet file — no ingestion needed. -PGPASSWORD=test psql -h localhost -U postgres -t < create.sql +# Substitute the absolute path so CedarDB can find the file regardless of +# its working directory. +sed "s|'hits\.parquet'|'$PWD/hits.parquet'|" create.sql | psql sync diff --git a/cedardb-parquet/query b/cedardb-parquet/query index 3261388dc6..ebb3c2d49f 100755 --- a/cedardb-parquet/query +++ b/cedardb-parquet/query @@ -8,7 +8,7 @@ set -e query=$(cat) -raw=$(PGPASSWORD=test psql -h localhost -U postgres -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$? +raw=$(psql -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$? if [ "$exit_code" -ne 0 ] || printf '%s\n' "$raw" | grep -qE '^ERROR|psql: error'; then printf '%s\n' "$raw" >&2 diff --git a/cedardb-parquet/results/20260630/c6a.2xlarge.json b/cedardb-parquet/results/20260630/c6a.2xlarge.json new file mode 100644 index 0000000000..9cb9802e2f --- /dev/null +++ b/cedardb-parquet/results/20260630/c6a.2xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c6a.2xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 4, + "data_size": 14779976446, + "result": [ + [0.36, 0.036, 0.057], + [0.375, 0.055, 0.078], + [0.373, 0.139, 0.164], + [0.486, 0.113, 0.14], + [0.701, 0.294, 0.267], + [1.002, 0.647, 0.624], + [0.524, 0.436, 0.412], + [0.364, 0.062, 0.06], + [0.846, 0.383, 0.376], + [1.209, 0.564, 0.539], + [0.797, 0.167, 0.168], + [0.668, 0.201, 0.228], + [1.032, 0.64, 0.608], + [2.289, 0.857, 0.893], + [1.1, 0.657, 0.68], + [0.743, 0.288, 0.287], + [2.123, 0.88, 0.826], + [2.09, 0.812, 0.83], + [4.153, 2.117, 2.095], + [0.499, 0.107, 0.129], + [9.449, 1.418, 1.35], + [11.047, 1.574, 1.543], + [21.626, 2.983, 2.985], + [55.655, 56.957, 41.794], + [2.45, 0.648, 0.684], + [1.144, 0.413, 0.436], + [2.454, 0.654, 0.689], + [9.59, 1.407, 1.464], + [8.202, 7.234, 7.267], + [0.391, 0.118, 0.142], + [2.239, 0.714, 0.744], + [5.69, 0.767, 0.762], + [5.358, 2.101, 2.508], + [15.653, 6.558, 331.355], + [12.651, 10.067, 217.036], + [0.628, 0.318, 0.29], + [9.846, 1.255, 1.235], + [8.996, 1.526, 1.578], + [9.822, 1.248, 1.228], + [18.627, 2.317, 2.297], + [2.849, 0.337, 0.374], + [2.054, 0.333, 0.368], + [1.112, 0.344, 0.319] +] +} diff --git a/cedardb-parquet/results/20260630/c6a.4xlarge.json b/cedardb-parquet/results/20260630/c6a.4xlarge.json new file mode 100644 index 0000000000..ce83015ef9 --- /dev/null +++ b/cedardb-parquet/results/20260630/c6a.4xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c6a.4xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 1, + "data_size": 14779976446, + "result": [ + [0.082, 0.032, 0.055], + [0.382, 0.051, 0.073], + [0.402, 0.119, 0.097], + [0.569, 0.076, 0.076], + [0.573, 0.188, 0.194], + [0.804, 0.383, 0.354], + [0.387, 0.227, 0.249], + [0.381, 0.055, 0.075], + [0.702, 0.297, 0.263], + [1.19, 0.423, 0.437], + [0.588, 0.132, 0.161], + [0.638, 0.158, 0.186], + [0.819, 0.38, 0.349], + [2.193, 0.523, 0.567], + [0.903, 0.417, 0.391], + [0.517, 0.255, 0.224], + [2.118, 0.584, 0.543], + [2.069, 0.501, 0.53], + [4.12, 1.306, 1.273], + [0.561, 0.068, 0.069], + [9.462, 0.726, 0.783], + [11.043, 0.845, 0.825], + [21.645, 1.668, 1.585], + [55.594, 5.571, 5.55], + [2.456, 0.355, 0.389], + [0.752, 0.246, 0.259], + [2.451, 0.377, 0.377], + [9.563, 0.753, 0.806], + [8.024, 3.792, 3.763], + [0.373, 0.075, 0.075], + [2.226, 0.437, 0.412], + [5.655, 0.458, 0.506], + [4.89, 1.361, 1.418], + [9.882, 1.389, 1.469], + [9.879, 1.418, 1.409], + [0.885, 0.189, 0.192], + [9.852, 0.657, 0.714], + [9.005, 0.807, 0.86], + [9.822, 0.712, 0.658], + [18.613, 1.179, 1.181], + [2.843, 0.234, 0.267], + [2.052, 0.231, 0.269], + [1.131, 0.223, 0.199] +] +} diff --git a/cedardb-parquet/results/20260630/c6a.large.json b/cedardb-parquet/results/20260630/c6a.large.json new file mode 100644 index 0000000000..bbfc2ef27a --- /dev/null +++ b/cedardb-parquet/results/20260630/c6a.large.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c6a.large", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 0, + "data_size": 14779976446, + "result": [ + [0.358, 0.056, 0.082], + [0.488, 0.123, 0.148], + [0.991, 0.456, 0.481], + [1.652, 0.359, 0.357], + [2.239, null, 1.346], + [8.526, 75.256, 116.169], + [1.764, 1.535, 1.568], + [0.523, 0.172, 0.145], + [null, 2.186, 1.881], + [null, null, 4.746], + [2.01, 0.558, 0.532], + [2.077, 0.624, 0.656], + [null, 100.434, 132.033], + [null, null, null], + [4.461, null, null], + [2.344, null, null], + [null, null, null], + [null, null, null], + [null, null, null], + [1.65, 0.309, 0.34], + [12.382, 5.216, 5.297], + [14.298, 14.446, 14.346], + [27.378, 28.029, 28.33], + [77.538, 79.128, 79.729], + [4.795, 2.448, 2.472], + [2.61, 1.559, 1.531], + [4.861, 2.475, 2.46], + [12.395, 5.45, 5.485], + [33.2, 35.055, 66.267], + [0.794, 0.377, 0.376], + [4.945, 2.901, 2.708], + [null, null, 6.245], + [null, null, null], + [null, null, null], + [null, null, null], + [2.621, null, null], + [12.835, 4.982, 4.939], + [12.633, 5.941, 5.89], + [12.443, 4.637, 4.669], + [22.613, 28.332, 29.853], + [4.643, 1.2, 1.2], + [3.917, 1.225, 1.197], + [2.799, 1.113, 1.145] +] +} diff --git a/cedardb-parquet/results/20260630/c6a.metal.json b/cedardb-parquet/results/20260630/c6a.metal.json new file mode 100644 index 0000000000..89900ab741 --- /dev/null +++ b/cedardb-parquet/results/20260630/c6a.metal.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c6a.metal", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 0, + "data_size": 14779976446, + "result": [ + [0.072, 0.033, 0.046], + [0.174, 0.079, 0.059], + [0.241, 0.063, 0.058], + [0.279, 0.142, 0.124], + [0.366, 0.345, 0.172], + [0.748, 0.403, 0.223], + [0.246, 0.138, 0.11], + [0.186, 0.091, 0.098], + [0.625, 0.415, 0.169], + [1.203, 0.478, 0.241], + [0.452, 0.096, 0.118], + [0.511, 0.129, 0.109], + [0.76, 0.187, 0.194], + [2.291, 0.308, 0.32], + [0.814, 0.212, 0.199], + [0.456, 0.362, 0.162], + [1.945, 0.25, 0.257], + [1.978, 0.451, 0.258], + [3.831, 0.739, 0.488], + [0.281, 0.098, 0.097], + [9.474, 0.249, 0.263], + [10.975, 0.251, 0.264], + [21.743, 0.479, 0.35], + [55.498, 2.612, 2.552], + [2.417, 0.165, 0.144], + [0.676, 0.12, 0.109], + [2.391, 0.172, 0.167], + [9.594, 0.26, 0.265], + [8.359, 0.664, 0.659], + [0.257, 0.088, 0.106], + [2.157, 0.241, 0.259], + [5.861, 0.277, 0.276], + [4.497, 0.545, 0.554], + [9.639, 0.587, 0.56], + [9.644, 0.589, 0.58], + [0.544, 0.195, 0.167], + [9.815, 0.327, 0.265], + [8.947, 0.306, 0.285], + [9.779, 0.271, 0.28], + [18.649, 0.438, 0.468], + [2.783, 0.126, 0.137], + [1.955, 0.213, 0.199], + [1.043, 0.127, 0.164] +] +} diff --git a/cedardb-parquet/results/20260630/c6a.xlarge.json b/cedardb-parquet/results/20260630/c6a.xlarge.json new file mode 100644 index 0000000000..77ac74f2bf --- /dev/null +++ b/cedardb-parquet/results/20260630/c6a.xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c6a.xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 1, + "data_size": 14779976446, + "result": [ + [0.363, 0.043, 0.065], + [0.385, 0.075, 0.076], + [0.567, 0.243, 0.269], + [0.86, 0.194, 0.193], + [1.206, 0.512, 0.478], + [1.813, 1.205, 1.169], + [0.941, 0.812, 0.784], + [0.402, 0.114, 0.087], + [1.485, 0.703, 0.713], + [1.984, 1.044, 1.001], + [1.027, 0.313, 0.284], + [1.078, 0.337, 0.363], + [1.816, 1.164, 1.138], + [2.807, 1.64, 1.604], + [1.935, 1.262, 1.234], + [1.243, 0.51, 0.532], + [null, null, null], + [null, null, null], + [null, null, null], + [0.846, 0.169, 0.168], + [9.482, 2.632, 2.678], + [11.042, 3.013, 2.955], + [21.634, 5.973, 5.873], + [56.318, 56.351, 49.949], + [2.454, 1.246, 1.28], + [1.422, 0.806, 0.778], + [2.483, 1.254, 1.29], + [9.564, 2.742, 2.809], + [15.959, 14.329, 14.298], + [0.456, 0.202, 0.227], + [2.569, 1.354, 1.389], + [5.778, 1.464, 1.432], + [null, null, null], + [null, null, null], + [null, null, null], + [1.08, 0.511, 0.531], + [9.876, 2.33, 2.382], + [8.984, 2.969, 2.97], + [9.803, 2.318, 2.369], + [18.614, 4.358, 4.437], + [2.83, 0.658, 0.637], + [2.042, 0.653, 0.623], + [1.442, 0.576, 0.578] +] +} diff --git a/cedardb-parquet/results/20260630/c7a.metal-48xl.json b/cedardb-parquet/results/20260630/c7a.metal-48xl.json new file mode 100644 index 0000000000..c84a6680c9 --- /dev/null +++ b/cedardb-parquet/results/20260630/c7a.metal-48xl.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c7a.metal-48xl", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 1, + "data_size": 14779976446, + "result": [ + [0.067, 0.046, 0.059], + [0.162, 0.128, 0.138], + [0.232, 0.143, 0.079], + [0.309, 0.098, 0.137], + [0.515, 0.34, 0.154], + [0.766, 0.376, 0.189], + [0.303, 0.12, 0.097], + [0.171, 0.166, 0.149], + [0.649, 0.364, 0.136], + [1.12, 0.4, 0.205], + [0.436, 0.12, 0.09], + [0.491, 0.087, 0.098], + [0.727, 0.28, 0.251], + [1.995, 0.42, 0.237], + [0.805, 0.325, 0.256], + [0.619, 0.366, 0.142], + [1.949, 0.233, 0.198], + [1.947, 0.468, 0.204], + [3.682, 0.293, 0.268], + [0.295, 0.207, 0.176], + [9.436, 0.354, 0.217], + [10.969, 0.286, 0.256], + [21.702, 0.327, 0.252], + [55.477, 0.953, 0.934], + [2.391, 0.202, 0.216], + [0.658, 0.16, 0.175], + [2.375, 0.256, 0.184], + [9.575, 0.404, 0.234], + [8.194, 0.576, 0.554], + [0.291, 0.118, 0.08], + [2.138, 0.23, 0.184], + [5.787, 0.178, 0.179], + [4.269, 0.325, 0.3], + [9.62, 0.565, 0.452], + [9.574, 0.439, 0.445], + [0.537, 0.211, 0.179], + [9.829, 0.263, 0.23], + [8.958, 0.276, 0.22], + [9.74, 0.472, 0.228], + [18.616, 0.261, 0.278], + [2.744, 0.293, 0.127], + [1.93, 0.205, 0.149], + [1.045, 0.357, 0.191] +] +} diff --git a/cedardb-parquet/results/20260630/c8g.4xlarge.json b/cedardb-parquet/results/20260630/c8g.4xlarge.json new file mode 100644 index 0000000000..1aa6104187 --- /dev/null +++ b/cedardb-parquet/results/20260630/c8g.4xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c8g.4xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 5, + "data_size": 14779976446, + "result": [ + [0.196, 0.036, 0.043], + [0.198, 0.039, 0.045], + [0.251, 0.081, 0.072], + [0.669, 0.068, 0.078], + [0.61, 0.137, 0.132], + [1.011, 0.222, 0.215], + [0.253, 0.123, 0.116], + [0.206, 0.057, 0.05], + [0.605, 0.189, 0.178], + [1.076, 0.237, 0.246], + [0.697, 0.112, 0.121], + [0.527, 0.136, 0.129], + [0.745, 0.229, 0.221], + [2.042, 0.355, 0.349], + [0.816, 0.25, 0.243], + [0.503, 0.151, 0.146], + [1.984, 0.315, 0.328], + [1.955, 0.288, 0.271], + [3.78, 0.609, 0.629], + [0.297, 0.055, 0.066], + [9.384, 0.639, 0.675], + [10.968, 0.418, 0.377], + [21.618, 0.673, 0.739], + [55.496, 6.937, 6.958], + [2.398, 0.197, 0.195], + [0.695, 0.159, 0.169], + [2.395, 0.213, 0.229], + [9.495, 0.385, 0.386], + [7.902, 1.895, 1.895], + [0.219, 0.073, 0.066], + [2.186, 0.285, 0.284], + [5.592, 0.295, 0.272], + [4.334, 0.605, 0.582], + [9.605, 0.658, 0.671], + [9.603, 0.647, 0.68], + [0.364, 0.144, 0.154], + [9.785, 0.282, 0.282], + [8.943, 0.376, 0.371], + [9.75, 0.316, 0.28], + [18.548, 0.574, 0.569], + [2.776, 0.154, 0.17], + [1.997, 0.154, 0.169], + [1.056, 0.128, 0.121] +] +} diff --git a/cedardb-parquet/results/20260630/c8g.metal-48xl.json b/cedardb-parquet/results/20260630/c8g.metal-48xl.json new file mode 100644 index 0000000000..889f408cc4 --- /dev/null +++ b/cedardb-parquet/results/20260630/c8g.metal-48xl.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB (Parquet)", + "date": "2026-06-30", + "machine": "c8g.metal-48xl", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible","stateless"], + "load_time": 5, + "data_size": 14779976446, + "result": [ + [0.072, 0.051, 0.064], + [0.307, 0.147, 0.13], + [0.484, 0.333, 0.277], + [0.392, 0.075, 0.075], + [0.502, 0.15, 0.147], + [0.762, 0.331, 0.19], + [0.402, 0.269, 0.257], + [0.238, 0.14, 0.132], + [0.607, 0.349, 0.203], + [1.202, 0.434, 0.289], + [0.517, 0.14, 0.115], + [0.525, 0.127, 0.124], + [0.812, 0.195, 0.187], + [2.18, 0.395, 0.256], + [0.832, 0.201, 0.196], + [0.578, 0.149, 0.155], + [2.036, 0.267, 0.271], + [2.012, 0.402, 0.236], + [3.817, 0.586, 0.415], + [0.372, 0.159, 0.134], + [9.648, 0.247, 0.283], + [11.271, 0.154, 0.163], + [22.095, 0.239, 0.246], + [56.55, 1.219, 1.213], + [2.453, 0.122, 0.125], + [0.719, 0.144, 0.149], + [2.468, 0.122, 0.132], + [9.743, 0.199, 0.263], + [8.29, 0.473, 0.476], + [0.394, 0.177, 0.209], + [2.184, 0.184, 0.181], + [5.765, 0.208, 0.211], + [4.324, 0.438, 0.434], + [9.785, 0.323, 0.516], + [9.742, 0.521, 0.543], + [0.36, 0.141, 0.147], + [10.006, 0.2, 0.207], + [9.104, 0.188, 0.19], + [10.009, 0.137, 0.142], + [18.966, 0.393, 0.359], + [2.989, 0.122, 0.116], + [2.011, 0.133, 0.126], + [1.09, 0.151, 0.165] +] +} diff --git a/cedardb-parquet/start b/cedardb-parquet/start index f12fcd366d..c11e05a5ce 100755 --- a/cedardb-parquet/start +++ b/cedardb-parquet/start @@ -1,42 +1,4 @@ #!/bin/bash set -eu -if PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null 2>&1; then - exit 0 -fi - -# After a VM snapshot+restore, dockerd's in-memory networking/cgroup state -# is out of sync with the (also-restored) kernel-side resources, and the -# next `docker run` either fails or starts a container that can't be -# reached on its mapped port. Restarting dockerd reconciles it. -sudo systemctl restart docker -for _ in $(seq 1 30); do - sudo docker info >/dev/null 2>&1 && break - sleep 1 -done - -sudo docker stop cedardb >/dev/null 2>&1 || true -sudo docker rm cedardb >/dev/null 2>&1 || true - -if ! sudo docker run -d --rm -p 5432:5432 \ - -v "$(pwd)/data:/data" \ - -v "$(pwd)/db:/var/lib/cedardb/data" \ - -e CEDAR_PASSWORD=test \ - --name cedardb cedardb/cedardb:latest; then - echo "docker run failed; ps -a:" >&2 - sudo docker ps -a >&2 || true - exit 1 -fi - -# First-boot initdb inside the container takes well over a minute -# (observed ~90-120 s of "Fixing permissions"/"Setting up database -# directory" before postgres actually listens). Give it 10 min — -# pg_isready exits fast once the daemon is up, so this only -# matters in the failure path. -for _ in $(seq 1 600); do - pg_isready -h localhost --dbname postgres -U postgres >/dev/null 2>&1 && exit 0 - sleep 1 -done -echo "cedardb did not become ready in 600 s; container logs:" >&2 -sudo docker logs cedardb 2>&1 | tail -40 >&2 || true -exit 1 +sudo systemctl start cedardb.service diff --git a/cedardb-parquet/stop b/cedardb-parquet/stop index 5d6ade0a89..0e5725506b 100755 --- a/cedardb-parquet/stop +++ b/cedardb-parquet/stop @@ -1,3 +1,3 @@ #!/bin/bash -sudo docker stop cedardb >/dev/null 2>&1 || true +sudo systemctl stop cedardb.service || true diff --git a/cedardb/benchmark.sh b/cedardb/benchmark.sh index a5c2d951ec..8b58049bec 100755 --- a/cedardb/benchmark.sh +++ b/cedardb/benchmark.sh @@ -1,4 +1,7 @@ #!/bin/bash # Thin shim — actual flow is in lib/benchmark-common.sh. -export BENCH_DOWNLOAD_SCRIPT="download-hits-tsv" +export BENCH_DOWNLOAD_SCRIPT="download-hits-parquet-single" +export PGHOST="/tmp" +export PGUSER=postgres +export PGDATABASE=postgres exec ../lib/benchmark-common.sh diff --git a/cedardb/check b/cedardb/check index f161a08203..1ff9f1a6d4 100755 --- a/cedardb/check +++ b/cedardb/check @@ -1,4 +1,4 @@ #!/bin/bash set -e -PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null +psql -c 'SELECT 1' >/dev/null diff --git a/cedardb/create.sql b/cedardb/create.sql index 832d6e8e0b..dc1be20240 100644 --- a/cedardb/create.sql +++ b/cedardb/create.sql @@ -103,7 +103,6 @@ create table hits ( hasgclid smallint not null, refererhash bigint not null, urlhash bigint not null, - clid integer not null, - primary key (counterid, eventdate, userid, eventtime, watchid) + clid integer not null ); diff --git a/cedardb/data-size b/cedardb/data-size index da53638e42..cbc6252fd1 100755 --- a/cedardb/data-size +++ b/cedardb/data-size @@ -1,4 +1,4 @@ #!/bin/bash set -eu -PGPASSWORD=test psql -h localhost -U postgres -q -t -A -c "SELECT pg_total_relation_size('hits');" +psql -q -t -A -c "SELECT pg_total_relation_size('hits');" diff --git a/cedardb/install b/cedardb/install index 0043c4c84e..86bbee2a64 100755 --- a/cedardb/install +++ b/cedardb/install @@ -2,9 +2,15 @@ set -eu sudo apt-get update -y -sudo apt-get install -y docker.io postgresql-client gzip +sudo apt-get install -y postgresql-client -sudo docker pull cedardb/cedardb:latest +# Stop any running instance before reinstalling +./stop || true -mkdir -p data db -chmod -R 777 data db +# Delete potential previously created database +rm -rf ./db + +curl https://get.cedardb.com | bash -s -- -y \ + --install-dir "$PWD" \ + --db-dir "$PWD/db" \ + --with-systemd=system \ No newline at end of file diff --git a/cedardb/load b/cedardb/load index eeb6fd3a77..1651aaba23 100755 --- a/cedardb/load +++ b/cedardb/load @@ -1,13 +1,12 @@ #!/bin/bash set -eu -mkdir -p data -mv hits.tsv data/ -chmod -R 777 data - -PGPASSWORD=test psql -h localhost -U postgres -t < create.sql - -PGPASSWORD=test psql -h localhost -U postgres -q -t -c "COPY hits FROM '/data/hits.tsv';" - -rm -f data/hits.tsv +psql -f create.sql +{ + # CedarDB would like to have ~4 GB of memory per parallel worker for parquet import to be efficient, so set the number of workers accordingly. + echo "SET debug.parallel = $(( $(grep MemTotal /proc/meminfo | awk '{print $2}') / (4 * 1024 * 1024) ));" + sed "s|'hits\.parquet'|'$PWD/hits.parquet'|" load.sql +} | psql + +rm -f hits.parquet sync diff --git a/cedardb/load.sql b/cedardb/load.sql new file mode 100644 index 0000000000..c3a38cf89a --- /dev/null +++ b/cedardb/load.sql @@ -0,0 +1,107 @@ +INSERT INTO hits SELECT +"WatchID", +"JavaEnable", +"Title", +"GoodEvent", +to_timestamp("EventTime") as "EventTime", +('1970-01-01'::date + "EventDate"::integer) as "EventDate", +"CounterID", +"ClientIP", +"RegionID", +"UserID", +"CounterClass", +"OS", +"UserAgent", +"URL", +"Referer", +"IsRefresh", +"RefererCategoryID", +"RefererRegionID", +"URLCategoryID", +"URLRegionID", +"ResolutionWidth", +"ResolutionHeight", +"ResolutionDepth", +"FlashMajor", +"FlashMinor", +"FlashMinor2", +"NetMajor", +"NetMinor", +"UserAgentMajor", +"UserAgentMinor", +"CookieEnable", +"JavascriptEnable", +"IsMobile", +"MobilePhone", +"MobilePhoneModel", +"Params", +"IPNetworkID", +"TraficSourceID", +"SearchEngineID", +"SearchPhrase", +"AdvEngineID", +"IsArtifical", +"WindowClientWidth", +"WindowClientHeight", +"ClientTimeZone", +to_timestamp("ClientEventTime") as "ClientEventTime", +"SilverlightVersion1", +"SilverlightVersion2", +"SilverlightVersion3", +"SilverlightVersion4", +"PageCharset", +"CodeVersion", +"IsLink", +"IsDownload", +"IsNotBounce", +"FUniqID", +"OriginalURL", +"HID", +"IsOldCounter", +"IsEvent", +"IsParameter", +"DontCountHits", +"WithHash", +"HitColor", +to_timestamp("LocalEventTime") as "LocalEventTime", +"Age", +"Sex", +"Income", +"Interests", +"Robotness", +"RemoteIP", +"WindowName", +"OpenerName", +"HistoryLength", +"BrowserLanguage", +"BrowserCountry", +"SocialNetwork", +"SocialAction", +"HTTPError", +"SendTiming", +"DNSTiming", +"ConnectTiming", +"ResponseStartTiming", +"ResponseEndTiming", +"FetchTiming", +"SocialSourceNetworkID", +"SocialSourcePage", +"ParamPrice", +"ParamOrderID", +"ParamCurrency", +"ParamCurrencyID", +"OpenstatServiceName", +"OpenstatCampaignID", +"OpenstatAdID", +"OpenstatSourceID", +"UTMSource", +"UTMMedium", +"UTMCampaign", +"UTMContent", +"UTMTerm", +"FromTag", +"HasGCLID", +"RefererHash", +"URLHash", +"CLID" +FROM 'hits.parquet'; diff --git a/cedardb/query b/cedardb/query index 3261388dc6..ebb3c2d49f 100755 --- a/cedardb/query +++ b/cedardb/query @@ -8,7 +8,7 @@ set -e query=$(cat) -raw=$(PGPASSWORD=test psql -h localhost -U postgres -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$? +raw=$(psql -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$? if [ "$exit_code" -ne 0 ] || printf '%s\n' "$raw" | grep -qE '^ERROR|psql: error'; then printf '%s\n' "$raw" >&2 diff --git a/cedardb/results/20260630/c6a.2xlarge.json b/cedardb/results/20260630/c6a.2xlarge.json new file mode 100644 index 0000000000..10e59a3c54 --- /dev/null +++ b/cedardb/results/20260630/c6a.2xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c6a.2xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 273, + "data_size": 22776438624, + "result": [ + [0.31, 0.018, 0.017], + [0.35, 0.004, 0.005], + [1.022, 0.043, 0.044], + [1.464, 0.041, 0.042], + [1.59, 0.195, 0.193], + [1.972, 0.481, 0.482], + [0.387, 0.038, 0.036], + [0.452, 0.006, 0.005], + [2.466, 0.311, 0.297], + [3.855, 0.372, 0.363], + [2.214, 0.044, 0.045], + [2.616, 0.047, 0.047], + [1.875, 0.398, 0.368], + [4.115, 0.599, 0.57], + [2.402, 0.411, 0.389], + [1.585, 0.208, 0.211], + [9.113, 0.892, 5.888], + [7.873, 8.873, 0.827], + [20.58, 12.984, 13.437], + [0.767, 0.001, 0.001], + [10.839, 1.221, 1.225], + [13.085, 0.402, 0.401], + [20.657, 0.947, 0.765], + [15.031, 0.078, 0.074], + [4.415, 0.005, 0.005], + [1.428, 0.016, 0.016], + [4.414, 0.004, 0.005], + [11.373, 1.26, 1.262], + [13.141, 7.562, 7.561], + [0.605, 0.301, 0.043], + [4.579, 0.343, 0.133], + [7.441, 0.376, 0.177], + [28.228, 21.483, 21.386], + [800.794, 283.236, 278.924], + [784.041, 279.993, 282.573], + [1.07, 0.22, 0.222], + [0.17, 0.022, 0.022], + [0.12, 0.01, 0.01], + [0.128, 0.003, 0.003], + [0.489, 0.05, 0.05], + [0.111, 0.003, 0.003], + [0.12, 0.003, 0.003], + [0.138, 0.004, 0.005] +] +} diff --git a/cedardb/results/20260630/c6a.4xlarge.json b/cedardb/results/20260630/c6a.4xlarge.json new file mode 100644 index 0000000000..1d222e2b1b --- /dev/null +++ b/cedardb/results/20260630/c6a.4xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c6a.4xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 145, + "data_size": 22898944800, + "result": [ + [0.275, 0.011, 0.011], + [0.342, 0.004, 0.004], + [1.119, 0.025, 0.026], + [1.524, 0.025, 0.026], + [1.615, 0.126, 0.127], + [1.89, 0.269, 0.267], + [0.337, 0.022, 0.021], + [0.373, 0.004, 0.004], + [2.37, 0.185, 0.181], + [3.73, 0.248, 0.239], + [2.315, 0.031, 0.03], + [2.677, 0.033, 0.033], + [1.934, 0.217, 0.225], + [3.936, 0.349, 0.348], + [2.367, 0.231, 0.231], + [1.636, 0.152, 0.149], + [3.858, 0.466, 0.445], + [3.748, 0.426, 0.419], + [16.564, 11.345, 10.691], + [0.727, 0.001, 0.001], + [10.986, 0.645, 0.643], + [13.2, 0.225, 0.221], + [20.854, 0.387, 0.385], + [15.269, 0.064, 0.073], + [4.424, 0.005, 0.005], + [1.406, 0.01, 0.009], + [4.416, 0.006, 0.005], + [11.599, 0.679, 0.684], + [10.329, 3.598, 3.606], + [0.415, 0.251, 0.024], + [4.779, 0.087, 0.088], + [7.666, 0.136, 0.134], + [20.518, 14.851, 15.197], + [11.43, 1.398, 1.482], + [11.458, 1.388, 1.363], + [0.778, 0.297, 0.14], + [0.148, 0.015, 0.015], + [0.103, 0.007, 0.007], + [0.114, 0.003, 0.003], + [0.18, 0.034, 0.033], + [0.097, 0.003, 0.003], + [0.102, 0.003, 0.003], + [0.1, 0.004, 0.004] +] +} diff --git a/cedardb/results/20260630/c6a.metal.json b/cedardb/results/20260630/c6a.metal.json new file mode 100644 index 0000000000..f8efdab1b2 --- /dev/null +++ b/cedardb/results/20260630/c6a.metal.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c6a.metal", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 89, + "data_size": 22711866208, + "result": [ + [2.034, 0.005, 0.005], + [2.471, 0.003, 0.004], + [3.129, 0.017, 0.015], + [3.194, 0.016, 0.015], + [3.247, 0.085, 0.085], + [3.491, 0.116, 0.114], + [2.411, 0.009, 0.009], + [2.483, 0.005, 0.005], + [4.024, 0.137, 0.126], + [5.506, 0.187, 0.177], + [3.843, 0.029, 0.03], + [4.213, 0.033, 0.031], + [3.523, 0.118, 0.118], + [5.36, 0.249, 0.246], + [3.904, 0.133, 0.129], + [3.3, 0.116, 0.107], + [5.269, 0.219, 0.235], + [5.267, 0.209, 0.218], + [8.353, 0.476, 0.445], + [2.954, 0.003, 0.003], + [12.523, 0.197, 0.195], + [14.195, 0.069, 0.071], + [21.01, 0.118, 0.116], + [15.496, 0.035, 0.033], + [5.013, 0.007, 0.006], + [2.187, 0.008, 0.009], + [5.024, 0.008, 0.007], + [11.675, 0.168, 0.166], + [9.28, 0.824, 0.855], + [1.018, 0.011, 0.011], + [5.397, 0.066, 0.063], + [8.227, 0.092, 0.081], + [6.488, 0.457, 0.416], + [11.45, 0.407, 0.43], + [10.876, 0.434, 0.387], + [0.892, 0.092, 0.09], + [0.138, 0.012, 0.012], + [0.108, 0.012, 0.01], + [0.133, 0.009, 0.008], + [0.356, 0.027, 0.024], + [0.098, 0.008, 0.014], + [0.092, 0.013, 0.011], + [0.115, 0.01, 0.007] +] +} diff --git a/cedardb/results/20260630/c6a.xlarge.json b/cedardb/results/20260630/c6a.xlarge.json new file mode 100644 index 0000000000..08976f9693 --- /dev/null +++ b/cedardb/results/20260630/c6a.xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c6a.xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 785, + "data_size": 22416314096, + "result": [ + [0.061, 0.249, 0.029], + [0.115, 0.007, 0.007], + [0.862, 0.079, 0.079], + [1.308, 0.076, 0.074], + [1.521, 0.334, 0.328], + [2.333, 0.943, 0.914], + [0.318, 0.065, 0.065], + [0.224, 0.009, 0.008], + [6.231, 1.386, 1.363], + [7.593, 4.39, 4.754], + [2.063, 0.078, 0.077], + [2.445, 0.079, 0.079], + [2.145, 0.708, 0.67], + [4.116, 1.159, 1.059], + [2.629, 0.758, 0.713], + [1.744, 0.357, 0.339], + [12.886, 9.95, 10.301], + [10.915, 9.306, 10.747], + [39.156, 34.221, 32.895], + [0.642, 0.001, 0.001], + [10.739, 2.436, 2.351], + [12.853, 0.925, 0.85], + [20.341, 13.179, 11.514], + [14.817, 2.849, 2.844], + [4.316, 0.005, 0.004], + [1.399, 0.03, 0.031], + [4.321, 0.007, 0.005], + [11.13, 2.523, 2.505], + [21.288, 14.772, 14.755], + [0.527, 0.078, 0.078], + [4.561, 0.327, 0.249], + [7.695, 0.35, 0.293], + [46.04, 44.416, 47.204], + [53.085, 41.972, 44.825], + [55.417, 43.019, 46.563], + [1.182, 0.412, 0.406], + [0.327, 0.038, 0.036], + [0.08, 0.015, 0.015], + [0.112, 0.004, 0.005], + [0.401, 0.09, 0.091], + [0.09, 0.004, 0.004], + [0.096, 0.003, 0.003], + [0.101, 0.006, 0.006] +] +} diff --git a/cedardb/results/20260630/c7a.metal-48xl.json b/cedardb/results/20260630/c7a.metal-48xl.json new file mode 100644 index 0000000000..d24b929eec --- /dev/null +++ b/cedardb/results/20260630/c7a.metal-48xl.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c7a.metal-48xl", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 92, + "data_size": 22764625840, + "result": [ + [1.899, 0.004, 0.004], + [2.333, 0.006, 0.006], + [3.03, 0.01, 0.008], + [3.304, 0.011, 0.008], + [3.225, 0.053, 0.051], + [3.542, 0.074, 0.072], + [2.256, 0.008, 0.011], + [2.346, 0.008, 0.008], + [4.005, 0.08, 0.073], + [5.481, 0.107, 0.105], + [3.862, 0.026, 0.025], + [4.244, 0.03, 0.028], + [3.533, 0.073, 0.07], + [5.304, 0.103, 0.101], + [3.763, 0.064, 0.064], + [3.085, 0.06, 0.059], + [5.109, 0.111, 0.112], + [5.094, 0.104, 0.102], + [8.048, 0.19, 0.174], + [2.641, 0.005, 0.006], + [12.304, 0.084, 0.085], + [14.216, 0.036, 0.036], + [21.035, 0.065, 0.062], + [15.508, 0.032, 0.037], + [4.696, 0.008, 0.008], + [1.912, 0.007, 0.008], + [4.699, 0.01, 0.009], + [11.351, 0.089, 0.089], + [8.883, 0.429, 0.417], + [0.732, 0.009, 0.01], + [5.065, 0.039, 0.039], + [7.885, 0.054, 0.054], + [6.011, 0.194, 0.194], + [11.052, 0.298, 0.288], + [11.036, 0.29, 0.284], + [1.202, 0.051, 0.051], + [0.222, 0.037, 0.032], + [0.159, 0.014, 0.02], + [0.513, 0.012, 0.009], + [0.468, 0.038, 0.03], + [0.155, 0.02, 0.014], + [0.155, 0.027, 0.029], + [0.146, 0.025, 0.021] +] +} diff --git a/cedardb/results/20260630/c8g.4xlarge.json b/cedardb/results/20260630/c8g.4xlarge.json new file mode 100644 index 0000000000..86910a0082 --- /dev/null +++ b/cedardb/results/20260630/c8g.4xlarge.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c8g.4xlarge", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 160, + "data_size": 22852430128, + "result": [ + [0.163, 0.014, 0.014], + [0.071, 0.003, 0.003], + [0.834, 0.028, 0.028], + [1.286, 0.032, 0.031], + [1.324, 0.085, 0.084], + [1.61, 0.174, 0.173], + [0.147, 0.019, 0.018], + [0.144, 0.006, 0.006], + [2.127, 0.132, 0.13], + [3.522, 0.162, 0.159], + [2.054, 0.048, 0.048], + [2.378, 0.056, 0.053], + [1.636, 0.134, 0.134], + [3.629, 0.231, 0.231], + [2.022, 0.139, 0.138], + [1.356, 0.109, 0.108], + [3.701, 0.291, 0.286], + [3.701, 0.252, 0.248], + [26.758, 26.345, 24.313], + [0.721, 0.001, 0.001], + [10.799, 0.695, 0.699], + [12.894, 0.172, 0.174], + [20.57, 0.285, 0.283], + [14.852, 0.067, 0.063], + [4.448, 0.003, 0.003], + [1.362, 0.006, 0.006], + [4.463, 0.003, 0.003], + [11.305, 0.494, 0.493], + [9.214, 1.937, 1.934], + [0.413, 0.028, 0.029], + [4.618, 0.088, 0.087], + [7.527, 0.123, 0.122], + [65.147, 41.063, 43.948], + [10.953, 0.76, 0.751], + [10.952, 0.757, 0.756], + [0.825, 0.094, 0.096], + [0.18, 0.015, 0.015], + [0.042, 0.008, 0.008], + [0.159, 0.003, 0.003], + [0.24, 0.057, 0.057], + [0.044, 0.004, 0.004], + [0.043, 0.003, 0.003], + [0.043, 0.007, 0.006] +] +} diff --git a/cedardb/results/20260630/c8g.metal-48xl.json b/cedardb/results/20260630/c8g.metal-48xl.json new file mode 100644 index 0000000000..b35e173028 --- /dev/null +++ b/cedardb/results/20260630/c8g.metal-48xl.json @@ -0,0 +1,57 @@ +{ + "system": "CedarDB", + "date": "2026-06-30", + "machine": "c8g.metal-48xl", + "cluster_size": 1, + "proprietary": "yes", + "hardware": "cpu", + "tuned": "no", + "tags": ["C++","column-oriented","PostgreSQL compatible"], + "load_time": 90, + "data_size": 22754862048, + "result": [ + [2.099, 0.01, 0.01], + [2.556, 0.004, 0.005], + [3.168, 0.016, 0.014], + [3.266, 0.015, 0.017], + [3.219, 0.052, 0.052], + [3.506, 0.065, 0.067], + [2.485, 0.012, 0.019], + [2.565, 0.008, 0.007], + [4.056, 0.09, 0.089], + [5.531, 0.11, 0.107], + [3.815, 0.02, 0.018], + [4.227, 0.021, 0.021], + [3.548, 0.064, 0.058], + [5.28, 0.119, 0.112], + [3.901, 0.075, 0.074], + [3.34, 0.052, 0.054], + [5.346, 0.124, 0.125], + [5.327, 0.114, 0.111], + [8.143, 0.165, 0.162], + [2.934, 0.005, 0.004], + [12.649, 0.138, 0.139], + [14.677, 0.041, 0.045], + [21.666, 0.078, 0.074], + [15.538, 0.054, 0.053], + [5.044, 0.01, 0.009], + [2.212, 0.011, 0.016], + [5.03, 0.01, 0.01], + [11.831, 0.113, 0.112], + [9.264, 0.381, 0.388], + [1.055, 0.016, 0.014], + [5.412, 0.04, 0.039], + [8.216, 0.049, 0.049], + [6.35, 0.197, 0.196], + [11.555, 0.25, 0.222], + [10.855, 0.261, 0.217], + [0.808, 0.046, 0.045], + [0.217, 0.011, 0.01], + [0.074, 0.007, 0.01], + [0.244, 0.006, 0.009], + [0.273, 0.038, 0.049], + [0.079, 0.006, 0.009], + [0.074, 0.008, 0.005], + [0.072, 0.005, 0.005] +] +} diff --git a/cedardb/start b/cedardb/start index 6bd35d176f..64dd2373e8 100755 --- a/cedardb/start +++ b/cedardb/start @@ -1,44 +1,13 @@ #!/bin/bash set -eu -if PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null 2>&1; then - exit 0 -fi - -# After a VM snapshot+restore, dockerd's in-memory networking/cgroup state -# is out of sync with the (also-restored) kernel-side resources, and the -# next `docker run` either fails or starts a container that can't be -# reached on its mapped port. Restarting dockerd reconciles it. No-op on -# initial provision (the daemon was just started). -sudo systemctl restart docker -for _ in $(seq 1 30); do - sudo docker info >/dev/null 2>&1 && break - sleep 1 -done - -# `docker run --rm` cleans up container on exit; we run detached. -sudo docker stop cedardb >/dev/null 2>&1 || true -sudo docker rm cedardb >/dev/null 2>&1 || true - -if ! sudo docker run -d --rm -p 5432:5432 \ - -v "$(pwd)/data:/data" \ - -v "$(pwd)/db:/var/lib/cedardb/data" \ - -e CEDAR_PASSWORD=test \ - --name cedardb cedardb/cedardb:latest; then - echo "docker run failed; ps -a:" >&2 - sudo docker ps -a >&2 || true - exit 1 -fi - -# First-boot initdb inside the container can run for well over a -# minute (observed ~90-120 s of "Fixing permissions"/"Setting up -# database directory" before postgres actually listens). Older -# 60 s budget bailed during that phase. Give it 5 min — pg_isready -# exits fast once the daemon is up so this only matters on failure. -for _ in $(seq 1 600); do - pg_isready -h localhost --dbname postgres -U postgres >/dev/null 2>&1 && exit 0 - sleep 1 -done -echo "cedardb did not become ready in 600 s; container logs:" >&2 -sudo docker logs cedardb 2>&1 | tail -40 >&2 || true -exit 1 +sudo systemctl start cedardb.service + +# On multi-NUMA systems stay within one node for better performance. +numa_nodes=$(ls -d /sys/devices/system/node/node* 2>/dev/null | wc -l) +if [ "${numa_nodes}" -gt 1 ]; then + parallel=$(cat /sys/devices/system/node/node0/cpulist \ + | tr ',' '\n' \ + | awk -F'-' '{if(NF==2) s+=($2-$1+1); else s+=1} END{print s}') + until psql -c "SET debug.parallel = ${parallel};" >/dev/null 2>&1; do sleep 1; done +fi \ No newline at end of file diff --git a/cedardb/stop b/cedardb/stop index 5d6ade0a89..42f5f1bb51 100755 --- a/cedardb/stop +++ b/cedardb/stop @@ -1,3 +1,3 @@ #!/bin/bash -sudo docker stop cedardb >/dev/null 2>&1 || true +sudo systemctl stop cedardb.service || true \ No newline at end of file