On Thu, Apr 04, 2013 at 01:44:16PM +0200, Nerilaunt Nerilaunt wrote:
> Hello,
> 
> 2013/4/3 Willy Tarreau <[email protected]>
> 
> > Maybe what you want to do could already be achieved using stick-tables, as
> > it is already possible to add/update/remove some stick-table entries from
> > the CLI.
> >
> > Do you need many ACLs or many entries per ACL ? The difference is the
> > number
> > of different actions you want to do. If it's just selecting a server or
> > another one depending on the URI, it should be almost trivial.
> >
> 
> We have a lot of lines like that :
> 
> use_backend BACK1 if { path -i /user/path/file1.txt }
> use_backend BACK2 if { path -i /user/path/file2.txt }
> use_backend BACK1 if { path -i /user/path/file3.txt }
> use_backend BACK1 if { path -i /user/path/file4.txt }
> use_backend BACK2 if { path -i /user/path/file5.txt }

OK so those are not thousands of ACLs but thousands of rules right now.

A few points :
  - it should be much faster to have one file per backend :

    use_backend BACK1 if { path -i -f /etc/haproxy/path-back1.txt }
    use_backend BACK2 if { path -i -f /etc/haproxy/path-back2.txt }

  - it should be even faster to get rid of -i if possible, so that
    entries can be loaded into trees.

For this last point I have a solution which I did not finish before dev18 :
Supporting the sample converters in ACLs. It would then work like this :

    use_backend BACK1 if { path -c tolower -f /etc/haproxy/path-back1.txt }
    use_backend BACK2 if { path -c tolower -f /etc/haproxy/path-back2.txt }

> We'd like to update this very often, this is why I thought of a memcached (or
> something similar) storage ...

Relying on an external storage would be terribly expensive in terms of
latency, we don't want to do that. Really, I'd rather finish implementing
pattern manipulation from the CLI. It was started then stopped because of
issues with typing. I'm sure there is not much work to complete it.

Regards,
Willy


Reply via email to