Repository navigation
Server Scaling #71
Ughuuu
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.
Tutorial on how to scale the Gamend cluster to multiple instances.
Both the running instance of gamend, which can be found at https://gamend.org and the README.md now have information about how to deploy the app at scale.
Infrastructure
When scaling, the recommended setup is a Postgres database and a Redis cache:
Tutorial (Docker Compose)
This will start 2 instances of the
gamendapp, a Postgres database, Redis cache and a nginx that acts as a load balancer.Now, go to the browser to http://localhost:4000, register with any email and then go to the dev mailbox, at http://localhost:4000/dev/mailbox (Only enabled locally to test, in prod disable it). Accept the registration, then login with magic link. You should now have admin access (first registered user is admin).
Load Balancer
The nginx load balancer will call into either
app-1orapp-2. The gamend server has a cache layer, which can be configured in different ways, but for this it's configured with Redis. The database of choice is Postgres here (for single deployment it can also use SQLite).Multilevel Cache
The app uses 2 level caching. First
local in memory, and thenRedis(over network). When something is written to the database or read, the cache is updated both locally and distributed. Read more about Multilevel cache here:Read it on the site: https://gamend.org/blog/gamend-scaling
All reactions