How does node cluster work? Is it a share nothing architecture? Is the session guaranteed to be directed to the same worker? The docs are pretty sparse.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, they are not guaranteed to be directed to the same worker based on a session. It generally follows a round-robin pattern to load balance the connections, but this is determined by the operating system (more info in this discussion – https://groups.google.com/d/topic/nodejs/svIXu5wUXCI/discussion).
If you need to access data for a specific session I would recommend storing the data in some kind of a data store – either your database or some in-memory store for faster access (e.g. Redis).