Skip to content

Commit

Permalink
wordpress: install php-apcu for WordPress object cache
Browse files Browse the repository at this point in the history
Experimented on wp-02.stage, by installling https://wordpress.org/plugins/apc/
https://txfx.net/wordpress-plugins/apc/ into wp-content/object-cache.php
on jquery_com, api_jquery_com, api_jqueryui.com, jqueryui.com.

For an ApacheBench with 1000 requests and concurrenty 18 for a
category URL, this reduced from 90 seconds (where mariadb takes 20%
CPU) to 70 seconds (where mariadb ~2% CPU and the rest spread over
php-fpm workers).

In terms of capacity, I used wget to crawl all four sites completely
and request each HTML page once, including each of the jQuery UI API
subsites.

```
wget --follow-tags=a --domain=stage.api.jquery.com --recursive 'https://stage.api.jquery.com'
```

Afterwards, the apc.php GUI showed:

> Cached Variables  4726 (10.3 MBytes)
>
>  Free: 21.5 MBytes (67.1%)   Hits: 99619 (95.9%)
>  Used: 10.5 MBytes (32.9%)   Misses: 4284 (4.1%)

With the default php7.4-apcu settings from Debian:
> apc.enabled 1
> apc.entries_hint  4096
> apc.serializer  php
> apc.shm_segments  1
> apc.shm_size  32M
  • Loading branch information
Krinkle committed Sep 18, 2023
1 parent 21f5c52 commit 875339c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions modules/profile/manifests/wordpress/base.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class { 'php':
extensions => [
# https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions
'apcu',
'curl',
{ package => 'php-imagick' },
'intl',
Expand Down

0 comments on commit 875339c

Please sign in to comment.