I've enabled session affinity on Heroku via the CLI - is this enough to make sure traffic from a user hits the same process (Clustering using throng) on the correct dyno (multiple dynos)?
To be clear, I have no code to handle this. I just use socket.io as is, I don't use sticky sessions or anything . All I've done is enable session affinity.
Is this enough? How can I test it locally?
Not sure if you ever got this answered but thinking through this problem myself. Could potentially be enough, however, Socket.io calls out:
"if you are in a CORS situation (the front domain is different from the server domain) and session affinity is achieved with a cookie, you need to allow credentials:"
Given you're using the default long polling then ws connection order, I think Heroku sticky sessions should be able to route your initial long-poll request to the right dyno. The two things I am unclear on:
On number 2, it could potentially work via the long-polling API request p95 time being used to determine server load but unsure if API latency would increase due to websocket connections/workload.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.