EssenceOfChaos

EssenceOfChaos

I created an app that uses Phoenix LiveView and is deployed on Gigalixir. The app manages the state of multiple players (for example, a poker table) using a Registry and a GenServer. I’m aware that Phoenix can handle many simultaneous connections, but my concern is that if I ever want to scale horizontally, I will need to use something like a Global Registry and libcluster; otherwise, the state might be split between multiple replicas. I’ve read some conflicting advice online: either that, for a start-up using Phoenix LiveView, it’s fine to start with a single replica and the decision of scaling should be left until the app actually starts receiving heavy traffic, or that it’s easier to start building a scalable app from the beginning rather than adjusting for scale later on.

So, do I wait until the traffic load becomes a strain, or do I try to implement horizontal scaling from the start? I have no idea how many users I’m going to have. I will be hosting a poker tournament with a $100 USD giveaway, so I would expect some traffic, but not very much. I gave myself about a month to figure out this problem and work out any bugs in the app before the tournament begins. Any guidance on this is greatly appreciated. You can see the site at High Society.

Most Liked

derek-zhou

derek-zhou

You can achieve a lot with just one node, one Registry, one GenServer per game, on a beefy machine. Try horizontal scaling only when vertical scaling start hitting diminishing return.

spacebat

spacebat

There are some subtleties to horizontal scaling and one of the benefits is high availability if done well. To cope with heavy load simply you can profile and optimise, and you can upgrade to a machine with more cores and memory. Best to see if you get that kind of traffic first, unless it’s really a learning exercise you’re after.

rhcarvalho

rhcarvalho

Well, on the other hand, running a multi node setup may require more from you up front and never pay off :slight_smile:

There’s no global optimum here. If you’re familiar with multi node deployments, you could make your early decisions aligned with not complicating your life later.

I’d make the simplest system that can possibly work for your current requirements. That will be cheaper to build and operate now.

Last Post!

FlyingNoodle

FlyingNoodle

Just take the memory per gameserver and then multiply by the player count that you expect.

You say a poker game so maybe 1MB per table at most. So with 1GB of ram you can host 1000 concurrent tables.

I would be surprised if you get that number.

Where Next? Top

Trending in Thoughts On... Top

EssenceOfChaos
I created an app that uses Phoenix LiveView and is deployed on Gigalixir. The app manages the state of multiple players (for example, a ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews