Chess server is to be horizontally scaled #74
khemssharma
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Matchmaking queue and live
Game/StockfishGamestate live only in thememory of a single Node process. Redis is used only for reconnect persistence (surviving a
process restart), not for routing live traffic between instances.
Impact
Running more than one server instance behind a load balancer will silently
break active games: a player matched on instance A can't receive a move
from a player connected to instance B. This fails quietly rather than
erroring loudly, which makes it a scaling trap rather than a scaling wall.
Proposed direction (needs discussion before implementation)
state read from/written to Redis as source of truth instead of in-process
objects.
matchmaking service that hands off a
(gameId, instanceId)pair, so agiven game always routes to the instance that owns it.
This is a meaningfully bigger change and touches matchmaking,
reconnect, and disconnect-handling logic, so I'm opening this as a design
discussion rather than shipping a fix directly.
Beta Was this translation helpful? Give feedback.
All reactions