|
| 1 | +--- |
| 2 | +title: Couchbase Benchmarking |
| 3 | +weight: 6 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | +## Puppet Benchmark on GCP SUSE Arm64 VM |
| 11 | +This section guides you through benchmarking Couchbase performance on a GCP SUSE Arm64 VM using the **official `cbc-pillowfight` tool** from Couchbase C SDK. |
| 12 | +It involves installing dependencies, building the SDK, verifying the setup, and running the benchmark test. |
| 13 | + |
| 14 | +### Install Build Tools & Dependencies |
| 15 | +Before compiling the Couchbase SDK, install all required development tools and libraries. |
| 16 | + |
| 17 | +```console |
| 18 | +sudo zypper install -y gcc gcc-c++ cmake make git openssl-devel libevent-devel cyrus-sasl-devel |
| 19 | +``` |
| 20 | + |
| 21 | +### Download and Build the Couchbase C SDK (includes cbc-pillowfight) |
| 22 | +`cbc-pillowfight` is a Couchbase command-line benchmarking tool that simulates a workload by performing concurrent read and write operations on a bucket to test Couchbase cluster performance. |
| 23 | + |
| 24 | +Clone the official Couchbase C SDK repository from GitHub. This SDK includes benchmarking tools such as `cbc` and `cbc-pillowfight`. |
| 25 | + |
| 26 | +```console |
| 27 | +cd ~ |
| 28 | +git clone https://github.com/couchbase/libcouchbase.git |
| 29 | +cd libcouchbase |
| 30 | +``` |
| 31 | + |
| 32 | +**Then build and install:** |
| 33 | + |
| 34 | +```console |
| 35 | +mkdir build && cd build |
| 36 | +cmake .. -DCMAKE_BUILD_TYPE=Release |
| 37 | +make -j$(nproc) |
| 38 | +sudo make install |
| 39 | +``` |
| 40 | + |
| 41 | +### Update the Dynamic Linker Configuration |
| 42 | +After installation, tell the system where to find the Couchbase libraries. |
| 43 | + |
| 44 | +```console |
| 45 | +echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/libcouchbase.conf |
| 46 | +``` |
| 47 | + |
| 48 | +Then refresh the linker cache to make the libraries available system-wide: |
| 49 | + |
| 50 | +```console |
| 51 | +sudo ldconfig |
| 52 | +``` |
| 53 | + |
| 54 | +### Verify Installation |
| 55 | +After installation, the tools like **cbc**, **cbc-pillowfight**, etc. should be available in `/usr/local/bin`. |
| 56 | + |
| 57 | +**Verify with:** |
| 58 | + |
| 59 | +```console |
| 60 | +cbc version |
| 61 | +cbc-pillowfight --help |
| 62 | +``` |
| 63 | +You should see an output similar to: |
| 64 | +```output |
| 65 | +cbc: |
| 66 | + Runtime: Version=3.3.18, Changeset=a8e17873d167ec75338a358e54cec3994612d260 |
| 67 | + Headers: Version=3.3.18, Changeset=a8e17873d167ec75338a358e54cec3994612d260 |
| 68 | + Build Timestamp: 2025-11-06 04:36:42 |
| 69 | + CMake Build Type: Release |
| 70 | + Default plugin directory: /usr/local/lib64/libcouchbase |
| 71 | + IO: Default=libevent, Current=libevent, Accessible=libevent,select |
| 72 | + SSL Runtime: OpenSSL 1.1.1l-fips 24 Aug 2021 SUSE release 150500.17.40.1 |
| 73 | + SSL Headers: OpenSSL 1.1.1l-fips 24 Aug 2021 SUSE release SUSE_OPENSSL_RELEASE |
| 74 | + HAVE_PKCS5_PBKDF2_HMAC: yes |
| 75 | + Snappy: 1.1.8 |
| 76 | + Tracing: SUPPORTED |
| 77 | + System: Linux-6.4.0-150600.23.73-default; aarch64 |
| 78 | + CC: GNU 7.5.0; -fno-strict-aliasing -ggdb3 -pthread |
| 79 | + CXX: GNU 7.5.0; -fno-strict-aliasing -ggdb3 -pthread |
| 80 | +``` |
| 81 | + |
| 82 | +### Run Benchmark using cbc-pillowfight |
| 83 | +Once Couchbase Server is running and a bucket (e.g., `benchmark`) is created, you can run a workload test using the following command: |
| 84 | + |
| 85 | +```console |
| 86 | +cbc-pillowfight -U couchbase://127.0.0.1/benchmark \ |
| 87 | +-u Administrator -P password \ |
| 88 | +-I 10000 -B 1000 -t 5 -c 500 |
| 89 | +``` |
| 90 | + |
| 91 | +- **-U couchbase://127.0.0.1/benchmark**: Connection string to Couchbase bucket |
| 92 | +- **-u Administrator**: Couchbase username |
| 93 | +- **-P password**: Couchbase password |
| 94 | +- **-I 10000**: Number of items (documents) to use |
| 95 | +- **-B 1000**: Batch size for operations |
| 96 | +- **-t 5**: Number of concurrent threads |
| 97 | +- **-c 500**: Number of operation cycles to run |
| 98 | + |
| 99 | +You should see an output similar to: |
| 100 | +```output |
| 101 | +Running. Press Ctrl-C to terminate... |
| 102 | +Thread 0 has finished populating. |
| 103 | +Thread 1 has finished populating. |
| 104 | +Thread 2 has finished populating. |
| 105 | +Thread 3 has finished populating. |
| 106 | +Thread 4 has finished populating. |
| 107 | +``` |
| 108 | + |
| 109 | +### Monitoring During Test |
| 110 | +While the benchmark runs, open the Couchbase Web Console in your browser: |
| 111 | + |
| 112 | +```bash |
| 113 | +http://<your-vm-ip>:8091 |
| 114 | +``` |
| 115 | + |
| 116 | +**Navigate to**: |
| 117 | +**Dashboard → Buckets → benchmark → Metrics tab** |
| 118 | + |
| 119 | +Monitor real-time performance metrics such as: |
| 120 | +- **Ops/sec** — should match your CLI output |
| 121 | +- **Resident ratio** — how much data stays in memory |
| 122 | +- **Disk write queue** — backlog of writes to disk |
| 123 | +- **CPU and memory usage** — tells you how well ARM cores are handling load |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | +### Benchmark summary on x86_64 |
| 128 | +To compare the benchmark results, the following results were collected by running the same benchmark on a `x86 - c4-standard-4` (4 vCPUs, 15 GB Memory) x86_64 VM in GCP, running SUSE: |
| 129 | + |
| 130 | +| **Name** | **Items** | **Resident** | **Ops/sec** | **RAM Used / Quota** | **Disk Used** | |
| 131 | +|---------------|------------|---------------|---------------|-----------------------|---------------| |
| 132 | +| benchmark | 10,000 | 100% | 219,961.9 | 36.9 MiB / 1 GiB | 25.3 MiB | |
| 133 | + |
| 134 | +### Benchmark summary on Arm64 |
| 135 | +Results from the earlier run on the `c4a-standard-4` (4 vCPU, 16 GB memory) Arm64 VM in GCP (SUSE): |
| 136 | + |
| 137 | +| **Name** | **Items** | **Resident** | **Ops/sec** | **RAM Used / Quota** | **Disk Used** | |
| 138 | +|---------------|------------|---------------|---------------|-----------------------|---------------| |
| 139 | +| benchmark | 10,000 | 100% | 227,981.1 | 36.8 MiB / 1 GiB | 26.7 MiB | |
| 140 | + |
| 141 | +### Couchbase benchmarking comparison on Arm64 and x86_64 |
| 142 | + |
| 143 | +- **Operations per Second:** 227,981.1 ops/sec — indicates high throughput |
| 144 | +- **Resident Ratio:** 100% — all data served directly from memory |
| 145 | +- **RAM Usage:** 36.8 MiB used out of 1 GiB quota — highly efficient memory utilization |
| 146 | +- **Disk Usage:** 26.7 MiB — minimal disk consumption |
| 147 | +- **Overall:** The Couchbase bucket performed efficiently with strong in-memory performance and low resource usage. |
0 commit comments