Holding server open for back end calculations

I know you can reserve servers and teleport players to them but had an idea to open a few servers to do bigger calculations without effecting gameplay.

Im not sure on how long a server could stay open for and how I would go about keeping servers open with no players for at least 15 mins at a time.

Any ideas would be appreciated thanks.

You can use Datastores. I know you can’t use game:BindToClose(callback) because the longest you can use that for is 30 seconds.

I know how to use datastores and messaging service the issue is holding servers open, holding servers open for 30 seconds at time wouldnt be any good hence the post.

Every available item on the server should be saved and moved to a data store to be loaded later. It will never be possible to keep a server online indefinitely.

Read the post. Ive got a extreme datastore script. Im trying to hold servers open. As in 1 create server, 2 use server for masses of calculations. No players joining

You can’t hold servers open, they automatically close 30 seconds after the last player leaves.

It is impossible to maintain a server running with no players, as I stated in my previous reply.

What about when i use reserve server, surely theres time alowance for players joining and loading the game before a player joins right??

I think ReserveServer just generates a JobId so when the first player teleports, the server with that JobId will open.

I guess id just have to add players to the information collected on active servers and use certain job ids with low playercount to do calculations for higher populate servers then

You could continue to save player data as usual. As well as creating your own server instance. And JobId is unique for each run, so that would be a waste of time and space. Sure, enjoy your server if it has a name. However, I remain opposed to Datastores for this type of storage.

It not for storage, I can store unlimited data and store models unions and whatever i want. Please rember to be relevant and to actually read the post.

I did it in the hopes of assisting you. I hope you understood all I said and did not misunderstand anything; hopefully you’ll be able to start a server and keep it online without any players, even though it’s impossible to keep a server online indefinitely x

Well thanks for trying anyways, was saying its not for storage its more for recreating a part of the map and then casting a few hundred rays to calculate boids without lagging out a game with players in. In other words backend calculations.