Users being disconnected on database data exporting

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

sunny
Posts: 18
Joined: 04 Aug 2014, 04:22

Users being disconnected on database data exporting

Postby sunny » 17 Mar 2021, 09:07

Hi,

We found that the smartfox server's concurrent users count dropped significantly when we are exporting data from MySQL database.
The concurrent users count dropped from around 1500 to 750 during the database data exporting.
The max connections of the DB is 312, and there is no connections refused due to the max_connections limit in the DB's status.

We are using:
- SFS2X v2.13.0 (Amazon EC2 server)
- MySQL database (Amazon RDS server)

Why users are being disconnected during database data exporting?

Thanks in advance,
Sunny

Here is the log:

Code: Select all

17 Mar 2021 | 15:00:16,337 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: ABC }, ( User Name: 20602847, Id: 42586, Priv: 1, Sess: 60.249.199.88:57485 ) , SessionLen: 437081, Type: Unity / .Net
17 Mar 2021 | 15:00:16,337 | INFO  | SFSWorker:Sys:3 | entities.managers.SFSRoomManager |     | Room removed: { Zone: ABC }, [ SFSGame: NR1_171453377231, Id: 39598, Group: NR1, public: false, minPlayers: 2 ], Duration: 397064
17 Mar 2021 | 15:00:16,338 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: ABC }, ( User Name: 20981217, Id: 42732, Priv: 1, Sess: 180.217.46.201:10612 ) , SessionLen: 393170, Type: Unity / .Net
17 Mar 2021 | 15:00:16,338 | INFO  | SFSWorker:Sys:3 | entities.managers.SFSRoomManager |     | Room removed: { Zone: ABC }, [ SFSGame: SR1_171456061323, Id: 40105, Group: SR1, public: false, minPlayers: 2 ], Duration: 250137
17 Mar 2021 | 15:00:16,338 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: ABC }, ( User Name: 20955370, Id: 43190, Priv: 1, Sess: 223.136.43.58:26795 ) , SessionLen: 257034, Type: Unity / .Net
17 Mar 2021 | 15:00:16,338 | INFO  | SFSWorker:Sys:3 | entities.managers.SFSRoomManager |     | Room removed: { Zone: ABC }, [ SFSGame: NR1_171456344714, Id: 40195, Group: NR1, public: false, minPlayers: 2 ], Duration: 221831
17 Mar 2021 | 15:00:16,339 | INFO  | SFSWorker:Sys:3 | v2.api.SFSApi |     | User disconnected: { Zone: ABC }, ( User Name: 20557314, Id: 43310, Priv: 1, Sess: 27.147.29.110:61050 ) , SessionLen: 223173, Type: Unity / .Net
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Users being disconnected on database data exporting

Postby Lapo » 17 Mar 2021, 10:25

Hi,
it may depend on how your DB export code works and if it's keeping the server too busy.
You should monitor the SFS2X AdminTool Dashboard during this export phase and see if there's anything strange going on, such as a spike in CPU usage or in the queues traffic.

Could you also explain what you mean exactly by "data exporting"?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
sunny
Posts: 18
Joined: 04 Aug 2014, 04:22

Re: Users being disconnected on database data exporting

Postby sunny » 18 Mar 2021, 02:45

Hi,

During the export phase, the maximum CPU load in the smartfox dashboard is only around 30%.
The maximum CPU utilisation of the database server was around 40% at that time.

We don't have message queue data for that time. The queue maybe too large at that time.
Is that a large message queue can cause users being disconnected from smartfox server?

"Data exporting" is the table data export in MySQL Workbench.
It downloads the data from database as SQL files.

Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Users being disconnected on database data exporting

Postby Lapo » 18 Mar 2021, 08:56

"Data exporting" is the table data export in MySQL Workbench.
It downloads the data from database as SQL files.

So the data export is initiated from MySQL Workbench? From your original post it sounded like this exporting procedure was performed via SmartFoxServer itself, using Extension code.

We don't have message queue data for that time. The queue maybe too large at that time.
Is that a large message queue can cause users being disconnected from smartfox server?

If the database is significantly more busy during the export phase it could slow down SmartFoxServer as well, because queries will take longer times to return their result.
If this is the case then SFS2X threads will be more busy which may (or may not) result in strange behaviors from the server side. Especially if queues are getting very busy for long stretches of time.

Unfortunately we don't have enough info to know what exactly might be going on, but if you have noticed that the problem happens consistently during the database export there is probably a connection.

Can't you schedule the database export at a time when the server's traffic is at its minimum?
Also what kind of AWS instances are you using for SFS2X and the MySQL database?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
sunny
Posts: 18
Joined: 04 Aug 2014, 04:22

Re: Users being disconnected on database data exporting

Postby sunny » 19 Mar 2021, 03:21

Thanks for the reply. We will no do database data exporting anymore probably.
We will create snapshot for the database instead.

Yes, the data export is initiated from MySQL Workbench not in the smartfox server.

Our smartfox server is located in an AWS EC2 instance.
The database in located in an RDS instance, which is located in the same region as the EC2 instance.

Thanks

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 44 guests