Hi everyone!
I’m currently building up a game on fly ecosystem, and I’m just curious if the game server/machine boot times could be improved. It is around 4-6 seconds to boot up the machine instance + a second or so to boot up the game server business logic.
My game server app currently has no machines idling, since my mentality is that if no one is playing the game, I should not keep servers alive. Everything is created on the fly when user requests a game session, and has required authorization to do so. I use the following `machinesCreate` command:
await flyApi.apps.machinesCreate(
'my-app-name',
{
config: {
auto_destroy: true,
image: 'registry.fly.io/my-app-name:newest',
guest: {
cpu_kind: 'shared',
cpus: 4,
memory_mb: 1024,
},
env: {
ISLAND_ID: islandId.toString(),
PORT: '8000',
FLY_PROCESS_GROUP: 'app',
},
services: [
{
ports: [
{
port: 443,
handlers: ['tls', 'http'],
},
{
port: 80,
handlers: ['http'],
},
],
protocol: 'tcp',
internal_port: 8000,
autostart: true,
autostop: false,
},
],
metadata: {
fly_process_group: 'app',
},
},
skip_launch: false,
skip_service_registration: false,
},
{
headers: {
Authorization: `token`,
},
}
)
The ISLAND_ID variable is really important for me, since the machine does get the actual data for server creation from the database. That is basically the row id for the db table.
If you have any ideas to share with me how I could speed up stuff, I would be most grateful ![]()