Add more threads

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

Moderators: Lapo, Bax

mbgtcx
Posts: 6
Joined: 30 May 2017, 09:35

Add more threads

Postby mbgtcx » 30 May 2017, 09:39

Hi. My game using Orcale and Redis to save data.
But when I run for a while, this error show.

30 May 2017 | 14:38:46,950 | WARN | SFSWorker:Ext:61 | controllers.v290.ExtensionReqController | | com.smartfoxserver.v2.exceptions.SFSExtensionException: Extension Request refused. Sender is not a User: { Id: 2645, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168:46781 }
com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:93)
com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)


30 May 2017 | 14:39:37,626 | INFO | SFSWorker:Sys:2 | util.executor.SmartThreadPoolExecutor | | Added 16 new threads, current size is: 71
30 May 2017 | 14:39:37,631 | INFO | SFSWorker:Sys:3 | util.executor.SmartThreadPoolExecutor | | Added 16 new threads, current size is: 85
30 May 2017 | 14:39:55,172 | INFO | New I/O worker #18 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 2658, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168:43024 }
30 May 2017 | 14:39:56,036 | INFO | New I/O worker #19 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 2659, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168 } on Server port: 8888 <---> 44319
30 May 2017 | 14:40:15,181 | INFO | New I/O worker #19 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 2659, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168:44319 }
30 May 2017 | 14:40:15,221 | INFO | New I/O worker #62 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 2638, Type: WEBSOCKET, Logged: Yes, IP: 14.225.2.168:34780 }
30 May 2017 | 14:40:15,221 | INFO | SFSWorker:Sys:3 | v2.api.SFSApi | | User disconnected: { Zone: GameBai }, ( User Name: fb298174133964473, Id: 2421, Priv: 0, Sess: 14.225.2.168:34780 ) , SessionLen: 620589, Type: JavaScript
30 May 2017 | 14:40:16,253 | INFO | New I/O worker #20 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 2660, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168 } on Server port: 8888 <---> 45627
30 May 2017 | 14:40:28,128 | INFO | SFSWorker:Sys:1 | util.executor.SmartThreadPoolExecutor | | Added 16 new threads, current size is: 90
30 May 2017 | 14:40:28,132 | INFO | SFSWorker:Sys:3 | util.executor.SmartThreadPoolExecutor | | Added 16 new threads, current size is: 102
30 May 2017 | 14:40:35,190 | INFO | New I/O worker #20 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 2660, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168:45627 }
30 May 2017 | 14:40:35,947 | INFO | New I/O worker #21 | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 2661, Type: WEBSOCKET, Logged: No, IP: 14.225.2.168 } on Server port: 8888 <---> 46864


Anyone can help me check where create more threads?
Thanks
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Add more threads

Postby Lapo » 30 May 2017, 14:54

Hi,
those seems two different issues.

In the first error you have the server complaining about a client sending a request without having logged in first. This doesn't seem connected to a thread issues. Rather you need to handle correctly both SFSEvent.LOGIN and SFSEvent.LOGIN_ERROR on the client side, so that no server requests are sent if there's an error logging in or if the user is not logged it yet.

These messages:

Code: Select all

30 May 2017 | 14:40:28,128 | INFO | SFSWorker:Sys:1 | util.executor.SmartThreadPoolExecutor | | Added 16 new threads, current size is: 90

are telling you that the server is auto-resizing its thread pools to keep up with parallel long-running tasks, such as your DB calls.
This doesn't necessarily mean that you need to do anything about it.
In any case I'd recommend reading how the system works and how you can configure it here:
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 53 guests