Welcome! Log In Create A New Profile

Advanced

least_conn breaks ip_hash?

Posted by spuniun 
least_conn breaks ip_hash?
April 11, 2013 11:57AM
Recently began migration of Apache vhosting environment behind hardware load balancers to nginx/php-fpm.
One of our applications is being load balanced between two CakePHP backends and depends on sessionid persistence. I have not moved forward with compiling the sticky module as of yet because it seemed that ip_hash would be enough to accomplish the same end results (I understand there are fairness limitations resultant from using ip_hash but that's acceptable at this time). We also had least_conn defined for most of our upstreams for no better reason necessarily than that's how our hardware LBs have always been configured:

upstream cakeapp {
ip_hash;
keepalive 16;
least_conn;
server 192.168.1.6:8705;
server 192.168.1.7:8705;
}

With this configuration, however, we found we were bouncing between backends on nearly every page load, obviously breaking the application looking for a sessionid that didn't' exist on one or the other. Removing least_conn resolves the issue but I'm just curious as to if these are supposed to be supported together (nothing in docs claims otherwise) and how fairness will be further impacted?

Or should I just use sticky?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 152
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready