-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hi.
I'm opening this issue because when i use pm2 and use more than 2/3 instances the server throws
Error: seat reservation expired.
0|colyseus-app | at WebSocketServer.onConnection (/Users/user/Documents/GitHub/dverso/multiplayer_server/node_modules/@colyseus/ws-transport/build/WebSocketTransport.js:105:23)
0|colyseus-app | at processTicksAndRejections (node:internal/process/task_queues:96:5)
It happens casually, not everytime, but the more instances i set the more frequently it pops.
here my pm2 config
/* PM2 config file */
const os = require('os');
module.exports = {
apps : [
/**
* Colyseus processes
*/
{
name : 'colyseus-app',
script : './dist/multiplayer_server/index.js',
instances : 8,
exec_mode : 'fork',
port : 3567,
env: {
NODE_ENV: 'development',
},
},
/**
* Proxy process
*/
{
name: 'proxy',
script: './node_modules/@colyseus/proxy/bin/proxy',
instances: 1, // os.cpus().length,
exec_mode: 'fork',
env: {
PORT : 2567,
// Required options:
REDIS_URL: 'redis://127.0.0.1:6379/0',
// // SSL (optional)
// SSL_KEY: "/Users/endel/.localhost-ssl/localhost.key",
// SSL_CERT: "/Users/endel/.localhost-ssl/localhost.crt",
}
}],
};
this is my server setup code
const gameServer = new Server({
presence: new RedisPresence({
db : 0,
host : "127.0.0.1",
port : 6379,
}),
driver : new MongooseDriver(),
transport: new WebSocketTransport({
})
});
CookedApps
Metadata
Metadata
Assignees
Labels
No labels