Updated 2026-05-30 · after the 6.61–6.64 fixes were rolled out.
$MIN in version_check.php now equals $CURRENT (=6.66). Any older version is forced up to the current one.$MIN.| Audience, MAU | Concurrent WS (peak) | State of a single VPS | Main bottleneck |
|---|---|---|---|
| ≤ 30k | ≤ 3k | 10× headroom, idle | Nothing in our stack |
| 30k — 100k | 3k — 10k | The target band, comfortable | Workerman's CPU handles pongs and events easily. The database works on primary-key lookups. 500 MB–1 GB of RAM for the sockets. |
| 100k — 200k | 10k — 20k | Running at the limit | The single Workerman process overheats at peak. Let a bug with dropped WebSockets surface and degradation begins. |
| > 200k | > 20k | We hit the ceiling | Phase C is needed (Workerman count=4 plus Redis pub/sub for shared $hosts/$guests). |
| Metric | Before the fixes | After 6.64 | Where it was done |
|---|---|---|---|
ble_token_renew queued while the owner is offline |
1300 per 4 h | 1 (UNIQUE INDEX dedup) | Server — works with any client |
| HTTP retries on a network failure | 5 keys × 1/min = 7200 a day | ~50 a day (30-minute backoff) | Client 6.64 — a new APK is required |
| WebSocket reconnects on a flapping network | ~10/min (1 s retry) | ~1/min (60 s backoff) | Client 6.62+ — a new APK is required |
| Database hello lookups during WebSocket flapping | ~50/s across 10k clients | ~5/s | Server — the 5-second rate limit protects against any client |
| Failed fire events in a guest's Prefs | 60+ a day per guest with an expired token | 0 | Client 6.63 |
| Recompose waves on guest_ok | on every numbers_update | only on a real change | Client 6.64 |
enqueueHostMsg — even if a 6.55 client sends 1300 identical renews, only one lands in the queue.$GLOBALS['apk_url'] in _config.php — moving to R2 or a CDN is a one-line change, with no app release.Decision: raised $MIN = '6.66'. Any old client, on its first versionCheck gets a blocking "Update the app" dialog (the UI already exists, see App.kt:checkVersionAsync).
Right now count=1 — a single PHP process holds ALL the WebSockets in the arrays $hosts/$guests/$calls in-memory.
The concrete thresholds:
What to do as 15k approaches:
apt install redis-server).count=4 (matching the VPS core count).$hosts/$guests/$calls into a Redis HASH with a TTL.Effect: linear scaling up to 4×, raising the ceiling to roughly 40–60k concurrent.
Today the 22 MB APK is served from our own VPS to every user. At 100 thousand that is 2.2 TB of outbound traffic per release — our own link may not cope, or may prove expensive.
Prepared in 6.64:
$GLOBALS['apk_url'] in _config.php — a single source of truth for the URL.download.php and version_check.php read it from there.When the move becomes necessary:
entrixy.apk.apk.entrixy.com through the Cloudflare CDN._config.php: $GLOBALS['apk_url'] = 'https://apk.entrixy.com/entrixy.apk';assembleRelease add r2 cp app-release.apk apk-bucket/entrixy.apk.At the present scale — dozens of test installations — no move is needed.
sudo supervisorctl restart dialer-ws.