Skip to content

Instantly share code, notes, and snippets.

@qiulang
Last active June 4, 2018 06:56
Show Gist options
  • Save qiulang/db25eb782f5627fd06bb9556ffaa6626 to your computer and use it in GitHub Desktop.
Save qiulang/db25eb782f5627fd06bb9556ffaa6626 to your computer and use it in GitHub Desktop.
pm2 cluster mode and socket.io

如何让pm2集群设置和socket.io 配合工作不是一件简单的事。 在SO提了这个这个问题没有答复,但我自己总结些东西。简单的说就是要么强制使用websocket要么不要用sticky session.

阿里云的负载均衡器还需配置会话保持

但因为我们使用了websocket,所以容器编排没有配置stick session

我们通过https://testable.io/ 做了socket.io的压力测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment