I did suggest that…

I could see a use case where OrUrl's would be useful for programs that are 
generating the config... I agree if the config is being modified manually, a 
pipe syntax in the regex is easy enough to do, and probably more efficient. 
(fewer regex calls)  However, a url like (A|B|C|D|E|F|G|H|I|J|K|L|M) where each 
letter is actually 15-20 characters sounds like a management nightmare to me.



Even if OrUrl directives were automagically translated into 
"(pat1|pat2|pat3|pat4)" by pound and compiled as one regex, it would likely be 
an improvement.

At the time it seemed like the feature was needed so I did the easiest thing, 
which was to just change the way the comparison/Boolean logic works in svc.c

If it were to compile multiple into an Or, URLMatch would have to come first, 
otherwise it wouldn’t know to composite expressions together.  And since the 
regex’s are compiled as the lines of the config are read, it would have to 
instead save strings and compile at the end block.  Not insurmountable.

But I’m still not sure of a good use case where this would be needed…  
scalability to 1000’s of URLs…  If it’s 10-20 in a block I would think the 
current code is sufficient.

Also important for the OP to realize… These are regexes… not URL’s like an 
Apache Alias directive… so “^/A” matches /Apple /Aardvark and /Amazon….  Unless 
the patterns are made more specific. (i.e. “^/Apple(/|$)” )





Joe

From: DJ Gilcrease [mailto:[email protected]]
Sent: Monday, July 01, 2013 4:43 PM
To: [email protected]
Subject: Re: [Pound Mailing List] multiple URLs configured on Pound not working

I have not looked at the implementation, but couldn't you at startup time check 
for the URLMatch Or and compile all URLs into a single regex, eg


URL "/A"
URL "/B"
URL "/C.*?/D"
URLMatch Or

In memory gets stored as

URL (?: (?:"/A")|(?:"/B")|(?:"/C.*?/D"))


On Mon, 2013-07-01 at 20:31 +0000, Joe Gooch wrote:

Why would you want to do such a thing? J



I would think with that many lines, just doing the regular expressions is going 
to cause a noticeable performance hit.  I certainly haven’t tested with more 
than 3 or 4.  But pound puts them in a linked list, so it should handle 
whatever you supply.  No limit.  But if you give 1000 URLS, every request is 
going to have to call regex_match 1000 times.



This is why Robert said creating a proper pattern is the way to go.  Then it’s 
a single regex match.  (Albeit a complicated one… I’ve never benchmarked 1000 
regex_matches vs a pattern with 1000 ors)



All my patch done is modify the Boolean behavior.



Joe







From: Qingshan Xie [mailto:[email protected]]
Sent: Monday, July 01, 2013 3:55 PM
To: Joe Gooch; '[email protected]'; 'Leo'
Subject: Re: [Pound Mailing List] multiple URLs configured on Pound not working




Thanks Joe.





how many lines of "URLMatch Or" can handle?  Can it goes to ~1000 lines or 
URLs?  I tested it with 350 lines of URLs, seems not working as expected.  
Could you clarify it?





Thanks Again, Q.Xie




________________________________
From: Joe Gooch <[email protected]<mailto:[email protected]>>
To: 'Qingshan Xie' <[email protected]<mailto:[email protected]>>; 
"'[email protected]'" <[email protected]<mailto:[email protected]>>; 'Leo' 
<[email protected]<mailto:[email protected]>>
Sent: Monday, July 1, 2013 12:00 PM
Subject: RE: [Pound Mailing List] multiple URLs configured on Pound not working




URL “/A”


URL “/B”


URLMatch Or





Joe





From: Qingshan Xie [mailto:[email protected]]
Sent: Monday, July 01, 2013 2:59 PM
To: Joe Gooch; '[email protected]'; 'Leo'
Subject: Re: [Pound Mailing List] multiple URLs configured on Pound not working





Thanks Joe for your quick reply.





I downloaded v2.7b.zip, installed it, and tried URLMatch and Or like below, but 
it keeps throwing "unknown directive".   Could you tell me what is the right 
syntax for multiple URLs with OR relation?





 Service
          URLMatch "/A"  Or
          URLMatch "/B"
          BackEnd
                Address xxx.xx.xx.xxx
                 Port    84
          End
 End


