What Powers Instagram: Hundreds of Instances, Dozens of Technologies

87 views
Skip to first unread message

Mathias Bogaert

unread,
Dec 2, 2011, 6:03:19 PM12/2/11
to South West Big Data

Paul Harwood

unread,
Dec 3, 2011, 2:15:16 PM12/3/11
to south-wes...@googlegroups.com
"Recently, we moved to using Amazon’s Elastic Load Balancer, with 3
NGINX instances behind it that can be swapped in and out (and are
automatically taken out of rotation if they fail a health check)."

For a cheap and dirty uptime setup, I personally use Haproxy on 2x
Ubuntu 11.04 boxes in front of as many nginx instances as you need,
the configuration is pretty straightforward and failovers can be
handled easily with heartbeat and health checks.

Has anyone used the Elastic load balancer?

Dan Fairs

unread,
Dec 3, 2011, 2:51:25 PM12/3/11
to south-wes...@googlegroups.com
> ="Recently, we moved to using Amazon’s Elastic Load Balancer, with 3 NGINX instances behind it that can be swapped in and out (and are automatically taken out of rotation if they fail a health check)."

>
> For a cheap and dirty uptime setup, I personally use Haproxy on 2x Ubuntu 11.04 boxes in front of as many nginx instances as you need, the configuration is pretty straightforward and failovers can be handled easily with heartbeat and health checks.
>
> Has anyone used the Elastic load balancer?
>
>

Yes. They're very simple - and hence pretty restrictive. iirc, a server can be in a load balance pool only once. This means that you can't run (say) 4 instances of a server process on a single machine on different ports, and load balance between them - Amazon expects you to run 1 instance of a server process on the same port on 4 machines, and load balance between the machines. You also didn't seem to be able to run Micro instances behind them - they didn't show up in the list of instances to add (though I didn't see that documented anywhere so maybe it was a bug or PEBKAC).

They were also difficult to reconfigure once they'd been set up - you could add or remove instances from the load balance pool, and change the health check parameters, but you couldn't (for example) change the load balance port mapping.

Finally they didn't seem to be compatible with websockets - our socket.io app always fell back to long polling when used through an ELB. Websockets worked fine when we talked to an EC2 instance directly.

They are cheap, though, cheaper than running an instance specifically for HAProxy - so if you're not using Micro instances and can live with the restrictions above, then they're worth looking at.

Cheers,
Dan
--
Dan Fairs | dan....@gmail.com | www.fezconsulting.com


Paul Harwood

unread,
Dec 3, 2011, 6:54:26 PM12/3/11
to south-wes...@googlegroups.com

On 3 Dec 2011, at 19:51, Dan Fairs wrote:

>> ="Recently, we moved to using Amazon’s Elastic Load Balancer, with
>> 3 NGINX instances behind it that can be swapped in and out (and are
>> automatically taken out of rotation if they fail a health check)."
>>
>> For a cheap and dirty uptime setup, I personally use Haproxy on 2x
>> Ubuntu 11.04 boxes in front of as many nginx instances as you need,
>> the configuration is pretty straightforward and failovers can be
>> handled easily with heartbeat and health checks.
>>
>> Has anyone used the Elastic load balancer?
>>
>>
>

>


> They were also difficult to reconfigure once they'd been set up -
> you could add or remove instances from the load balance pool, and
> change the health check parameters, but you couldn't (for example)
> change the load balance port mapping.

But you can specify custom port mappings I guess?

>
> Finally they didn't seem to be compatible with websockets - our
> socket.io app always fell back to long polling when used through an
> ELB. Websockets worked fine when we talked to an EC2 instance
> directly.

Maybe they aren't set up to recognise the WebSockets handshake.

>
> They are cheap, though, cheaper than running an instance
> specifically for HAProxy - so if you're not using Micro instances
> and can live with the restrictions above, then they're worth looking
> at.
>

Just out of interest do you know how the costs compare?

-- Paul

Reply all
Reply to author
Forward
0 new messages