Does 'gmx' clear accumulated memory?
#1

When you use the 'gmx' command to restart your server, does it clear stored memory and data? Furthermore, does 'gmx' go through the same process of manually closing samp-server process and re-opening?

Thanks for clarification.
Reply
#2

Quote:
Originally Posted by lolumadd_
View Post
When you use the 'gmx' command to restart your server, does it clear stored memory and data? Furthermore, does 'gmx' go through the same process of manually closing samp-server process and re-opening?

Thanks for clarification.
It doesn't disconnect and then reconnect the players but the variables are cleared and everything it redone like as if the server is going to run right now.

The reason is because "gmx" is meant to be used to change the gamemode and not restart the server but since most servers has only 1 gamemode, It can be used to restart the server.

but when done.. "OnPlayerDisconnect" will be called in the server to do the saving process of the players or whatever u want and then it will call the "OnPlayerConnect" on the next gamemode (Which is here the same anyways) so it will be for u like the server has completely restarted but the players didn't really disconnect.

Tl ; DR: Yes, Everything is redone.
Reply
#3

I don't have much experience with using 'gmx' because it causes a lot of client bugs and is generally too unreliable to use so you should avoid using it on that account. Now I am not sure about your question I'm not going to speculate either but I just wanted to give you my feedback on what I think of using gmx
Reply
#4

Thanks for the replies. Maybe the reasoning for my question will be more helpful towards an answer. Players have noticed lag in my server after the server has been running for a couple days 24/7. I'm pretty sure this is due to the obvious accumulation of memory and data. To fix this lag, I'm making an auto-restart script in order to refresh the server and remove excess memory which may cause lag.

Knowing the answer to this question will determine whether I can make an easy in-game restart script which simply kicks all players then SendRconCommand("gmx").

or

Creating an external bash script to manually stop and start the server process.

Thanks again.
Reply
#5

Quote:
Originally Posted by lolumadd_
View Post
Thanks for the replies. Maybe the reasoning for my question will be more helpful towards an answer. Players have noticed lag in my server after the server has been running for a couple days 24/7. I'm pretty sure this is due to the obvious accumulation of memory and data. To fix this lag, I'm making an auto-restart script in order to refresh the server and remove excess memory which may cause lag.

Knowing the answer to this question will determine whether I can make an easy in-game restart script which simply kicks all players then SendRconCommand("gmx").

or

Creating an external bash script to manually stop and start the server process.

Thanks again.
The BEST solution here is to actually fix your server.. See why does it start lagging after a period of time and try to fix it.

And its probably because of your machine.. Get an upgrade.
I mean I had an RP server that was running for weeks on a VPS and it never got any LAG with a PB of 20.
Reply
#6

Gamemode restart time
Code:
native SetModeRestartTime(Float:time);
native Float:GetModeRestartTime();
https://sampforum.blast.hk/showthread.php?tid=513499
Reply
#7

Quote:
Originally Posted by Ahmad45123
View Post
The BEST solution here is to actually fix your server.. See why does it start lagging after a period of time and try to fix it.

And its probably because of your machine.. Get an upgrade.
I mean I had an RP server that was running for weeks on a VPS and it never got any LAG with a PB of 20.
Machine isn't the issue. We are running on a decent powered dedicated server. It's most likely the script. The gamemode has been in development for > 5 years and is huge. Also we have a player base of much more than 20.

I understand that the best solution is to fix the script but its really difficult when the script has grown so large. Unless there are some debugging tools out there I'm not aware of, it seems like an almost impossible task. If a restart clears server memory, then that fix is perfectly fine.


Quote:
Originally Posted by jlalt
View Post
Gamemode restart time
Code:
native SetModeRestartTime(Float:time);
native Float:GetModeRestartTime();
https://sampforum.blast.hk/showthread.php?tid=513499
Creating a script to auto-restart the server is not an issue. Does this YSF function restart the server in any different way, or is it just executing Rcon GMX?
Reply
#8

Quote:
Originally Posted by lolumadd_
View Post
Machine isn't the issue. We are running on a decent powered dedicated server. It's most likely the script. The gamemode has been in development for > 5 years and is huge. Also we have a player base of much more than 20.

I understand that the best solution is to fix the script but its really difficult when the script has grown so large. Unless there are some debugging tools out there I'm not aware of, it seems like an almost impossible task. If a restart clears server memory, then that fix is perfectly fine.




Creating a script to auto-restart the server is not an issue. Does this YSF function restart the server in any different way, or is it just executing Rcon GMX?
i'm not sure but i think it restart by other way
Reply
#9

You can change the settings in your server control panel to start the server automatically when it get shut down..so you can shout down it by SendRconCommand("exit"); and then it starts automatically and you dont have any Problems
Reply
#10

You can use OnRconCommand to make a command that clears and saves all player information and then run the bash script using an execute function such as:
https://sampforum.blast.hk/showthread.php?tid=582117
https://sampforum.blast.hk/showthread.php?tid=100177
(The latter may need to be recompiled).

Example:
pawn Code:
public OnRconCommand(cmd[])
{
      if(strcmp(cmd, "restartserver", true) == 0) {
             SavePlayerData(.allplayers true);
             KickEx(.allplayers true);
             exec("restart.sh");
     }
 
     return 1;
}
(The same can be done for windows using .exe files).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)