Ways to restart

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

Moderators: Lapo, Bax

juancarlos
Posts: 69
Joined: 21 Dec 2007, 17:19
Contact:

Ways to restart

Postby juancarlos » 10 Mar 2010, 16:10

Hello.
There is a button on Admin.swf that Restart the SFS.
On the other hand you could do ./sfs stop and ./sfs start on your commands console.
Both options restart the socket server. My question is:
Is it exactly the same thing? Is there any difference between making a restart with Admin.swf or "manually" writing ./sfs stop and start command?

On the other hand, sometimes I even reboot the whole computer and then I do ./sfs start. Is that the same as making ./sfs stop? I mean: Rebooting against ./sfs stop. Is it the same?


Maybe the question could seem not too inteligent, but the reason is that I have read that some "soft" restarts only call for methods init() and destroy(), but not "switch off/on" the application (for example making a restart from an extension). So, I have 3 kinds of restart and I'm not sure the differnces between them.

Thank you a lot.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 11 Mar 2010, 10:22

Hi,
there's only two ways for restarting:

Soft restart: via the admin tool Restart Button. This will reset the server without stopping the JVM. All connections will be closed and and all Zones will be destroyed and recreated again.

Hard restart: can be done via the Windows service admin console or via the ./sfs restart command (equivalent to ./sfs stop + ./sfs start)
This will destroy the current JVM process and start a new one.

When to use one or the other is not particularly important, unless the JVM is misbehaving or you have encountered a fatal JVM error such as an OutOfMemory error. In those cases only a Hard restart will resume the situation.

As for restating extensions during development you can configure the server to reload them automatically without having to restart SmartFox.
Or you can reload them manually from the Admin Tool

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
juancarlos
Posts: 69
Joined: 21 Dec 2007, 17:19
Contact:

Postby juancarlos » 11 Mar 2010, 12:45

Great answer! Thank you.

Sometimes I don't do "clearInterval" after some "setInterval". I make a soft restart and...
Does this restart clear all the intervals not previously closed?

Because, it seems that a soft restart doesn't clear everything.

Thank you.

Ps: I know that a well programmed code doesn't have this problem, since I can programme in the "destroy()" place, but my question is in case I don't make anything on "destroy()".
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 11 Mar 2010, 14:56

Sometimes I don't do "clearInterval" after some "setInterval". I make a soft restart and...
Does this restart clear all the intervals not previously closed?

No, the leaked setInterval will stay in memory if you don't take care of it. Make sure to shut the down when they are not needed anymore.
Lapo

--

gotoAndPlay()

...addicted to flash games
juancarlos
Posts: 69
Joined: 21 Dec 2007, 17:19
Contact:

Postby juancarlos » 11 Mar 2010, 15:09

Lapo wrote:No, the leaked setInterval will stay in memory if you don't take care of it. Make sure to shut the down when they are not needed anymore.

So, please, tell me if I'm right:
Soft Restart will not destroy the setIntervals.
But
Hard Restart will yes destroy the setIntervals.

Thank you again.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 11 Mar 2010, 16:06

Correct.
But please, do check your code and make sure that intervals are handled properly instead of restarting ;)
Lapo

--

gotoAndPlay()

...addicted to flash games
juancarlos
Posts: 69
Joined: 21 Dec 2007, 17:19
Contact:

Postby juancarlos » 11 Mar 2010, 16:16

Yes, of course, this is the desired situation. :)
But I wanted to understand each possibility, since there are always many unexpected events when managing software.

Thank you again.
juancarlos
Posts: 69
Joined: 21 Dec 2007, 17:19
Contact:

Postby juancarlos » 15 Mar 2010, 07:39

Please, allow me one more question.
I know that soft restart calls all the destroy() methods before of every extension before calling again all the init() methods.
I need to know if hard restart do it too. I mean, if I type ./sfs restart, will SFS call all the destroy() methods of every extension or will simply swith off the software and switch it on again?

Thank you again.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 16 Mar 2010, 07:37

It will simply switch on and off
Lapo

--

gotoAndPlay()

...addicted to flash games
HDcel
Posts: 13
Joined: 28 May 2021, 09:25

Re: Ways to restart

Postby HDcel » 06 Oct 2021, 12:08

How do you do this on a MAC.

Right now the server is initializing, and nothing can be don't to reset it.

I have tried to restart the sos and the server
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Ways to restart

Postby Lapo » 06 Oct 2021, 14:20

Hi,
this is an 11 year old post. Are we still talking about SFS PRO 1.x or SFS2X?

I have tried to restart the sos and the server

What is the "sos"?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
martinsaw01
Posts: 1
Joined: 25 Nov 2021, 11:04

Re: Ways to restart

Postby martinsaw01 » 25 Nov 2021, 11:06

I know that soft restart calls all the destroy() methods before of every extension before calling again all the init() methods. video streaming
Arsh_gabbi
Posts: 1
Joined: 22 Feb 2022, 12:01

Re: Ways to restart

Postby Arsh_gabbi » 22 Feb 2022, 12:02

sometimes I even reboot the whole computer and thenI doeuwatchfree ./sfs start. Is that the same as making ./sfs stop? I mean: Rebooting against ./sfs stop. Is it the same?
Last edited by Arsh_gabbi on 26 Mar 2022, 12:20, edited 2 times in total.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Ways to restart

Postby Lapo » 22 Feb 2022, 14:49

To restart SmartFoxServer you don't need to restart the whole machine.
If the server installed as a service running in your OS you can restart the service and that's it.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: Google [Bot] and 37 guests