Re: Several haproxy 1.3.14.1 questions

From: Willy Tarreau <w#1wt.eu>
Date: Fri, 11 Jan 2008 06:45:02 +0100


Hi Hugo,

On Fri, Jan 11, 2008 at 12:16:32AM +0000, Hugo Silva wrote:
> Aleksandar Lazic wrote:
> >http://www.die.net/musings/page_load_time/
>
> Interesting stuff, thanks for the link.
>
> I guess what I really wanted to ask though is, if I don't use
> httpclose+forceclose, what would happen to keep alive requests ?
>
> According to the documentation only the 1st request would be logged &
> processed on each connection, but since the documentation seems to
> outdated in certain parts, I wanted to make sure this is still so.

The other requests will be considered as data since no limit on the data transfer is set. For instance, in your logs, you will see that your first request took a huge amount of time and transferred a huge amount of bytes.

[...]
> I did it in a slightly different way, but end result is the same
> (confirmed working):
>
> @ the frontend:
> acl url_stats path_beg /haproxy-status
> use_backend stats if url_stats
>
> @ the backend:
> acl stats_allow src ip1/32 ip2/32 ip3/32
> block unless stats_allow

That's a better method indeed! I should even add this to the documentation, it's more logical than other examples, and I like it.

[...]
> Here's how I've done it:
>
> acl url_static path_beg /static
> acl file_static path_end .gif .png .jpg .css .js
> use_backend static if url_static or file_static
>
> I've got around the need to exclude a specific path by other means, the
> above is not exactly what I wanted, but after a few changes, it also
> works well.

If you need to exclude a path, proceed that way :

        acl url_static   path_beg         /static
        acl url_exclude  path_beg         /static/exclude
        acl file_static  path_end         .gif .png .jpg .css .js
        use_backend static if url_static !url_exclude or file_static

(by default, a logical "and" is performed after the "if"). If you need to exclude a path in which .jpg files should still be dynamic :

        acl url_static   path_beg         /static
        acl file_static  path_end         .gif .png .jpg .css .js
        acl path_exclude path_beg         /dynamic/images
        use_backend static if url_static or !path_exclude file_static

Cheers,
Willy Received on 2008/01/11 06:45

This archive was generated by hypermail 2.2.0 : 2008/01/11 07:00 CET