|
| 1 | +--- |
| 2 | +title: ClickHouse Baseline Testing on Google Axion C4A Arm Virtual Machine |
| 3 | +weight: 5 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## ClickHouse Baseline Testing on GCP SUSE VMs |
| 10 | +This section validates that ClickHouse is functioning correctly and provides a **basic performance baseline** on a SUSE Linux Arm64 VM. |
| 11 | + |
| 12 | + |
| 13 | +### Verify ClickHouse is running |
| 14 | + |
| 15 | +```console |
| 16 | +sudo systemctl status clickhouse-server |
| 17 | +``` |
| 18 | + |
| 19 | +This confirms that the ClickHouse server is running correctly under systemd and ready to accept connections. |
| 20 | + |
| 21 | +```output |
| 22 | +● clickhouse-server.service - ClickHouse Server |
| 23 | + Loaded: loaded (/etc/systemd/system/clickhouse-server.service; enabled; vendor preset: disabled) |
| 24 | + Active: active (running) since Thu 2025-11-27 05:07:42 UTC; 18s ago |
| 25 | + Main PID: 4229 (ClickHouseWatch) |
| 26 | + Tasks: 814 |
| 27 | + CPU: 2.629s |
| 28 | + CGroup: /system.slice/clickhouse-server.service |
| 29 | + ├─ 4229 clickhouse-watchdog server --config=/etc/clickhouse-server/config.xml |
| 30 | + └─ 4237 /usr/bin/clickhouse server --config=/etc/clickhouse-server/config.xml |
| 31 | +``` |
| 32 | + |
| 33 | +### Connect to ClickHouse |
| 34 | +Client connection ensures that the ClickHouse CLI can successfully communicate with the running server. |
| 35 | + |
| 36 | +```console |
| 37 | +clickhouse client |
| 38 | +``` |
| 39 | +### Create a test database and table |
| 40 | +Database and table creation sets up a dedicated test environment and an analytics-optimized MergeTree table for baseline evaluation. |
| 41 | + |
| 42 | +```sql |
| 43 | +CREATE DATABASE baseline_test; |
| 44 | +USE baseline_test; |
| 45 | +``` |
| 46 | + |
| 47 | +You should see an output similar to: |
| 48 | +```output |
| 49 | +CREATE DATABASE baseline_test |
| 50 | +Query id: bc615167-ecd5-4470-adb0-918d8ce07caf |
| 51 | +Ok. |
| 52 | +0 rows in set. Elapsed: 0.012 sec. |
| 53 | +
|
| 54 | +
|
| 55 | +USE baseline_test |
| 56 | +Query id: cd49553a-c0ff-4656-a3e5-f0e9fccd9eba |
| 57 | +Ok. |
| 58 | +0 rows in set. Elapsed: 0.001 sec. |
| 59 | +``` |
| 60 | +Create a simple table optimized for analytics: |
| 61 | + |
| 62 | +```sql |
| 63 | +CREATE TABLE events |
| 64 | +( |
| 65 | + event_time DateTime, |
| 66 | + user_id UInt64, |
| 67 | + event_type String |
| 68 | +) |
| 69 | +ENGINE = MergeTree |
| 70 | +ORDER BY (event_time, user_id); |
| 71 | +``` |
| 72 | + |
| 73 | +You should see an output similar to: |
| 74 | +```output |
| 75 | +Query id: 62ce9b9c-9a7b-45c8-9a58-fa6302b13a88 |
| 76 | +
|
| 77 | +Ok. |
| 78 | +
|
| 79 | +0 rows in set. Elapsed: 0.011 sec. |
| 80 | +``` |
| 81 | + |
| 82 | +### Insert baseline test data |
| 83 | +Data insertion loads a small, controlled dataset to simulate real event data and validate write functionality. |
| 84 | +Insert sample data (10,000 rows): |
| 85 | + |
| 86 | +```sql |
| 87 | +INSERT INTO events |
| 88 | +SELECT |
| 89 | + now() - number, |
| 90 | + number, |
| 91 | + 'click' |
| 92 | +FROM numbers(10000); |
| 93 | +``` |
| 94 | + |
| 95 | +You should see an output similar to: |
| 96 | +```output |
| 97 | +Query id: af860501-d903-4226-9e10-0e34467f7675 |
| 98 | +
|
| 99 | +Ok. |
| 100 | +
|
| 101 | +10000 rows in set. Elapsed: 0.003 sec. Processed 10.00 thousand rows, 80.00 KB (3.36 million rows/s., 26.86 MB/s.) |
| 102 | +Peak memory usage: 3.96 MiB. |
| 103 | +``` |
| 104 | + |
| 105 | +**Verify row count:** |
| 106 | + |
| 107 | +Row count validation verifies that the inserted data is stored correctly and consistently. |
| 108 | + |
| 109 | +```sql |
| 110 | +SELECT count(*) FROM events; |
| 111 | +``` |
| 112 | + |
| 113 | +You should see an output similar to: |
| 114 | +```output |
| 115 | +Query id: 644f6556-e69b-4f98-98ec-483ee6869d6e |
| 116 | +
|
| 117 | + ┌─count()─┐ |
| 118 | +1. │ 10000 │ |
| 119 | + └─────────┘ |
| 120 | +
|
| 121 | +1 row in set. Elapsed: 0.002 sec. |
| 122 | +``` |
| 123 | + |
| 124 | +### Baseline read performance test |
| 125 | +Baseline read queries measure basic query performance for filtering, aggregation, and grouping, establishing an initial performance reference on the Arm64 VM. |
| 126 | + |
| 127 | +- Run simple analytical queries: |
| 128 | + |
| 129 | +```sql |
| 130 | +SELECT count(*) FROM events WHERE event_type = 'click'; |
| 131 | +``` |
| 132 | + |
| 133 | +You should see an output similar to: |
| 134 | +```output |
| 135 | +Query id: bd609de4-c08e-4f9f-804a-ee0528c94e4d |
| 136 | +
|
| 137 | + ┌─count()─┐ |
| 138 | +1. │ 10000 │ |
| 139 | + └─────────┘ |
| 140 | +
|
| 141 | +1 row in set. Elapsed: 0.003 sec. Processed 10.00 thousand rows, 130.00 KB (2.98 million rows/s., 38.71 MB/s.) |
| 142 | +Peak memory usage: 392.54 KiB. |
| 143 | +``` |
| 144 | + |
| 145 | +- This query groups events by date and counts how many events occurred on each day, returning a daily summary of total events in chronological order. |
| 146 | + |
| 147 | +```sql |
| 148 | +SELECT |
| 149 | + toDate(event_time) AS date, |
| 150 | + count(*) AS total_events |
| 151 | +FROM events |
| 152 | +GROUP BY date |
| 153 | +ORDER BY date; |
| 154 | +``` |
| 155 | + |
| 156 | +You should see an output similar to: |
| 157 | +```output |
| 158 | +Query id: b3db69f8-c885-419f-9900-53d258f0b996 |
| 159 | +
|
| 160 | + ┌───────date─┬─total_events─┐ |
| 161 | +1. │ 2025-11-27 │ 10000 │ |
| 162 | + └────────────┴──────────────┘ |
| 163 | +
|
| 164 | +1 row in set. Elapsed: 0.002 sec. Processed 10.00 thousand rows, 40.00 KB (4.08 million rows/s., 16.33 MB/s.) |
| 165 | +Peak memory usage: 785.05 KiB. |
| 166 | +``` |
| 167 | + |
| 168 | +The baseline tests confirm that ClickHouse is stable, functional, and performing efficiently on the Arm64 VM. With core operations validated, the setup is now ready for detailed performance benchmarking. |
0 commit comments