You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The MySQL IO value tracked by MySQL Governor is the **combined total of read and write operations**. For example, if a user's LVE IO limit is 100 MB/s, the corresponding MySQL IO total is 200 MB/s (100 MB/s read + 100 MB/s write).
3680
+
:::
3681
+
3682
+
In the MySQL Governor configuration (`/etc/container/mysql-governor.xml`), the `read` and `write` limits are specified separately. The coefficients above are applied to each limit individually.
3654
3683
3655
3684
**Example of choosing MySQL Governor limits**
3656
3685
3657
-
* With the default LVE SPEED limit of `100`, the corresponding MySQL Governor CPU limits are `101/95/87/75` (applying the coefficients above). We admit the short-term exceeding of the limits for processing SQL requests.
3686
+
* With the default LVE SPEED limit of `100`, the corresponding MySQL Governor CPU limits are `100/95/87/75` (applying the coefficients above). We admit the short-term exceeding of the limits for processing SQL requests.
3658
3687
* If you face spike CPU consumption with these limits, it is recommended to reduce the excess of the `current` and `short` limits over the LVE limit. For example, to the values 150/110/100/90.
3659
3688
* If the average level of CPU consumption is too high, then it is recommended to reduce the `middle` and `long` limits, too. For example, to the values 150/100/80/50.
3660
3689
* Then MySQL processes will fall into LVE and be limited by LVE limits more often.
3661
3690
* The same clues are applicable to the IO limits – the `current` and `short` IO limits for MySQL Governor can exceed IO LVE limits, but the `middle` and `long` cannot.
3662
3691
3692
+
**Configuration example**
3693
+
3694
+
For a user with a 400% (CPU) SPEED MySQL limit and a 200 MB/s MySQL IO limit, the MySQL Governor limits would be configured as follows:
This design eliminates per-request regex compilation in `.htaccess`, resulting in significantly faster cache delivery. The module is fully compatible with AccelerateWP's cache directory layout and can be used by any caching plugin that follows similar conventions.
1293
1293
1294
-
AccelerateWP uses this module to serve the correct static page without invoking PHP or writing complex RewriteRule-based configurations. This document summarizes the module's directives and describes how any page cache plugin can integrate with the same capabilities.
1294
+
AccelerateWP uses this module to serve the correct static page without invoking PHP or writing complex RewriteRule-based configurations. This document summarizes the module's directives and describes how any page cache plugin can integrate with the same capabilities.
1295
+
1296
+
The module includes two independent subsystems: **cache serving** (serves pre-generated static HTML files, bypassing PHP) and **full .htaccess caching** (caches parsed `.htaccess` files in shared memory, eliminating per-request disk I/O). Both are included in the same `ea-apache24-mod_maxcache` package and can be enabled independently.
1295
1297
1296
1298
:::warning Note:
1297
1299
MAx Cache is currently supported on cPanel control panels only.
@@ -1302,12 +1304,20 @@ MAx Cache is currently supported on cPanel control panels only.
| `libmaxcache` | Shared C library for device detection, WebP, cookie/QS handling |
1318
+
1319
+
After installation, the full .htaccess caching subsystem is enabled by default (`MaxCacheHTCache On`) and the `maxcache-htcache-watchd` daemon is automatically started and enabled on boot.
1320
+
1311
1321
### MAx Cache Activation Guide
1312
1322
1313
1323
Use the following commands to manage MAx Cache on your server via the cloudlinux-awp-admin tool.
@@ -1888,6 +1898,219 @@ MAx Cache will not work in AccelerateWP when:
1888
1898
* Using the AccelerateWP PHP filter to replace dots with underscores.
1889
1899
* Using the AccelerateWP PHP filter forces the full path to cache files instead of using DOCUMENT_ROOT.
1890
1900
1901
+
### Full .htaccess caching
1902
+
1903
+
Full .htaccess caching is the second subsystem of `mod_maxcache`. It caches parsed `.htaccess` files in shared memory, so Apache does not re-read and re-parse them from disk on every request. On shared-hosting servers with thousands of sites, this eliminates thousands of `stat()` and `open()` syscalls per second.
1904
+
1905
+
Full .htaccess caching benefits **all** `.htaccess`-heavy sites regardless of whether MAx Cache page caching is enabled.
1906
+
1907
+
#### How it works
1908
+
1909
+
By default, Apache re-reads and re-parses `.htaccess` files from disk on every request. On shared-hosting servers with thousands of sites, this creates significant disk I/O overhead. Full .htaccess caching parses each `.htaccess` once (on first request) and stores the result in shared memory so all Apache workers can reuse it without touching the disk again. The cache populates lazily as traffic arrives.
1910
+
1911
+
#### Change detection
1912
+
1913
+
Full .htaccess caching detects `.htaccess` changes through two mechanisms:
1914
+
1915
+
| Mode | Detection latency | When active |
1916
+
| --- | --- | --- |
1917
+
| **watchd (real-time)** | Sub-second | When `maxcache-htcache-watchd` service is running |
1918
+
| **Polling (fallback)** | Up to `MaxCacheHTCacheRevalidateInterval` seconds (default 60) | Always active as a safety net |
1919
+
1920
+
When the `maxcache-htcache-watchd` daemon is running, it monitors the filesystem and signals Apache through shared memory whenever a `.htaccess` file is created, modified, or deleted.
1921
+
1922
+
:::warning CloudLinux 7/8 limitations
1923
+
On CloudLinux 7 and 8, the kernel's `fanotify` interface only supports file write events. This means the watchd daemon detects `.htaccess` **modifications** instantly, but **deletes**, **renames**, and **moves** are not detected in real time — they rely on the polling fallback (`MaxCacheHTCacheRevalidateInterval`, default 60 seconds). If you need faster detection of these operations on CL7/CL8, lower the revalidation interval (e.g. `MaxCacheHTCacheRevalidateInterval 10`).
1924
+
1925
+
On CloudLinux 9+ (kernel 5.14+), all change types — including deletes, renames, and moves — are detected in real time.
1926
+
:::
1927
+
1928
+
#### Configuration directives
1929
+
1930
+
All full .htaccess caching directives go inside `<IfModule mod_maxcache.c>` in the Apache configuration. Full .htaccess caching is configured in `/etc/apache2/conf.d/maxcache_htcache.conf`.
1931
+
1932
+
#### MaxCacheHTCache
1933
+
1934
+
* **Syntax**: `MaxCacheHTCache On|Off`
1935
+
* **Default**: On (in shipped config)
1936
+
* **Context**: server config, virtual host
1937
+
* **Description**: Master enable/disable switch for the full .htaccess caching subsystem.
* **Description**: Polling interval for `mtime` checks when the watchd daemon is not running or for event types not detected by `fanotify` on the current platform. Lower values mean faster detection of changes via polling; higher values reduce `stat()` syscalls.
1946
+
1947
+
#### MaxCacheHTCacheEntries
1948
+
1949
+
* **Syntax**: `MaxCacheHTCacheEntries <count>`
1950
+
* **Default**: 50000
1951
+
* **Range**: 10–500000
1952
+
* **Context**: server config, virtual host
1953
+
* **Description**: Maximum number of cached `.htaccess` entries in shared memory. When this limit is reached, new directories fall back to Apache's standard processing.
1954
+
1955
+
#### MaxCacheHTCacheMemorySize
1956
+
1957
+
* **Syntax**: `MaxCacheHTCacheMemorySize <MB>`
1958
+
* **Default**: auto (derived from `MaxCacheHTCacheEntries`)
1959
+
* **Range**: 1–4096
1960
+
* **Context**: server config, virtual host
1961
+
* **Description**: Shared memory arena size in megabytes. Normally sized automatically — only set this if you see `htcache: arena memory exhausted` in the error log.
* **Description**: Exclude directory trees from full .htaccess caching. The path is matched as a prefix.
1969
+
* **Example**:
1970
+
```
1971
+
MaxCacheHTCacheExclude /home/staging /tmp
1972
+
```
1973
+
1974
+
#### MaxCacheHTCacheMaxFileSize
1975
+
1976
+
* **Syntax**: `MaxCacheHTCacheMaxFileSize <KB>`
1977
+
* **Default**: 256
1978
+
* **Range**: 0–10240
1979
+
* **Context**: server config, virtual host
1980
+
* **Description**: Maximum `.htaccess` file size (in KB) that full .htaccess caching will process. Files exceeding this limit are skipped and served via Apache's standard processing. Set to `0` for unlimited.
* **Description**: Maximum cached entries under a single document root. Prevents one user from monopolizing the shared cache on multi-tenant servers. Set to `0` for unlimited (the global `MaxCacheHTCacheEntries` limit still applies).
1989
+
1990
+
#### Configuration examples
1991
+
1992
+
##### Minimal setup
1993
+
1994
+
```
1995
+
MaxCacheHTCache On
1996
+
```
1997
+
1998
+
Enables full .htaccess caching globally with default settings (50,000 max entries, 60-second revalidation).
| Log: `htcache: entry limit reached (50000/50000), skipping /path` | Cache is full — increase `MaxCacheHTCacheEntries` | Remaining directories use standard Apache processing |
2109
+
| Log: `htcache: per-docroot entry limit reached (256/256) for /home/user` | Single user filled their quota — increase `MaxCacheHTCacheMaxEntriesPerDocroot` | Other users are not affected |
2110
+
| Log: `htcache: arena memory exhausted (400MB/400MB)` | Shared memory arena is full — increase `MaxCacheHTCacheMemorySize` | Restart Apache after changing |
2111
+
2112
+
If changes must take effect immediately, restart Apache: `systemctl restart httpd`.
0 commit comments