Page 1 of 1

JoinZone extension block

Posted: 21 Dec 2012, 11:18
by king3200
I wrote a endless loop test in USER_JOIN_ZONE extension:

Code: Select all

	@Override
	public void handleServerEvent(ISFSEvent evt) throws SFSException {

                User user = (User) evt.getParameter(SFSEventParam.USER);
		Zone zone = (Zone) evt.getParameter(SFSEventParam.ZONE);
		
		trace(user + " join zone");
		if(UserUtils.isGuest(user)){
			while(true){
				
			}
		}
		trace(user + " join zone over");
}
and then logged on several users, after 4-5 users block in USER_JOIN_ZONE extension, the extension would no longer response.
if I want to do Some very time-consuming operation in USER_JOIN_ZONE extension, It will be the same... ...
How can I do? thanks and forgive my poor English...

Re: JoinZone extension block

Posted: 21 Dec 2012, 12:26
by rjgtav
Hi,
The extension stops responding because all the ExtensionsController threads are busy, running that infinite loop.
If your application/game starts experiencing issues like this, you can increase the ExtensionsController pool size by small increments at a time, around 2-3, from the ServerConfigurator Module of the AdminTool.
But if the database is the bottleneck, you can also try increasing the DBManager's Maximum # of active connections, from the Zone Configurator Module.
You should also review your code and your queries and try to optimize it the most, in order to get the best performance from the server.

Re: JoinZone extension block

Posted: 21 Dec 2012, 15:52
by Lapo
Besides the fact that an infinite loop will make the server malfunction, what would be the purpose of the test?
If you are looking into slowing down the response then just remove the loop and put a Thread.sleep(millis) instead.

Re: JoinZone extension block

Posted: 24 Dec 2012, 06:55
by king3200
rjgtav wrote:Hi,
The extension stops responding because all the ExtensionsController threads are busy, running that infinite loop.
If your application/game starts experiencing issues like this, you can increase the ExtensionsController pool size by small increments at a time, around 2-3, from the ServerConfigurator Module of the AdminTool.
But if the database is the bottleneck, you can also try increasing the DBManager's Maximum # of active connections, from the Zone Configurator Module.
You should also review your code and your queries and try to optimize it the most, in order to get the best performance from the server.
thanks for reply, get it~~ :D