I did try it, it needs 1.6.dev1 and that version segfaults as soon as the request is made
(egnyte_server)egnyte@egnyte-laptop:~/haproxy$ ~/haproxy/sbin/haproxy -f conf/haproxy.conf -d [WARNING] 154/044207 (24974) : Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make this warning disappear. Note: setting global.maxconn to 2000. Available polling systems : epoll : pref=300, test result OK poll : pref=200, test result OK select : pref=150, test result FAILED Total: 3 (2 usable), will use epoll. Using epoll() as the polling mechanism. 00000000:haproxy_l2.accept(0005)=0009 from [192.168.56.102:50119] Segmentation fault Thanks Sachin On 6/4/15 3:45 PM, "Baptiste" <bed...@gmail.com> wrote: >Hi sachin, > >Look my conf, I turned your tcp-request content statement into >http-request. > >Baptiste > >On Thu, Jun 4, 2015 at 12:05 PM, Sachin Shetty <sshe...@egnyte.com> wrote: >> Tried it, I donĀ¹t see the table populating at all. >> >> stick-table type string size 1M expire 10m store conn_cur >> acl is_range hdr_sub(Range) bytes= >> acl is_path_throttled path_beg /public-api/v1/fs-content-download >> #tcp-request content track-sc1 base32 if is_range is_path_throttled >> http-request set-header X-track %[url] >> tcp-request content track-sc1 req.hdr(X-track) if is_range >> is_path_throttled >> http-request deny if { sc1_conn_cur gt 2 } is_range is_path_throttled >> >> (egnyte_server)egnyte@egnyte-laptop:~$ echo "show table haproxy_l2" | >> socat /tmp/haproxy.sock stdio >> # table: haproxy_l2, type: string, size:1048576, used:0 >> >> (egnyte_server)egnyte@egnyte-laptop:~$ >> >> >> >> >> >> >> On 6/3/15 8:36 PM, "Baptiste" <bed...@gmail.com> wrote: >> >>>Yes, the url sample copies whole URL as sent by the client. >>>Simply give it a try on a staging server and let us know the status. >>> >>>Baptiste >>> >>>On Wed, Jun 3, 2015 at 3:19 PM, Sachin Shetty <sshe...@egnyte.com> >>>wrote: >>>> Thanks Baptiste - Will "http-request set-header X-track %[url]" help >>>>me >>>> track URL with query parameters as well? >>>> >>>> On 6/3/15 6:36 PM, "Baptiste" <bed...@gmail.com> wrote: >>>> >>>>>On Wed, Jun 3, 2015 at 2:17 PM, Sachin Shetty <sshe...@egnyte.com> >>>>>wrote: >>>>>> Hi, >>>>>> >>>>>> I am trying to write some throttles that would limit concurrent >>>>>>connections >>>>>> for Range requests + specific urls. For example I want to allow >>>>>>only 2 >>>>>> concurrent range requests downloading a file >>>>>> /public-api/v1/fs-content-download >>>>>> >>>>>> I have a working rule: >>>>>> >>>>>> stick-table type string size 1M expire 10m store conn_cur >>>>>> tcp-request inspect-delay 5s >>>>>> acl is_range hdr_sub(Range) bytes= >>>>>> acl is_path_throttled path_beg /public-api/v1/fs-content-download >>>>>> tcp-request content track-sc1 base32 if is_range is_path_throttled >>>>>> http-request deny if { sc1_conn_cur gt 2 } is_range >>>>>>is_path_throttled >>>>>> >>>>>> Just wanted to see if there is a better way of doing this? Is this >>>>>>efficient >>>>>> enough. >>>>>> >>>>>> I need to include the query string as well in my tracker, but I >>>>>>could >>>>>>not >>>>>> figure that out. >>>>>> >>>>>> Thanks >>>>>> Sachin >>>>>> >>>>> >>>>>Hi Sachin, >>>>> >>>>>I would do it like this: >>>>> >>>>> stick-table type string size 1M expire 10m store conn_cur >>>>> tcp-request inspect-delay 5s >>>>> tcp-request accept if HTTP >>>>> acl is_range hdr_sub(Range) bytes= >>>>> acl is_path_throttled path_beg /public-api/v1/fs-content-download >>>>> http-request set-header X-track %[url] >>>>> http-request track-sc1 req.hdr(X-track) if is_range is_path_throttled >>>>> http-request deny if { sc1_conn_cur gt 2 } is_range is_path_throttled >>>>> >>>>>There might be some typo, but you get the idea. >>>>> >>>>>Baptiste >>>> >>>> >> >>