1

I have a setup with three VMs that are running on a core i74xx. The machines form a LAMP cluster with HAProxy doing the loadbalancing.

After running multiple load tests I found out, that throughput doubles as soon as I put the Apache Instance running on the same node as HAProxy into maintenance mode - Therefore giving HAProxy more CPU.

Now the problem is, that both HAProxy instances run in keepalived failover mode. One never knows which node runs the HAProxy.

The architecture itself looks like this:

enter image description here

I do not want to add more machines to the cluster but rather spread the services inside more efficiently.

Is there a way to automatically manage the status of Apache with HAProxy?

merlin
  • 2,093
  • 11
  • 39
  • 78
  • Does `node3` only serve as a 3rd Solr and Galera system? – GregL Aug 27 '15 at 13:21
  • Yes, as min 3 nodes are required for a cluster I had to add another machine. – merlin Aug 27 '15 at 13:25
  • 1
    Hm.. The more I think about this, more details we're going need from you about the infrastructure (HAProxy configs, VM specs, network/IPs, etc..). Even then, this might not be a good candidate for this site's format. It's pretty broad and "discussion-y". – GregL Aug 27 '15 at 13:31
  • So let's narrow it down. I think the main problem is, that one does not know if HAProxy is currently running on node1 or on node2 due to keepalived. If this would be known, then it would be easier to move some services to node3, or even better to adapt the routing. Currently I am using round robbin. – merlin Aug 27 '15 at 14:16
  • Can you update the question to reflect that refined scope? – GregL Aug 27 '15 at 14:18
  • @GregL I updated the question and images. – merlin Aug 28 '15 at 18:02

1 Answers1

0

If each node has it's own HAProxy config you have several options:

  • each haproxy can ignore local backend
  • use "weight" parameter to lower percentage of traffic that ends on local backend
dario
  • 131
  • 4