Comments on: Load balancing and HA for multiple applications with Apache, HAProxy and keepalived https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/ Proudly uncool and out of fashion Thu, 03 Dec 2015 16:06:02 +0000 hourly 1 https://wordpress.org/?v=5.8.2 By: waldner https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/#comment-25229 Thu, 03 Dec 2015 16:06:02 +0000 http://backreference.org/?p=2408#comment-25229 In reply to guzik.

At the time of writing, HAProxy could not do HTTPS (now it can) nor caching (I think it still doesn't).
Regarding the actual balancing, HAProxy is much more flexible than Apache (at least at that time, but I think not much has changed).

]]>
By: guzik https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/#comment-25228 Thu, 19 Nov 2015 12:02:35 +0000 http://backreference.org/?p=2408#comment-25228 Why not balancing only by Apache?
Why there is Apache as frontend, not HAproxy?

]]>
By: dud225 https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/#comment-25192 Sat, 28 Mar 2015 09:18:59 +0000 http://backreference.org/?p=2408#comment-25192 In reply to waldner.

Thank you very much waldner for your explanation.

]]>
By: waldner https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/#comment-25190 Fri, 27 Mar 2015 15:26:20 +0000 http://backreference.org/?p=2408#comment-25190 In reply to dud225.

The whole "killall -0 is cheaper than pidof" thing comes directly from keepalived's sample config files. Under Linux at least, I'm not sure where that claim comes from, since a quick test shows that both commands seem to scan the whole /proc/PID/ hierarchy to look for instances of the named process. Ok, pidof seems to do a bit more of processing for each entry, for example:

stat("/proc/30016", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
open("/proc/30016/stat", O_RDONLY)      = 4
read(4, "30016 (dnsmasq) S 1 30015 30015 "..., 1024) = 330
close(4)                                = 0
open("/proc/30016/cmdline", O_RDONLY)   = 4
read(4, "dnsmasq\0", 2047)              = 8
close(4)                                = 0
readlink("/proc/30016/exe", "/usr/bin/dnsmasq", 1023) = 16

whereas killall only does:

open("/proc/30016/stat", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f0027447000
read(3, "30016 (dnsmasq) S 1 30015 30015 "..., 1024) = 330
close(3)                                = 0
munmap(0x7f0027447000, 4096)            = 0

but I guess that's implementation-dependent anyway.

Regarding keepalived vs. ucarp, AFAIK both implement something similar, but not 100% compatible, to the (according to CISCO) patent-encumbered VRRP protocol (though I have no real-word interoperability figures, and they are difficult to find on the Internet too, so that may be an indication). Of the two, ucarp (an implementation of CARP, a supposedly free alternative to VRRP) has quite a troubled history, see https://en.wikipedia.org/wiki/Common_Address_Redundancy_Protocol for some background. The shortcomings described in the page make ucarp a weaker candidate for a trouble-free HA solution, at least in my opinion, although technically it's quite sound.

]]>
By: dud225 https://backreference.org/2012/04/25/load-balancing-and-ha-for-multiple-applications-with-apache-haproxy-and-keepalived/#comment-25189 Wed, 25 Mar 2015 13:48:56 +0000 http://backreference.org/?p=2408#comment-25189 Hello

Could you explain what do you mean by "killall -0 is cheaper than pidof" ?

Also just for information do you know the difference between keepalived and ucarp ?

]]>