3
votes

I am using nopcommerce 3.6 and here is problem with load balancing.

I have 3 machines to handling traffics and I using source ip hashing method.

Now, I want to switch from this method to round-robin method cause it's better to handle traffics but in nop 3.6, guest users cart items set by cookies and if a guest forward to another servers the cart items will remove.

For example :
A Guest A comes to site in server X and adds an item to cart. by clicking to ADD_TO_CART btn, the page will refresh and guest may forward to server Y cause the round-robin method thinks that server Y has lower traffic than server X.

Cause guest item added to cart in server X,and now he/she is in server Y, the cart will lost.

How can I manage cart and sessions here? Any solutions?

2
Does this help? stackoverflow.com/questions/1040025/… If you can keep each user on the same machine, and allow new incoming users to be "round-robin'ed", that'd solve the issue? - Brendan Green
wow it works like a charm . thank you - user6517192
@Learner, what in the answer worked like a charm? - ClosDesign
@Amir Ziyaee, did you get this figured out? - ClosDesign

2 Answers

2
votes

i solved my problem by adding same machinekey for each applications in servers so round robin is working now

0
votes

That means Nopcommerce is not designed for a web farm, it should be storing state externally. You can use Session Affinity as linked in the comment to kind of fix the issue, but you might still face it if one instance of your app goes down for any reason.