Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: PCRE2 JIT disabled in VS18 Win64 |
|
| Author |
|
alex-mmx
Joined: 11 Nov 2026 Posts: 1 Location: Tbilisi
|
Posted: Wed 11 Nov '26 19:44 Post subject: PCRE2 JIT disabled in VS18 Win64 |
|
|
Hello,
We investigated high httpd.exe CPU usage with Apache Lounge VS18 Win64, ModSecurity 2.9.15 and OWASP CRS 4.25.2 (PL1/anomaly scoring).
Distribution
We use the official httpd-2.4.70-261106-Win64-VS18.zip distribution downloaded from Apache Lounge.
Querying pcre2_config_8 from this DLL succeeds and reports:
| Code: |
PCRE2_CONFIG_VERSION = "10.49 2026-09-28"
PCRE2_CONFIG_JIT = 0
|
The first affected release is unknown. This confirms the setting in the checked 2.4.70 package; earlier builds may also be affected.
Findings and workaround
ETW sampling showed heavy contention in this path:
| Code: |
ModSecurity -> PCRE2 -> malloc/free -> Windows heap
-> RtlpEnterCriticalSectionContended
|
About 56% of httpd.exe CPU samples were directly in RtlpEnterCriticalSectionContended.
We rebuilt the same PCRE2 version with JIT enabled and explicit Release optimization, preserving the queried settings and all 79 exports. The application issue was resolved with ModSecurity and CRS unchanged. Upstream PCRE2 tests and basic Apache/ModSecurity smoke tests passed.
A follow-up ETL confirmed calls to pcre2_jit_match_8 and showed no samples in the previous contention path. These were separate ordinary-traffic captures, not a controlled benchmark. Our replacement also used Zig/Clang rather than MSVC, so we do not attribute every difference solely to the JIT flag.
Request
We would prefer to use the official Apache Lounge packages without having to rebuild and replace pcre2-8.dll after each update. Could you include JIT-enabled PCRE2 in future official VS18 Win64 builds, retaining the optimized Release configuration and existing compatibility settings?
| Code: |
-DPCRE2_SUPPORT_JIT=ON
|
A packaging check could load the DLL from the final ZIP and require a successful PCRE2_CONFIG_JIT query with jit == 1.
If disabling JIT is intentional, could you explain the reason and consider a supported JIT-enabled variant?
References:
PCRE2 configuration queries
PCRE2 CMake options
ModSecurity PCRE2 wrapper |
|
| Back to top |
|
|
|
|
|
|