|
| 1 | +# Scale Up Demo Server for Sustained Load Growth |
| 2 | + |
| 3 | +<!-- cspell:ignore CCX CCX13 CCX23 CCX33 CCX43 CCX53 CCX63 NVMe EX44 EX63 AX42 AX102 newtrackon --> |
| 4 | + |
| 5 | +**Issue**: [#30](https://github.com/torrust/torrust-tracker-demo/issues/30) |
| 6 | +**Related**: |
| 7 | +[#21](https://github.com/torrust/torrust-tracker-demo/issues/21), |
| 8 | +[#29](https://github.com/torrust/torrust-tracker-demo/issues/29), |
| 9 | +[infrastructure-resize-history.md](../../infrastructure-resize-history.md) |
| 10 | + |
| 11 | +## Overview |
| 12 | + |
| 13 | +After the conntrack fix and server resize in |
| 14 | +[#21](https://github.com/torrust/torrust-tracker-demo/issues/21), UDP uptime |
| 15 | +recovered to 99.9%. A follow-on softirq hotspot (CPU2 at 100% soft) was |
| 16 | +diagnosed and fixed in [#29](https://github.com/torrust/torrust-tracker-demo/issues/29) |
| 17 | +Phase 3 (RPS/RFS enabled on 2026-05-04). The hotspot was immediately resolved — |
| 18 | +CPU soft-IRQ spread across all 8 CPUs — but the host load average remained in |
| 19 | +the 9–10 range on an 8-vCPU machine. |
| 20 | + |
| 21 | +This means the server is running at or beyond its comfortable capacity even with |
| 22 | +packet steering working correctly. If traffic continues to grow, or if the |
| 23 | +softirq tuning is ever disrupted, uptime on newTrackon is likely to degrade |
| 24 | +again. This issue tracks planning and execution of the next server scale-up. |
| 25 | + |
| 26 | +## Current State (2026-05-05) |
| 27 | + |
| 28 | +Post-RPS/RFS baseline collected at `2026-05-05T09:13:52Z` (T+1h after Phase 3): |
| 29 | + |
| 30 | +- Host load average: `9.24 / 9.24 / 9.43` (8-vCPU machine) |
| 31 | +- CPU distribution (`mpstat -P ALL 1 1`): |
| 32 | + - CPU2: `%soft=49.48` (was 100% before Phase 3) |
| 33 | + - All CPUs: `%soft` in the 26–41% range |
| 34 | + - Combined idle across all CPUs: low, indicating sustained saturation |
| 35 | +- Docker container CPU (approximate): |
| 36 | + - `caddy`: ~300% |
| 37 | + - `tracker`: ~90% |
| 38 | +- Request rates from Prometheus (5-minute rate): |
| 39 | + - HTTP1: ~1982 req/s |
| 40 | + - UDP1: ~2124 req/s |
| 41 | + - Combined: ~4107 req/s (~513 req/s per vCPU) |
| 42 | +- newTrackon status: both endpoints `Working` |
| 43 | + |
| 44 | +Load averages of 9–10 on an 8-vCPU host indicate the runqueue is consistently |
| 45 | +overcommitted even after the softirq fix. There is very little headroom. |
| 46 | + |
| 47 | +## Goal |
| 48 | + |
| 49 | +Determine the right time and target plan to resize the server so that: |
| 50 | + |
| 51 | +- Host load average stays comfortably below the vCPU count (target: < 0.7 per |
| 52 | + vCPU, i.e., < 5.6 on an 8-vCPU host or < 11.2 on a 16-vCPU host). |
| 53 | +- Combined req/s per vCPU drops to a level that provides meaningful headroom. |
| 54 | +- newTrackon uptime for both endpoints remains >= 99.0%. |
| 55 | + |
| 56 | +## Trigger Conditions |
| 57 | + |
| 58 | +**Do not resize until at least one of the following is true:** |
| 59 | + |
| 60 | +1. T+next-day observation in ISSUE-29 shows the RPS/RFS fix is not holding |
| 61 | + (CPU2 `%soft` returns to 100% or overall soft-IRQ pressure re-concentrates). |
| 62 | +2. newTrackon UDP uptime drops below 99.0% on the rolling 7-day window. |
| 63 | +3. newTrackon HTTP uptime drops below 99.0%. |
| 64 | +4. newTrackon response times for either endpoint increase materially (> 2× |
| 65 | + current baseline) for more than 24 hours. |
| 66 | +5. Load average exceeds 12 sustained over a 24-hour period (1.5× vCPU count). |
| 67 | + |
| 68 | +Track these signals in the **Observation Log** section below. |
| 69 | + |
| 70 | +## newTrackon Tracking |
| 71 | + |
| 72 | +Monitor both endpoints: |
| 73 | + |
| 74 | +- HTTP: `https://http1.torrust-tracker-demo.com:443/announce` |
| 75 | +- UDP: `udp://udp1.torrust-tracker-demo.com:6969/announce` |
| 76 | + |
| 77 | +Check and record at each observation interval: |
| 78 | + |
| 79 | +- Status (Working / Down) |
| 80 | +- Rolling uptime % |
| 81 | +- Response time (ms) |
| 82 | + |
| 83 | +### Observation Log |
| 84 | + |
| 85 | +| Date (UTC) | HTTP1 status | HTTP1 uptime % | HTTP1 resp (ms) | UDP1 status | UDP1 uptime % | UDP1 resp (ms) | Load avg (1m) | Notes | |
| 86 | +| ---------- | ------------ | -------------- | --------------- | ----------- | ------------- | -------------- | ------------- | --------------------------------- | |
| 87 | +| 2026-05-05 | Working | — | — | Working | — | — | 9.24 | Baseline after RPS/RFS (ISSUE-29) | |
| 88 | + |
| 89 | +## Scope |
| 90 | + |
| 91 | +- Evaluate and select the next server plan (cloud or dedicated). |
| 92 | +- Execute resize at the appropriate trigger point. |
| 93 | +- Keep all other configuration constant during the observation window. |
| 94 | +- Record pre-resize and post-resize metrics. |
| 95 | +- Update `infrastructure-resize-history.md`. |
| 96 | + |
| 97 | +## Non-Goals |
| 98 | + |
| 99 | +- Migrating to a multi-host or distributed architecture. |
| 100 | +- Making tuning changes simultaneously with the resize. |
| 101 | +- Changing the tracker or proxy configuration. |
| 102 | + |
| 103 | +## Options Research |
| 104 | + |
| 105 | +All prices are list prices in EUR (excl. VAT) as of May 2026. |
| 106 | + |
| 107 | +### Hetzner Cloud — AMD Dedicated vCPU (CCX Series) |
| 108 | + |
| 109 | +These are cloud VMs with dedicated AMD vCPUs, easy to resize online via the |
| 110 | +Hetzner console (no migration required, brief reboot only). |
| 111 | + |
| 112 | +| Plan | vCPU | RAM | NVMe SSD | Traffic | Price/month | |
| 113 | +| ----- | ---- | ------ | -------- | ------- | ----------- | |
| 114 | +| CCX13 | 2 | 8 GB | 80 GB | 20 TB | €16.49 | |
| 115 | +| CCX23 | 4 | 16 GB | 160 GB | 20 TB | €31.99 | |
| 116 | +| CCX33 | 8 | 32 GB | 240 GB | 30 TB | €62.99 | |
| 117 | +| CCX43 | 16 | 64 GB | 360 GB | 40 TB | €125.49 | |
| 118 | +| CCX53 | 32 | 128 GB | 600 GB | 40 TB | €250.49 | |
| 119 | +| CCX63 | 48 | 192 GB | 960 GB | 60 TB | €374.99 | |
| 120 | + |
| 121 | +**Current plan: CCX33** (8 vCPU / 32 GB / €62.99/mo) |
| 122 | + |
| 123 | +**Next step up: CCX43** (16 vCPU / 64 GB / €125.49/mo — +€62.50/mo) |
| 124 | + |
| 125 | +CCX43 would reduce normalized load from ~513 req/s/vCPU to ~257 req/s/vCPU at |
| 126 | +current traffic, and load average headroom would double. |
| 127 | + |
| 128 | +Advantages of cloud step-up: |
| 129 | + |
| 130 | +- No setup fee; no data migration. |
| 131 | +- Revert is possible if the resize is not justified. |
| 132 | +- Consistent experience with previous resize (CCX23 → CCX33). |
| 133 | + |
| 134 | +### Hetzner Dedicated Servers |
| 135 | + |
| 136 | +Dedicated physical servers provide more cores and threads per EUR, but require |
| 137 | +a manual server migration (data copy, DNS/IP cutover) and a one-time setup fee. |
| 138 | + |
| 139 | +| Model | Cores | Threads | RAM | Storage | Bandwidth | Price/month | Setup fee | |
| 140 | +| ------- | ----- | ------- | ------ | --------------- | --------- | ----------- | --------- | |
| 141 | +| EX44 | 14 | 20 | 64 GB | 2 × 512 GB NVMe | 1000 Mbit | ~€44 | ~€109 | |
| 142 | +| AX42-U | 8 | 16 | 64 GB | 2 × 512 GB NVMe | 1000 Mbit | ~€54 | ~€234 | |
| 143 | +| EX63 | 20 | 20 | 64 GB | 2 × 1 TB NVMe | 1000 Mbit | ~€76 | ~€325 | |
| 144 | +| AX102-U | 16 | 32 | 128 GB | varies | 1000 Mbit | ~€119 | ~€500 | |
| 145 | + |
| 146 | +**EX44 is the standout option** if we decide to go dedicated: |
| 147 | + |
| 148 | +- 14 physical cores / 20 threads vs 8 vCPUs today. |
| 149 | +- 64 GB RAM (2× current). |
| 150 | +- Monthly cost (~€44) is actually _cheaper_ than the current CCX33 (~€62.99). |
| 151 | +- One-time setup fee of ~€109 is recovered in roughly 2 months of savings. |
| 152 | +- Break-even vs CCX43 (~€125.49/mo): in month 1 total spend is ~€153 vs €125; |
| 153 | + from month 2 onwards EX44 saves ~€82/mo over CCX43. |
| 154 | + |
| 155 | +Disadvantages of dedicated: |
| 156 | + |
| 157 | +- Manual migration required (bring-your-own IP, data copy, DNS update). |
| 158 | +- No online resize; rollback is much harder. |
| 159 | +- Bare-metal; OS and boot configuration is our responsibility. |
| 160 | +- Physical hardware failure handling differs from cloud VMs. |
| 161 | + |
| 162 | +### Decision Matrix |
| 163 | + |
| 164 | +| Criterion | CCX43 (cloud step-up) | EX44 (dedicated) | |
| 165 | +| ----------------------- | ----------------------- | ------------------------------------ | |
| 166 | +| Monthly cost | €125.49 | ~€44 (saves ~€19/mo vs current) | |
| 167 | +| Setup friction | Minimal (reboot only) | High (full migration) | |
| 168 | +| Reversibility | Easy | Hard | |
| 169 | +| CPU headroom at ~4k rps | 16 vCPU / ~257 rps/vCPU | 20 threads / ~205 rps/thread | |
| 170 | +| RAM headroom | 64 GB | 64 GB | |
| 171 | +| Long-term cost | More expensive | Cheaper after break-even (~2 months) | |
| 172 | +| Risk | Low | Medium (migration complexity) | |
| 173 | + |
| 174 | +**Recommendation**: Start with CCX43 if the trigger is near-term and urgency |
| 175 | +is high. Plan migration to EX44 if sustained long-term cost reduction is the |
| 176 | +priority once the situation is stable. |
| 177 | + |
| 178 | +## Implementation Plan |
| 179 | + |
| 180 | +1. Monitor newTrackon and ISSUE-29 Phase 3 outcomes daily. |
| 181 | +2. When a trigger condition is met, capture a pre-resize baseline snapshot |
| 182 | + (request rates, load averages, uptime). |
| 183 | +3. Select target plan based on urgency and risk tolerance (see decision matrix). |
| 184 | +4. Execute resize following the procedure documented for ISSUE-21. |
| 185 | +5. Verify all services recover post-resize. |
| 186 | +6. Observe for at least 7 days and record post-resize metrics. |
| 187 | +7. Update `infrastructure-resize-history.md` with pre- and post-resize rows. |
| 188 | +8. Close this issue with a conclusion referencing the evidence. |
| 189 | + |
| 190 | +## Metrics and Evidence to Track |
| 191 | + |
| 192 | +- External uptime: |
| 193 | + - newTrackon HTTP uptime for `http1` |
| 194 | + - newTrackon UDP uptime for `udp1` |
| 195 | + - newTrackon response times for both endpoints |
| 196 | +- Traffic levels: |
| 197 | + - HTTP1 request rate (Grafana) |
| 198 | + - UDP1 request rate (Grafana) |
| 199 | + - Combined request rate (HTTP1 + UDP1) |
| 200 | + - Normalized load (combined req/s per vCPU) |
| 201 | +- Capacity pressure: |
| 202 | + - Host load average (1m, 5m, 15m) |
| 203 | + - Container CPU usage (caddy, tracker) |
| 204 | + - `%soft` per CPU from `mpstat` |
| 205 | + |
| 206 | +## Acceptance Criteria |
| 207 | + |
| 208 | +- [ ] Trigger condition documented and agreed upon before resize starts. |
| 209 | +- [ ] Pre-resize baseline captured. |
| 210 | +- [ ] Resize executed and documented in resize history. |
| 211 | +- [ ] No critical service regression immediately after resize. |
| 212 | +- [ ] At least 7 days of post-resize observations recorded. |
| 213 | +- [ ] Host load average stays below vCPU count sustained (< 1.0 per vCPU). |
| 214 | +- [ ] newTrackon uptime for both endpoints remains >= 99.0%. |
| 215 | +- [ ] Pre/post comparison documented with clear conclusion. |
| 216 | + |
| 217 | +## Possible Outcomes |
| 218 | + |
| 219 | +- **Success**: Load average drops below vCPU count, uptime stable at >= 99.0%. |
| 220 | +- **Partial**: Uptime holds but load remains high; additional tuning needed. |
| 221 | +- **No improvement**: Traffic growth outpaces resize; larger plan required. |
| 222 | +- **Premature**: ISSUE-29 Phase 3 outcome fully resolves headroom concerns; resize |
| 223 | + deferred indefinitely. |
0 commit comments