GameServerManagers / LinuxGSM

The command-line tool for quick, simple deployment and management of Linux dedicated game servers.
https://linuxgsm.com
MIT License
4.27k stars 816 forks source link

[monitor] Query delay on start #2119

Closed dgibbs64 closed 5 years ago

dgibbs64 commented 5 years ago

As a server admin, I would like a delay on the monitor querying the game server after starting as it takes time for the server to fully boot

Is your feature request related to a problem? Please describe. It can sometimes take a few minutes for a server that has just started to boot and be ready to receive queries.

Describe the solution you'd like Adding a lock file with the time and a variable querydelay=5 will cause the monitor to only check the binary is running and not query the server. After 5 mins the monitor will query as normal.

Frisasky commented 5 years ago

source and goldsrc based game took about just few seconds on SSD, on my old develop machine HDD it took 30 seconds at most, so 1 mins are sufficient for both engine games

joshhsoj1902 commented 5 years ago

This would be great, my only thought would be, make it seconds instead of minutes.

I'm a little rusty as it's been a while, but I believe I use this check in docker to determine if the service is healthy. The catch being docker will not route to a service that isn't healthy, so if the minimum was always 1 min, even for games that take 30 seconds to start, they would always need to wait the full 60 seconds before they could be connected to.

Not really the end of the world either way.

visdmin commented 5 years ago

The amout and type of addons with Rust server can hightly effect the boot time, so i would try to find some other method to determinate if the server startup is finnished, than stasic time / sleep varriable. If i have time next week i can try to find ways to do this with Rust server at least.

Best regards, Visdmin

royobrecht commented 5 years ago

It doesn't matter to me. 1-2 minutes. It's not like it's a critical app if players can't get on the server for a couple of minutes. In fact, I have a cron to check if it's up every 2 minutes.

I do not get any false boot-time alerts from hl2dm running LinuxGSM. The way I have it configured is to start the game server at boot in cron using the @reboot directive. Server is running Ubuntu 18.04.

sholan commented 5 years ago

We ran into the same issue with a mediumly modded MC server (taking from 1'30" to 3' to boot). We "solved" it by increasing the fn_monitor_loop queryattempt range from 1..5 to 1..13

This may give an idea of the time needed for an MC server.

After paying attention to your request on discord, I suggest this wait time to be a lgsm parameter for best performance.

mrpoundsign commented 5 years ago

Just for some clarity, I believe the purpose of the monitor command is to ensure the server is running, and automatically restart it if not.

I think a 5-10 minute window after server start should be fine for any server. After the initial server start, this check would not be needed. This means you still get immediate monitoring, it's just a cool-down period before monitoring begins after the server is started.

This is not a problem for most games, but for the ones that have a long startup time (e.g. Rust) or those running in virtual servers. Having it be configurable is fine as well, but I don't think there's a lot of benefit to automatically restarting a server if it's crashing within 10 minutes of starting; You have a deeper problem if it won't stay up for 10 minutes.

Additionally it would be fine to have it report the server is down, but not kill/restart within that initial time window. This should satisfy most of what people want.

jamiew0w commented 5 years ago

Thanks for making this Daniel, I was chatting with you a few days ago and this came up as a QOL improvement.

Currently I'm running a bunch of stuff via VM's and things like Rust can take minutes to boot up, especially if you're generating a new wipe on a large map.

I think a good way of doing it may be having a new function within the instance settings called 'nokillboot' or 'slowboot' or something with a seconds value. If the setting isn't there then it works as normal. Not sure how hard it would be to implement, I bypassed it the same way as @sholan above but then I updated LGSM lately and overwrote it lol.

Thanks as always for your work on this!

dgibbs64 commented 5 years ago

@jamiew0w there will be a new setting available called querydelay. Each server will have a minimum of 1 min delay however heavier servers will default to 5 mins

dgibbs64 commented 5 years ago

@joshhsoj1902 im going for minutes for simplicity to the end user. Should the binary file check fail monitor will still fail anyway after 1 min should it still fail then a reboot will happen.

dgibbs64 commented 5 years ago

@Vis25 I tend to prefer game server agnostic solutions first. However, if there is a way to detect the server is ready by say looking for a line in logs that confirm the server is online that would be a great help and support for more servers could be added over time. A max timer would still be needed to prevent the a server crash looping issue going undetected but maybe could make it something like 10 mins.

dgibbs64 commented 5 years ago

@sholan I will put Minecraft on a 5 min delay

Grimston commented 5 years ago

For rust if it's not modded I would go with 10 minutes. If we can check if oxide was installed then bump up to 15 minutes just to be safe.

For an expected log line it would be "BradleyAPC Spawned at" as this always happens when it's finished loading.

JediNarwals commented 5 years ago

Arma 3 typically takes 30-45 seconds to come online with a good server with no mods. A 2 to 5 minute delay would be the average for mid to low end servers and modded servers.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.