heroku多个dyno socket.io [英] heroku multiple dyno socket.io
问题描述
我正在用Socket.io开发一个node.js应用程序,并在Heroku Dyno上部署它。 Socket.io使用RedisStore及其PUB / SUB。 Socket.io客户端与heroku中的一个dyno完美兼容。但是,当我增加一个以上的dyno(比如两个)时,socket io客户端请求不起作用。
请让我知道客户端上的任何特定配置side)是需要的,同时设置heroku以支持socket.io的多个web dyno。 解决方案
抱歉,但是heroku不支持粘性会话并且它不被Socket.io支持
粘滞负载均衡如果您打算将
连接的负载分配给不同的进程或机器,您必须确保
与特定会话ID相关联的请求连接到源自它们的进程的
。
I am developing a node.js application with Socket.io and deploying same on Heroku Dyno. Socket.io is using RedisStore with its PUB/SUB. Socket.io client works perfectly fine with one dyno in heroku. But when I increase the number of dyno to more than one (say two), socket io client request does not work.
Please let me know if any specific configuration on client side is needed while setting up heroku for multiple web dyno having socket.io support.
Sorry, but heroku doesn't support sticky session and it's not supported by Socket.io
Sticky load balancing If you plan to distribute the load of connections among different processes or machines, you have to make sure that requests associated with a particular session id connect to the process that originated them.
这篇关于heroku多个dyno socket.io的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!