A game-community product under a 7× traffic jump, and a 3D venue page that makes no network requests
Community Jury is a live product I designed, built and operate alone. This page covers what the landing page does not: what happened when traffic jumped sevenfold in four days, the bug that hid behind a slow upstream for a week, and the seat map I built for a finals weekend.
Solo, with coding agents. First commit in late September 2026; versions 1.0.1 to 1.0.160 between 9 October and 3 December. Stack: Go, PostgreSQL, Redis, a Python query gateway, React, TypeScript, WeChat Mini Program, three.js, Docker on a single host.
The system
A Go API and a Go worker for background jobs share one codebase. PostgreSQL holds everything that must not be lost. Redis holds only what can be rebuilt: caches, rate limits and short leases. A Python gateway, running as two instances, fetches match data from an upstream source with strict rate limits; requests are split between the instances by a hash of the player's tag.
It all runs on one host under Docker Compose. The working branch is about 84,000 lines of Go in 336 files, 147 of them tests, with 93 schema migrations.
"Real time" here means polling. There are no WebSockets in the product. Room state polls every two seconds. Anything slow is a background job that the page asks about again.
Analytics is one table. A page-view beacon and a whitelist of client events write to a single PostgreSQL table with a JSON column for client, entry scene and referrer. The admin dashboard runs SQL on demand. Per-route counters and latency histograms live in memory and flush to Redis every 15 seconds. There is no stream processor and no separate analytics store, and at this size none is needed.
The lookup that failed 29% of the time
Between 14 and 18 November daily users went from about 210 to 1,502. Analytics showed where they came from: share cards in group chats brought 5,003 page views on the peak day. That day the API served 100,987 requests.
The match-history page suffered. In an eleven-hour window, 391 of 1,327 requests for a player's match list returned "still fetching", which is 29%. The upstream was plainly slow: a first-time collection took 32 seconds at the median and 213 at the 95th percentile, and the gateway's queue was full. I wrote it up as an upstream problem and decided not to raise upstream concurrency to hide it.
Five days later the rate was worse: 72 of 201, or 36%. That did not fit the story, because by then 3,875 of 4,299 active accounts already had matches stored in my own database. The fallback that should have served them was reading with the request's eight-second deadline, which had already expired by the time the fallback ran. It failed every time, and the slow upstream had been taking the blame.
- The fix: the fallback gets its own three-second deadline, the API answers stale-first, and an integration test reproduces the old error.
- Found in the same pass: a missing foreign-key index had caused 294,986 sequential scans of a 1.38-million-row table.
- Also found: two accounts that could never be verified had started 643 upstream jobs in 87 minutes. They now back off from one minute to one hour.
- After: 5 errors in 2,386 match-list requests over 24 hours, which is 0.21%.
Traffic control without a deploy
- One settings row, read through a ten-second cache, switches live lookups on or off and sets a budget and bot limits. Changing it needs no release.
- One gate, at the only place a cache miss can start an upstream job. A refused caller gets the cached result or a 429.
- Redis failing is handled on purpose: live lookups fail open and bot traffic fails closed.
- The gateway's governor queues upstream calls under global rate and concurrency limits, and a breaker pauses everything when the upstream starts refusing.
- Venue routes have a higher per-address limit, because a crowd in one hall shares a few public addresses.
Decisions I measured first
- I withdrew a database memory increase. The buffer hit ratio measured 99.72%, so memory was not the problem. The missing index was.
- I removed the daily lookup cap. A cap of 3,000 ran out at 16:48 one afternoon and every lookup after that was refused. What needs protecting is the request rate, not the daily total.
- I bounded the cache instead of buying memory. The API was killed twice at its 768 MiB limit. Each cached player cost about 208 KB, so the cache is now capped at 300 players and the Go runtime has a memory limit.
- Wait eight seconds, then answer anyway. Requests held longer than that did not reliably reach phones inside the mini-program's web view.
Releases and the finals weekend
One script does a release. It refuses a dirty or unpushed tree and a server with less than 6 GB free. Locally it runs formatting, vet, tests against a real PostgreSQL, the web build, browser QA on a clean database, and a read-only replay of the latest production backup. On the server it builds, backs up the database, switches version, migrates, waits for readiness and runs a smoke test. Any failure after the switch rolls back automatically.
Migrations are forward-only, so a rollback runs old code on the new schema. I accept that and write migrations to allow it.
For the finals weekend of 4 to 6 December I added a read-only sampler that runs every 30 minutes and expires by itself afterwards. It alerts on disk at 90%, on server errors above 2% in an hour, on match-lookup errors above 10%, and on any paid order that fails to deliver. The baseline the day before: 91,974 requests in 24 hours, 0.04% server errors, a 95th percentile of 45 ms, and no alerts.
Written on 3 December. The weekend's numbers are not in yet.
The 3D venue page
For the same finals I built a seat map for a gaming-community app's event section. A fan picks a section and row for each day, sees themselves and others in the hall in 2D or 3D, looks at the stage in first person from their seat, and exports a poster. The source is public.
- A static bundle with a host seam. One HTML file, one script, one stylesheet, relative paths. The host app injects an adapter with five functions for profile, seats and chat. Without it the page runs a local demo.
- Zero network requests, enforced by the build. A scanner fails the build on any of 17 network-API patterns, or on any URL other than one XML namespace string. A headless browser then walks the whole flow from
file://, with and without WebGL, and fails on any request that is not a file, data or blob URL. - That constraint chose the stack. No React, because its production bundle embeds a URL. No module scripts, because browsers block them from
file://. three.js is bundled, and fonts are the system's. - Geometry is code. 40 stand blocks in 24 sections are generated procedurally and merged into one mesh per material. All of the roughly 12,800 seats are a single instanced mesh with per-seat colour.
- Crowds stay readable. From far away a section shows a sign with a head count. Closer, people become dots. Close in, only the nearest 12 are drawn as figures, and the tag plates rotate every six seconds.
- Size: 589 KB of JavaScript, 154 KB compressed.
Limits
- One host. Disk was at 87% the day before the finals, with the alert at 90%.
- A 13-hour lookup outage in early November after a reboot, caused by a service ordering cycle at startup.
- Load tests are local only.
- Logs are lost when a container is rebuilt, which is why the measurement windows above are 11 hours and 87 minutes long.
- The plan's targets are still plans: more than one replica, metrics and tracing.
- The seat page has no unit tests. Its checks are the build scanner and the scripted browser run.
- Coding agents wrote much of the code. The design, the diagnosis and the operating decisions are mine.