Hi
I am trying to complile haproxy 2.1.4 from source on a CentOS 8 system.
When I use option USE_STATIC_PCRE=1, the make command fails with the following error:
In general, I would like to have a solution that is able to match PCRE in the most performing way.
But to be honest, maybe I didn’t fully understand what “static PCRE” means.
I would have thought that it relates to the “o” modifier in /matchregex/o.
But from you answer, I understand that “static” more likely relates to “statically linked/compiled”.
If the latter is the case, then I probably don’t need static pcre.
You’d probably want to use JIT then (use USE_PCRE_JIT=1 when compling haproxy). You could also take a look at PCRE2 (with JIT). I don’t know whether PCRE2 makes a performance difference though.
You’d have to benchmark your exact use-cases to know what works bests.
However I also have to say that PCRE generally performs very well, so are you sure you actually do have a performance problem with your current setup?
I don’t know what the o modifier is about, can you point me to some documentation?
Correct, that’s what USE_STATIC_PCRE is about. By installing pcre-devel you prepare your system to link dynamically against PCRE, but not statically, which is why the build fails in this case.
I am currently using lots of static strings using “path_beg” in the frontend. It would be good to simplify the config. However, I read that the general recommendation is to refrain from using regex, as it seems to be quite expensive performance-wise. So the answer to your question is “no I am not sure” because I didn’t dare to try regex in high volume traffic yet.
I have been using the /o modifier in perl like 10 years back. It seems that it has become obsolete by the time. I found some documentation here (search for “/o”): https://perldoc.perl.org/perlop.html
So my main takeway from this conversation so far is to compile with " USE_PCRE_JIT=1" instead of “USE_STATIC_PCRE=1”.