Server capacity upgrade

Board Game Arena Official announcements
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Server capacity upgrade

Post by sourisdudesert »

Yesterday, we performed an important server capacity upgrade on Board Game Arena.

The service was okay up to ~1100 online playing players, but above this number it was getting slower and slower, with too many of "BGA mainsite does not respond" or "Server update in progress" or "Error with notification system".

For those who are interested by a little "behind the scene", here is the explanation about why it took so long before we react, what we've done and why it was difficult.

More servers = more capacity?

BGA is quite different from many other websites, because it's mostly based on "realtime" : you don't have to refresh your browser to see that someone created a table, or that your opponent has played.

The architecture needed to do this is way more complex than for a standard website. Basically, for a standard website, when you want to upgrade your service capacity, you just need to add more servers. More servers = more capacity. Seems pretty straightforward.

The realtime server

This is also partially true for BGA, and regularly we are adding more servers. But this is not the case for the "realtime" server, the one which allows you to receive changes in realtime from BGA. This is this famous "notification service" that sometimes gives you horrible red error messages.

So why can't we add more "realtime servers"?

Because everyone of you has to be connected to the same realtime server. Otherwise, when you are doing a move, your opponent won't be notified about it. So we are using a specific technology (NodeJs) that is allowing many many players to be connected at the same time to the same realtime server. And this is the situation from the beginning of BGA.

Weeks ago, as BGA was getting more are more audience, and the realtime server wasn't able to handle this at peak hours. This server was already the most powerful available server, so it become obvious that we reached the limit of the "classic" approach.

Grow and multiply

So here is what we've done : we splitted the realtime server in 4 realtime servers - which (theoretically) multiply the server realtime capacity by four.

To do this, we had to make sure that these 4 servers are synchronized, so if you and your opponent are connected to different servers, you can still play together. We had to rewrite 40-50% of the realtime server logic, which is not a "big" work but this is very sensitive one. Basically if something goes wrong here, it can break the whole service in seconds.

The day after

Today, the service seems stable, and most of the issues we found yesterday has been solved. However, we changed a lot of things in a small amount of time, so there may be some remaining issues.

If you found one of these issue, please report it in the bug system or as a comment on this post.

Note : if your issue has been reported months ago, this is probably not an issue related to the yesterday's operations.

Thank you everyone for making this service popular, and sorry about the impact of these - needed - changes on the service.

... and by the way, to immediately use our increased realtime capacity, we added a "X is writing something ..." feature on the chat :)
User avatar
Daedalus005
Posts: 1
Joined: 09 March 2016, 17:47

Re: Server capacity upgrade

Post by Daedalus005 »

Well done, and thanks for the info. Interested :)
User avatar
CliveUK
Posts: 13
Joined: 26 June 2015, 19:09

Re: Server capacity upgrade

Post by CliveUK »

Great work, thanks. One thought, could you perhaps run certain games on specific servers? So you can take the top 4 server-intensive games and force them to run on four different servers, do teh same with the top 12 or 16 games and you could spread out the load evenly? Sorry, not a server guru, but worth throwing the idea in if it helps :0)
User avatar
akhosam
Posts: 6
Joined: 12 September 2014, 17:59

Re: Server capacity upgrade

Post by akhosam »

You people rock...thank you!
And thank you too for the explanation, always interesting to read.
demiurgsage
Posts: 229
Joined: 07 August 2015, 10:08

Re: Server capacity upgrade

Post by demiurgsage »

Congrats with update.
It seems message "Someone is typing" doesn't disappear correctly. I saw the message a long time after the end of the game, but no one actually typing.
User avatar
Jiffs
Posts: 10
Joined: 06 September 2016, 21:50

Re: Server capacity upgrade

Post by Jiffs »

Wow! Admins that educate! Kudos to you all. Real leadership is being shown which is great for continued success. Thank you for such a great site.
User avatar
sourisdudesert
Administrateur
Posts: 4630
Joined: 23 January 2010, 22:02

Re: Server capacity upgrade

Post by sourisdudesert »

CliveUK wrote: One thought, could you perhaps run certain games on specific servers?
In fact this is already what we do for the game servers.

But for the realtime component, this is not possible because even when you are playing at a table you need to be reached by certain messages (ex : emergency messages or private chat messages). So we cannot "split" the players :)
User avatar
oenxt
Posts: 15
Joined: 07 February 2016, 06:51

Re: Server capacity upgrade

Post by oenxt »

Thank you (as always!) for all the work done to make this site possible. I do have a bug to report that I think is related to the update - I am being getting "disconnected from server" messages in chat that repeat many, many times, then the same happens with "you are connected again" messages. When I try to play I can't. It isn't my internet connection, as I can use other sites. It happens whatever I try to do on BGA. Anyone else experiencing this?

Updating this - I closed site out and re-opened, and problem seems to be resolved!
User avatar
EllieK
Posts: 132
Joined: 12 June 2014, 00:21

Re: Server capacity upgrade

Post by EllieK »

You guys are awesome. Thanks for sharing!
nobLeader
Posts: 1
Joined: 25 June 2016, 08:54

Re: Server capacity upgrade

Post by nobLeader »

Fabulous! Did you use a message queue to keep the 4 real time servers in sync?
Locked

Return to “Official announcements [en]”