Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sleeping Start enhancement #21

Open
sfxworks opened this issue Nov 9, 2021 · 5 comments
Open

Sleeping Start enhancement #21

sfxworks opened this issue Nov 9, 2021 · 5 comments

Comments

@sfxworks
Copy link
Contributor

sfxworks commented Nov 9, 2021

Similar to https://github.com/vincss/mcsleepingserverstarter

Since this router is also aware of service definitions, and service definitions contain references to deployment or statefulset object via label, it would be cool if the router could pick up and hold incoming connections and automatically scale the stateful set up from 0 to 1 and 1 to 0 when it knows that there have been no active connections for some time.

@sfxworks
Copy link
Contributor Author

sfxworks commented Nov 9, 2021

Or maybe a better pattern would be to wrap that project around https://github.com/itzg/docker-minecraft-server and replace the minecraftCommand with your wrapper script? With the caviat of then requiring spigot to stop the server when no one is online. Though that would still make k8s scheduling a nightmare since one would have to keep that max memory into account.

@itzg
Copy link
Owner

itzg commented Nov 9, 2021

Yeah, I really like the idea of mc-router influencing the replica count of a server's statefulset. My only concern would be the amount of time in between and attempted connection and when the destination server would be up and ready to serve connections.

@sfxworks
Copy link
Contributor Author

To combat startup time sleeping start server just says "come back later" to the client until it's up. Also on a ceph NVMe cluster I've seen startup times as fast as 5 seconds for vanilla

@vorburger
Copy link
Contributor

I'm exploring this in master...vorburger:issue-11_autoscale-2 and much to my own huge surprise 😈 actually do seem to be making reasonable progress towards teaching mc-router this trick, to be able to "auto-scale" the replica count of a server's statefulset...

@vorburger
Copy link
Contributor

I now have a a working MVP on the branch linked above, and will that contribute it as a PR, once I've further cleaned up the code. But as was suspected above, the "user experience" is not really all that great (yet, with my initial PR) - because you at first get disconnected, and then have to manually re-connect a moment later, once the server has actually spun up and is ready to accept connections... it works, and sure beats manually having to k scale statefulset test --replicas=1 - but it would of course be much nicer if the connection was kept "hanging", until the server is ready. But rome wasn't built in one day, so let's chip away at this step by step. Perhaps someone else wants to later implement such an improvment, on top of my (upcoming) basic PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants