Detecting server shut-down

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

Moderators: Lapo, Bax

JohnnyD
Posts: 128
Joined: 29 Oct 2007, 22:13

Detecting server shut-down

Postby JohnnyD » 11 Dec 2012, 15:42

We aren't using our game server outside limited testing yet, so often it isn't used for days or weeks. Then when we come to use it, we find SFS isn't running and has to be re-started. We don't deliberately stop SFS between tests, so it seems either SFS has 'crashed' or our server has done something weird in-between (we use a fair high-spec EC2 Linux instance and SFS has 512Mb RAM to play with).

Has anyone solved the issue of being notified when SFS stops, specifically on Linux, and even making it restart automatically?

As far as the server seeming to die every now and then, is that something others see or should it run for months without problems? 512Mb for a game server which does very little and has no more than 1-2 active users has to be enough to avoid running out of RAM in the JVM right?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Detecting server shut-down

Postby rjgtav » 11 Dec 2012, 16:45

Hello,
Does the server actually shut down or it is just failing at completing the login phase?
Can you show the logs when the server shuts down? Thanks
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
JohnnyD
Posts: 128
Joined: 29 Oct 2007, 22:13

Re: Detecting server shut-down

Postby JohnnyD » 11 Dec 2012, 16:52

It's shut down - we use the "./sfs status" command to verify.
I will look into logs, we seem to have request, SFS and wrapper logs - which is relevant?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Detecting server shut-down

Postby rjgtav » 11 Dec 2012, 17:07

Try searching in both. Maybe it is the VPS which is automatically shutting down the process for being idle?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
JohnnyD
Posts: 128
Joined: 29 Oct 2007, 22:13

Re: Detecting server shut-down

Postby JohnnyD » 12 Dec 2012, 14:49

Either way the original question remains - how to monitor SFS? It seems like the kind of issue most people running real games should have faced.

Anyone like to share their solutions?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: Detecting server shut-down

Postby rjgtav » 12 Dec 2012, 20:03

Well, for detecting a shut down, you could add a ShutDownHook to the JVM.
But the server isn't supposed to shut down automatically, so I suggest you to debug what the problem is.
Is there anything valuable on the logs?
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
nik0990
Posts: 76
Joined: 23 Dec 2016, 10:48
Location: India

Re: Detecting server shut-down

Postby nik0990 » 08 Feb 2017, 05:10

HI,

I am having the same issue. MY VPS sfs2x server stopped but same server at local working fine. Can you help me.

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

Re: Detecting server shut-down

Postby Lapo » 08 Feb 2017, 09:02

Do you have any errors in the logs when the server shut down?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
nik0990
Posts: 76
Joined: 23 Dec 2016, 10:48
Location: India

Re: Detecting server shut-down

Postby nik0990 » 08 Feb 2017, 11:09

NO error but my server having low memory like 512 MB and MYSQL also shut down. This may be low memory issue.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Detecting server shut-down

Postby Lapo » 08 Feb 2017, 11:23

Yes, this is expected.
Especially in a VPS environment they have a so called "process killer" that will automatically shutdown processes when memory (or cpu) is running low.

With 512MB you should still be able to run SFS2X and MySQL... unless of course there's a whole lot of other services running.
You should check what is the amount of free memory after the server has booted up and all services are running.

Take a look here:
http://www.binarytides.com/linux-comman ... ory-usage/
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 40 guests