Logs not getting printed for 12 seconds

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

Moderators: Lapo, Bax

pratts
Posts: 34
Joined: 23 Aug 2016, 17:46

Logs not getting printed for 12 seconds

Postby pratts » 20 Apr 2019, 17:18

Hello,

We have recently updated to Smartfox 2.13.4 on a centos 6 machine.
Yesterday, we faced a situation where the extension code on our server did not write any logs for approx. 12 seconds on any of the log files. As if the server had stopped responding for those 12 seconds. This caused a huge accumulation of user requests and hence it impacted our servers.
We are using slf4j logging library provided in smartfox server libs.

We even checked for any system/device failure but did not find anything concerning.

Any help would be greatly appreciated.

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

Re: Logs not getting printed for 12 seconds

Postby Lapo » 21 Apr 2019, 08:16

Hi,
if the requests accumulate in the Extension's queue, you will experience delays in user response times and also in things like logs etc...
When this happens you should look into your code and check what slow operations you're running. By slow operations we mean any calls that wait for something to complete, such as I/O either via remote HTTP calls, database queries, webservices etc...

Essentially it seems like you're holding the Extension threads for too long and causing a bottleneck.
There are two main ways to deal with this:
1) Throw more threads to the problem, so that even more slow requests can be handled simultaneously.
2) Optimize those slow requests to avoid holding threads for too long.

You should probably start with #2: investigate these calls, how long they take on average and see if you can improve them.
Then you can also reconfigure the server thread pools to spawn more threads. Keep in mind that running hundreds of them can be performance intensive, depending on the type of hardware you're using. By default SFS2X runs 40-50 threads and you can usually push the thread count to 3-400 without problem on any entry-level to midrange server. More than that you should start asking yourself if you're doing the best you can to avoid slow I/O.

This article explains how thread pools work in SFS2X:
http://docs2x.smartfoxserver.com/Extens ... d-concepts

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 55 guests