Many Thanks,


Q.Xie

________________________________
From: Joe Gooch <[email protected]<mailto:[email protected]>>
To: 'Qingshan Xie' <[email protected]<mailto:[email protected]>>; 
"'[email protected]'" <[email protected]<mailto:[email protected]>>; 'Leo' 
<[email protected]<mailto:[email protected]>>
Sent: Monday, July 1, 2013 11:25 AM
Subject: RE: [Pound Mailing List] multiple URLs configured on Pound not working





You either need to run the stage for upstream v2.7b branch here:


https://github.com/goochjj/pound/archive/stage_for_upstream/v2.7b.zip





Or apply these two patches:


https://github.com/goochjj/pound/commit/14a59cf9811ce767f438d4a6b7d7a0c20b679881.diff


https://github.com/goochjj/pound/commit/cb72327e704a0c74ae7677714134b963b197ff03.diff





Joe





From: Qingshan Xie [mailto:[email protected]]
Sent: Monday, July 01, 2013 2:12 PM
To: [email protected]<mailto:[email protected]>; Leo; Joe Gooch
Subject: Re: [Pound Mailing List] multiple URLs configured on Pound not working





Thanks Leo for your help.


I went to Joe Gooch's site at https://github.com/goochjj/pound/, but did not 
see which patch I should download for configuring URLMatch And/Or.  Could you 
help me more to get install this patch?





Joe, If you see this email, could you give me the instruction to download your 
patch, install and configure URLMatch/Or?





Thanks, Q.Xie




________________________________
From: Leo <[email protected]<mailto:[email protected]>>
To: [email protected]<mailto:[email protected]>
Sent: Monday, July 1, 2013 12:28 AM
Subject: Re: [Pound Mailing List] multiple URLs configured on Pound not working





Hello Q.Xie,

we have had this discussion several times on the list. Robert Segall has 
already explained why multiple URLs are ANDed:

"There is a reason for it: it is easy to write an OR regular expression, but 
AND expressions can be more difficult."
(http://www.apsis.ch/pound/pound_list/archive/2013/2013-05/1367581651000/index_html#1367583174000)

If you want a different behaviour take a look at Joe Gooch's Pound patches. As 
far as I know he has written a patch to use a "URLMatch" directive with 
"AND"/"OR" value ... (https://github.com/goochjj/pound/)

Hope this helps!

Leo


On 06/29/2013 12:32 AM, Qingshan Xie wrote:

I realized it, the Multiple URLs are ANDed not ORed relation in Pound.  Not 
sure why Multiple URLs are designed as AND relation not OR?  At least from my 
experience OR relation should be available in Pound in order to split traffics. 
 For example a group applications have URLs /A, /B, /C, ....., and another 
group of apps have URLs /x, /y, /z, ......., but they share the same virtual.   
it is very difficulty to manage thousands apps in a big company to use regx in 
one URL, especially this URLs may change frequently.    If Pound can handle 
multiple URLs in OR relation.  That will make this job much easier.

Thanks, Q.Xie







________________________________
From: Qingshan Xie <[email protected]><mailto:[email protected]>
To: "[email protected]"<mailto:[email protected]> 
<[email protected]><mailto:[email protected]>
Sent: Friday, June 28, 2013 11:53 AM
Subject: [Pound Mailing List] multiple URLs configured on Pound not working





Hello, expert,

    According to manual, Pound should be able to configure multiple URLs.  
However, it failed when I tried to configure two URLs as below in service 
showed as below, but it worked if I remove on URL.
......
 Service
            URL "/ccivm0"
            URL "/ccivm4"
            BackEnd
                Address xxx.xx.x.xxx
                Port    84
            End
 End


......





am I configured it wrongly?  what is the right way to configure it?





Thanks, Q.Xie
















--


[cid:[email protected]]<http://www.kanbansolutions.com/static/images/logo-mobile-large.png>

Dj Gilcrease
Principal Engineer and Code Monkey
Kanban Solutions, LLC
[email protected]<mailto:[email protected]>
646-837-5672
www.kanbansolutions.com<http://www.kanbansolutions.com/>







<<inline: image001.png>>

Reply via email to