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

seat reservation expired when using proxy with more than 3 instances randomly #30

Open
naive17 opened this issue Apr 28, 2022 · 1 comment

Comments

@naive17
Copy link

naive17 commented Apr 28, 2022

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({
  })
});

@xVanTuring
Copy link

xVanTuring commented Dec 26, 2022

Do you use matchMaker API? If you do please check out this issue on colyseus. See if it helps.

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

2 participants