System handler number of threads.

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Mhollow
Posts: 24
Joined: 22 Feb 2012, 06:29
Location: Russia

System handler number of threads.

Postby Mhollow » 18 Mar 2015, 09:17

Hello.
Is it possible to adjust SystemHandler thread count setting in config.xml for SFS pro?
There are only <OutQueueThreads>X</OutQueueThreads> and <ExtHandlerThreads>X</ExtHandlerThreads> settings but no SystemHandlerThreads.
As far as I understand, SystemHandler is responsible in particular for user login and authorization and handleInternalEvent() is called by SystemHandler thread? Am I right?
I am talking about huuuuuge number of simultaneously authorization requests. What Thread pool does process them, SystemHandler or ExtensionHandler (in case when customLogin="true" and Extension authorization is turned on)? If it's SystemHandler, how can I increase SystemHandler threads count?

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

Re: System handler number of threads.

Postby Lapo » 18 Mar 2015, 12:37

The System Handler is responsible for dispatching events, so a login event will be executed by one of its threads.

You can use the <SysHandlerThreads> to configure a different amount of threads.
E.g:

Code: Select all

<SysHandlerThreads>8</SysHandlerThreads>


Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Mhollow
Posts: 24
Joined: 22 Feb 2012, 06:29
Location: Russia

Re: System handler number of threads.

Postby Mhollow » 18 Mar 2015, 14:12

Thanks for the reply, but please help me understand how a login event relates to thread pools.
Namely, when a <msg t='sys'><body action='login' >....</msg> packet arrives, what thread pools are responsible for processing this event?
Your previous reply states the following, "The SystemHandler is responsible for dispatching events, so a login event will be executed by one of its threads."
I interpret your statement as follows,"One Thread from the SystemHandler thread pool is called to process a login event".
Now the handleInternalEvent(InternalEventObject evt) is a method of AbstractExtension class and it must be implemented in an extension and it's called to process a login event and authorize the user.
So my question is, does it mean than yet another thread from the ExtensionHandler thread pool is used for the login event processing? In other words, am I right that in order to process a login event not one but two threads will be executed: one from the SystemHandler thread pool and another from the ExtensionHandler thread pool?

Looking forward to your reply.

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

Re: System handler number of threads.

Postby Lapo » 19 Mar 2015, 10:35

Thanks for the reply, but please help me understand how a login event relates to thread pools.
Namely, when a <msg t='sys'><body action='login' >....</msg> packet arrives, what thread pools are responsible for processing this event?

System Handler thread pool

Your previous reply states the following, "The SystemHandler is responsible for dispatching events, so a login event will be executed by one of its threads."
I interpret your statement as follows,"One Thread from the SystemHandler thread pool is called to process a login event".

Exactly.

Now the handleInternalEvent(InternalEventObject evt) is a method of AbstractExtension class and it must be implemented in an extension and it's called to process a login event and authorize the user. So my question is, does it mean than yet another thread from the ExtensionHandler thread pool is used for the login event processing? In other words, am I right that in order to process a login event not one but two threads will be executed: one from the SystemHandler thread pool and another from the ExtensionHandler thread pool?

No this is incorrect.
All handleInternalEvent calls to your Extension are invoked by a System Handler thread.

Extension Handler threads are used for custom Extension requests.

Hope it helps
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 55 guests