RE: single or many haproxy instances

2014-07-01 Thread Justin Franks
Not sure why you would run multiple HAProxy in one node. I don't understand 
what you want to do. But...

Look into using Consul to help load balance/cluster your HAProxy instances. 
That is what we are doing. Simple and works great. Think of Consul as a Global 
load balancing service that works internally.

Consul will look at all your instances (HAProxy or whatever) and round-robin or 
weight load balance to all of them based on health checks you plug in. I don't 
know if this would solve your prob though.


*
Justin Franks
Lead Operations Engineer
SaaS, Cloud, Data Centers  Infrastructure
Lithium Technologies, Inc
225 Bush St., 15th Floor
San Francisco, CA 94104
tel: +1 415 757 3100 x3219

From: Xu (Simon) Chen xche...@gmail.com
Sent: Monday, June 30, 2014 7:38 AM
To: HAProxy
Subject: single or many haproxy instances

Hi folks,

I am writing a simple load balancer as a service to automate haproxy 
configuration while providing a simple API to users, who only need to give a 
few simple specifications of the load balancer they want.

I am trying to decide whether to run multiple haproxy instances or a single 
instance on a particular node. I currently use jinja2 template to combine all 
services into a single haproxy configuration file and run a single instance of 
haproxy. Every time, when a service spec is changed, I run check config mode, 
and only reload the config if the test passes. But I fear that a single 
incorrect service spec would prevent everyone else from updating their 
services, unless I maintain some last-known good config for every service.

Managing one haproxy instance for every service solves this problem, but I 
might end up with too many processes on a single box.

Any recommendations on which way to go? Is there a recommended max number of 
haproxy instances per node/core?

Thanks.
-Simon


How to edit backend members in realtime without HAProxy restart

2014-06-19 Thread Justin Franks
Hello,

We are using Consul, written by the same guys who wrote Vagrant. Really great 
tool. http://www.consul.io/

Consul is a service registry and discovery and DNS solution among other things.

I can create an internal name like 'some.thing.internal' which will resolve to 
a pool of nodes. So when I do a 'dig + short some.thing.internal' it will return

IPaddressA

IPaddressB

IPaddressC

etc...

Consul keeps the list of nodes related to a particular URI up to date in 
real-time. It uses health checks and so on and will round robin the traffic to 
all the nodes evenly. But I want HAProxy too.

So I want HAProxy to say, I see a URI that resolves to N number of IP 
addresses. I will add the addresses to the backend. I will keep polling the 
URI. If the address change I will update the backend.

How can I accomplish this?

What are my options?

A cron job to run 'dig + short some.thing.internal' every minute and send that 
info to HAProxy for backend members?

Unix sockets, ALCs and stick-tables?

I just want the result that I described above done in real-time so HAProxy 
restart not required. I don't care how it is accomplished.

Thanks in advance for any ideas.








*
Justin Franks
Lead Operations Engineer
SaaS, Cloud, Data Centers  Infrastructure
Lithium Technologies, Inc
225 Bush St., 15th Floor
San Francisco, CA 94104
tel: +1 415 757 3100 x3219


Redirect or forwarding behavior question

2014-06-19 Thread Justin Franks
Let's say my front end is:

something.domain01.com

I want requests that hit this HAProxy to be redirected or forwarded to:

foobar.lobster.net ... which lives inside my network.

I want to understand how HAProxy behaves.

At startup will HAProxy cache the IP of foobar.lobster.net?

Or will HAProxy lookup the name at the time the rule matches that 
redirects/forwards domain01 to lobster.net? If so how long will HAProxy cache 
the IP of lobster.net?

The net result I want is:

If request comes in to front end then HAProxy will redirect/forward to other 
domain name. Upon redirect/forward HAProxy will lookup the IP of other domain 
every time, all the time.




*
Justin Franks
Lead Operations Engineer
SaaS, Cloud, Data Centers  Infrastructure
Lithium Technologies, Inc
225 Bush St., 15th Floor
San Francisco, CA 94104
tel: +1 415 757 3100 x3219