Hello,
I am suffering from very crucial issue by Smartfoxserver,
I am using latest version of smartfoxserver and currently it's hosted under windows server.
When i am testing and developing with extensions it is working fine. At the interval of every 1-2 days server automatically stops working and need to restart it with command prompt. What might be the reason behind service/server stop ?
Help would be greatly appreciated.
Thank you
Smartfox Server Stopped Working
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
Hi,
the first place to look is in the log files (SFS2X/logs/smartfox.log)
Is it possible that the server is running short of memory or cpu? You should keep an eye on it via the AdminTool
Cheers
the first place to look is in the log files (SFS2X/logs/smartfox.log)
Is it possible that the server is running short of memory or cpu? You should keep an eye on it via the AdminTool
Cheers
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
I can not find any reasons in logfile, here is the attached log file after server has been stopped.
- Attachments
-
- smartfox.log.zip
- (2.43 KiB) Downloaded 441 times
Re: Smartfox Server Stopped Working
Thanks, the logs show less than 30 minutes of server activity... so there's not much I can investigate here.
You should have more log files in that folder. It would be interesting to see at least 1 cycle of activity, in other words from the boot up to the last restart.
Could you better describe what you mean by the "server stops"? Does it mean that the process auto shuts down? Or simply that the server is running but you can't connect? Even with the AdminTool?
If that's the case, are you using a database in your server side code?
If the answer is yes take a look at this -> http://smartfoxserver.com/blog/custom-l ... -database/
under the section "Handling Exceptions". It's a common issue.
Cheers
You should have more log files in that folder. It would be interesting to see at least 1 cycle of activity, in other words from the boot up to the last restart.
Could you better describe what you mean by the "server stops"? Does it mean that the process auto shuts down? Or simply that the server is running but you can't connect? Even with the AdminTool?
If that's the case, are you using a database in your server side code?
If the answer is yes take a look at this -> http://smartfoxserver.com/blog/custom-l ... -database/
under the section "Handling Exceptions". It's a common issue.
Cheers
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
Thank you very much for your prompt support,
Here i attached more detailed log of smartfoxserver.
Server stops mean process got killed at hosting server. Server stops running and i need to restart service/server.
Here i attached more detailed log of smartfoxserver.
Server stops mean process got killed at hosting server. Server stops running and i need to restart service/server.
- Attachments
-
- Smartfox Log.zip
- (97.08 KiB) Downloaded 435 times
Re: Smartfox Server Stopped Working
Okay.
So if this happens, it is very likely that a monitoring app on your server instance is causing the problem. On many VPS/cloud instances they run a "process killer" that quits processes that use too much CPU / RAM or both.
Are you monitoring the resources on your machine?
What kind of hardware is it? What OS do you use?
Thanks
p.s. = the logs don't say much. I see there are lots of restarts, even within the same hour. Not sure if they were triggered manually or not.
So if this happens, it is very likely that a monitoring app on your server instance is causing the problem. On many VPS/cloud instances they run a "process killer" that quits processes that use too much CPU / RAM or both.
Are you monitoring the resources on your machine?
What kind of hardware is it? What OS do you use?
Thanks
p.s. = the logs don't say much. I see there are lots of restarts, even within the same hour. Not sure if they were triggered manually or not.
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
No there is no monitoring app on server.
Monitoring app: Not running
OS: Ubuntu 16.04 LTS
Hardware: 1 Cpu Core, 2 GB Ram, 30 GB SSD, 2 TB Transfer
I am using 5 taskSchedulers in different java class. Out of them 1 is running at fixed rate interval (per 1 second) for timer, 1 is running at interval at 10 seconds and rest are using for delayed function/method call.
2 schedulers - sfs.getTaskScheduler().schedule (......)
3 schedulers - sfs.getTaskScheduler().scheduleAtFixedRate (.....)
I am cancelling all these when calling destroy () function like this..
Is is possible that server process kill might be happening due to these schedulers ?
Here i attached server settings. Please check it. Rest settings in Server Configurator tab are default.
Monitoring app: Not running
OS: Ubuntu 16.04 LTS
Hardware: 1 Cpu Core, 2 GB Ram, 30 GB SSD, 2 TB Transfer
I am using 5 taskSchedulers in different java class. Out of them 1 is running at fixed rate interval (per 1 second) for timer, 1 is running at interval at 10 seconds and rest are using for delayed function/method call.
2 schedulers - sfs.getTaskScheduler().schedule (......)
3 schedulers - sfs.getTaskScheduler().scheduleAtFixedRate (.....)
I am cancelling all these when calling destroy () function like this..
Code: Select all
@Override
public void destroy()
{
super.destroy();
if(playerClockHandler != null)
{
playerClockHandler.cancel(true);
};
}
Is is possible that server process kill might be happening due to these schedulers ?
Here i attached server settings. Please check it. Rest settings in Server Configurator tab are default.
- Attachments
-
- Settings.zip
- (167.73 KiB) Downloaded 444 times
Re: Smartfox Server Stopped Working
khokhani1510 wrote:No there is no monitoring app on server.
Monitoring app: Not running
OS: Ubuntu 16.04 LTS
Hardware: 1 Cpu Core, 2 GB Ram, 30 GB SSD, 2 TB Transfer
Ok, but you can monitor via the SFS AdminTool or via top/htop directly on your machine.
There can only be two main reasons for this:
1) The server process quits because of a hard crash such as low level memory error.
2) The server is shut down by another "watchdog" process that checks for apps that take too many resources.
It would be helpful to understand which of the two is this. By monitoring your server during the day (especially peak hours) you should be able to see if the machine is running low on resources.
Let us know
p.s. = settings are fine
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
Please note the Thread Count is 43 now, which was continuously increasing before. Increasing 2-5 per two seconds and reached 1500 when i was observing (continuously increasing then after). But i have reduced Server task scheduler thread pool size to 4, before it was 1000. Is higher thread pool size might causing the problem ?
Yes definitely.
Thread are expensive on memory as thread must allocate memory for the stack.
I am not sure why you would need so many threads? Are your tasks blocking for a long time? If you're not making slow calls such as DB or external web services, keep the thread count of the scheduler to 2-3. That's enough to handle 1000s of tasks.
Cheers
- Attachments
-
- Screen Shot 2017-07-14 at 10.21.03 AM.png
- (179.49 KiB) Not downloaded yet
- khokhani1510
- Posts: 17
- Joined: 06 Feb 2014, 11:08
- Location: Gujarat, India
- Contact:
Re: Smartfox Server Stopped Working
Okay, thanks.
Yes there are number of DB calls. But now let me wait and analyse server behaviour/performance with different use cases.
Thank you very much for your awesome support.
Yes there are number of DB calls. But now let me wait and analyse server behaviour/performance with different use cases.
Thank you very much for your awesome support.
Re: Smartfox Server Stopped Working
Apologies, in my previous post I hit "Edit" instead of "Quote" and I accidentally edited your post instead of quoting it.
Cheers
Cheers
Who is online
Users browsing this forum: No registered users and 42 guests