|
| 1 | +--- |
| 2 | +title: Benchmark Gerrit |
| 3 | +weight: 6 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | + |
| 10 | +## Overview |
| 11 | +This section guides you through benchmarking basic Gerrit performance on our Axiom VM. The benchmark consists of a custom script that will exercise and time key Gerrit features/functions. |
| 12 | + |
| 13 | +## Download and Install the benchmarking script |
| 14 | + |
| 15 | +Clone the following repo into your VM: |
| 16 | + |
| 17 | +```bash |
| 18 | +cd $HOME |
| 19 | +git clone https://github.com/DougAnsonAustinTx/gerrit_test |
| 20 | +``` |
| 21 | + |
| 22 | +## Run Benchmark |
| 23 | + |
| 24 | +Run the benchmark: |
| 25 | + |
| 26 | +```bash |
| 27 | +cd $HOME/gerrit_test |
| 28 | +chmod 755 *.sh |
| 29 | +sudo SYNTH_PROFILE=production_like REQUIRE_GERRIT_METRICS=true ./gerrit_perf_test.sh |
| 30 | +``` |
| 31 | + |
| 32 | +The benchmark script will run through some sample exercises that Gerrit supports and will capture performance data from those exercises and place them into a specified JSON file similar to this (partial omitted for brevity): |
| 33 | + |
| 34 | +```json |
| 35 | +{ |
| 36 | + "run": { |
| 37 | + "run_id": "20260622T152549Z", |
| 38 | + "timestamp_utc": "2026-06-22T15:35:19Z", |
| 39 | + "host": "douans01-gerrit-arm-6.c.arm-deveco-stedvsl-prd.internal", |
| 40 | + "os": "Debian GNU/Linux 13 (trixie)" |
| 41 | + }, |
| 42 | + "software": { |
| 43 | + "java_version": "openjdk version \"21.0.11\" 2026-04-21 OpenJDK Runtime Environment (build 21.0.11+10-1-deb13u2-Debian) OpenJDK 64-Bit Server VM (build 21.0.11+10-1-deb13u2-Debian, mixed mode, sharing) ", |
| 44 | + "gerrit_version": "gerrit version 3.11.2", |
| 45 | + "gerrit_base_url": "http://127.0.0.1:8080", |
| 46 | + "gerrit_test_http_user": "admin", |
| 47 | + "prometheus_url": "http://127.0.0.1:9090", |
| 48 | + "gerrit_metrics_url": "http://127.0.0.1:8080/plugins/metrics-reporter-prometheus/metrics", |
| 49 | + "gerrit_metrics_probe_status": "ok", |
| 50 | + "gerrit_metrics_auth_mode": "bearer" |
| 51 | + }, |
| 52 | + "workload": { |
| 53 | + "test_duration_seconds_per_step": 120, |
| 54 | + "concurrency_steps": "2,1,1 4,2,1 6,3,2 8,4,2", |
| 55 | + "legacy_single_step_defaults": { |
| 56 | + "rest_concurrency": 6, |
| 57 | + "git_clone_concurrency": 3, |
| 58 | + "git_push_concurrency": 2 |
| 59 | + }, |
| 60 | + "synthetic_profile": "production_like", |
| 61 | + "synthetic_projects": 8, |
| 62 | + "synthetic_initial_files_per_project": 300, |
| 63 | + "synthetic_initial_commits_per_project": 50, |
| 64 | + "synthetic_review_changes_per_project": 40, |
| 65 | + "synthetic_large_files_per_project": 8, |
| 66 | + "synthetic_large_file_kb": 1024 |
| 67 | + }, |
| 68 | + "startup_state": { |
| 69 | + "initial_gerrit_was_running": "true" |
| 70 | + }, |
| 71 | + "operation_summary": [ |
| 72 | + { |
| 73 | + "type": "git_clone", |
| 74 | + "count": 4301, |
| 75 | + "ok_count": 4301, |
| 76 | + "fail_count": 0, |
| 77 | + "min_ms": 105, |
| 78 | + "avg_ms": 244.42269239711695, |
| 79 | + "p50_ms": 220, |
| 80 | + "p90_ms": 418, |
| 81 | + "p95_ms": 456, |
| 82 | + "p99_ms": 521, |
| 83 | + "max_ms": 611 |
| 84 | + }, |
| 85 | + { |
| 86 | + "type": "git_push_refs_for", |
| 87 | + "count": 570, |
| 88 | + "ok_count": 570, |
| 89 | + "fail_count": 0, |
| 90 | + "min_ms": 75, |
| 91 | + "avg_ms": 157.13333333333333, |
| 92 | + "p50_ms": 155, |
| 93 | + "p90_ms": 222, |
| 94 | + "p95_ms": 239, |
| 95 | + "p99_ms": 288, |
| 96 | + "max_ms": 344 |
| 97 | + }, |
| 98 | + { |
| 99 | + "type": "rest_change_query", |
| 100 | + "count": 42992, |
| 101 | + "ok_count": 42992, |
| 102 | + "fail_count": 0, |
| 103 | + "min_ms": 12, |
| 104 | + "avg_ms": 31.553265723855603, |
| 105 | + "p50_ms": 30, |
| 106 | + "p90_ms": 50, |
| 107 | + "p95_ms": 56, |
| 108 | + "p99_ms": 69, |
| 109 | + "max_ms": 105 |
| 110 | + } |
| 111 | + ] |
| 112 | + // rest of file omitted for brevity... |
| 113 | +} |
| 114 | +``` |
| 115 | + |
| 116 | +This JSON file can be processed to create a summary of the performance of Gerrit on our Axion C4A VM. |
| 117 | + |
| 118 | +## Performance summary |
| 119 | + |
| 120 | +The benchmark run completed successfully on the production-like profile with Gerrit metrics enabled. It |
| 121 | +recorded 47,863 measured client operations over four 120-second steps, with 47,863 successes and zero failures. |
| 122 | +The benchmark gives a high-quality performance view: client latency, stepwise concurrency behavior, node |
| 123 | +CPU/memory/disk, and Gerrit-side JVM, GC, Jetty, cache, queue, Git, REST, NoteDB, and receive-commits metrics |
| 124 | +are all present: |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | +Client-visible correctness is excellent: all 47,863 measured operations succeeded. REST query latency remains low |
| 129 | +with p99 69 ms. Clone is the dominant pressure point at p99 521 ms, and push remains sub-second at p99 288 ms: |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | +The useful capacity signal is the flattening throughput curve after step 2. CPU is already near saturation in step 2, then |
| 134 | +stays around 99% in steps 3 and 4. Latency continues rising: clone p99 increases from 221 ms in step 2 to 550 ms in |
| 135 | +step 4, while aggregate throughput only rises from 103.3 to 108.4 ops/sec: |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | +Host CPU pressure: |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | +Gerrit server-side correlation observations: |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | +Basic Server Metrics: |
| 148 | + |
| 149 | + |
0 commit comments