Re: about Haproxy's consistent hash on image application

From: Willy Tarreau <w#1wt.eu>
Date: Tue, 23 Mar 2010 11:28:42 +0100


Hello,

On Tue, Mar 23, 2010 at 06:10:12PM +0800, ?????? wrote:
> I'm sorry for losing my mail subject and thanks for your very detail
> solution description.
>
> Our appliction service a small image that about 10k-200k. All cache
> servers share nothing and image data come from "backend image bridge
> server". The bridge server read image from storage. We design a main URL
> for a image, such as "/img/photo.jpg", in order to reduce storage disk, all
> scaled images was generated dynermic by backend image bridge server. The
> scaled image marked as in url : "/img/photo.300x300.jpg", or
> "/img/photo.200x200.jpg". So if an image cache server is down at peak time,
> backend image bridge server would scale image heavy loading. As you
> said---"buddy server"----is very important for us, it is a reliable
> design---forward "down server" requests to related backup server.

OK I see.

> Consistent Hash is also important for us if we add image cache server,and
> we can deploy it at deep night(it can protect "backend image bridge
> server").

Use the "slowstart" server option then. It slowly increases a server weight over the period. It can ensure that your caches will not receive full traffic at the beginning. This works particularly well with consistent hashing.

> Now We have more than 20 image cache nodes, as you said, we need set
> up "listen pool1-> listen pool30 ", "start up 30 ports" and "too many local
> loopback data transfer" will reduce much performance?

A 2 Gbps, copying data twice can start to have a measurable impact on the CPU usage, though it should not be critical depending on the machine's sizing. The number of requests per second also counts. Doing 2 Gbps at 10000 hits/s is doable, but at 20000 it's becoming harder.

> Now our network need
> 2Gb bandwidth for image acess. If " local loopback" reduce performance, we
> can configure TCP SPLICE for " local loopback" only?

You can but if you enable tcp splicing, you'd better enable it everywhere. What you need is :

      make TARGET=linux26 USE_LINUX_SPLICE=1

Then you have to add "option splice-response" in your frontends and backends.

Regards,
Willy Received on 2010/03/23 11:28

This archive was generated by hypermail 2.2.0 : 2010/03/23 11:30 CET