[squid-users] Regex optimization

Amos Jeffries squid3 at treenet.co.nz
Fri Jun 17 02:43:54 UTC 2016


On 17/06/2016 10:23 a.m., Alfredo Rezinovsky wrote:
> A small quantity of big regexes performs well. The CPU load is the same as
> if there's no regex at all.
> 
> The thing I don't understand is why this specific regex matches every uri I
> throw at it in squid, but not in linux grep, or regex101.com.
> 
> The generation of the big regexes takes seconds and is done only once.

The size of this one compound regex is 8181 bytes. squid.conf has a
maximum line length of 4096 bytes.

I suggest you list the actual individual regex patterns and let Squid do
the compounding part. The current Squid do a much better job of that
than the old 2.7 etc would.

Amos



More information about the squid-users mailing list