lloesche / valheim-server-docker

Valheim dedicated gameserver with automatic update, World backup, BepInEx and ValheimPlus mod support
https://hub.docker.com/r/lloesche/valheim-server
Apache License 2.0
1.95k stars 275 forks source link

Auto pause #581

Open lazerleif opened 1 year ago

lazerleif commented 1 year ago

Would be sweet if there was a Auto Pause function. Similar to itzgs minecraft docker (https://github.com/itzg/docker-minecraft-server/blob/master/README.md#autopause) dont know if it is possible but would be really nice :)

lloesche commented 1 year ago

It's been a year since I last played extensively, but doesn't the server pause the game world when no players are connected? I remember our houses being fine even after not having played for a week, but they would wither when connected.

lazerleif commented 1 year ago

Yes it does, but it still uses like 20% CPU while no one is connected if i compare to the Minecraft docker it uses like 1% while it is paused. Just want the load to go down on my server when one one is playing 😄

lloesche commented 1 year ago

That makes a lot of sense. Though I think it's something that the Valheim devs could fix better than this Docker container. I guess there's really no reason to keep simulating anything if nobody is connected. If we wanted to fix it in this container we'd have to build some sort of connection proxy that shuts down the server when nobody is connected for a while but still accepts connections like Valheim does and then starts the server back up as soon as a client tries to connect. It might even have to reverse some of the server handshaking and put the client into a hold pattern while the server is starting up.