Skip to content

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

WordPress Cache Benchmarks

Benchmarks for object cache plugins. For plugins that have other options like page caches and acceleration, those are disabled in the benchmarks. We benchmark only the plugin with its object cache.

Running Benchmarks

Running the benchmarks requires installing Nix. You can enter a development shell via nix develop, or automatically using direnv.

You should run the benchmarks in a disposable Linux VM with no access to secrets.

After starting a development shell, you can run the default benchmarks via just bench. This runs a series of 5000 random requests using each plugin and each backend that that plugin supports.

You can run specific benchmarks via just bench -c <name>. See finefile --help for a full list of options.

Benchmark setups

  • just bench: 5000 requests to a default WordPress install
  • just bench-posts: 5000 requests to a WordPress install with 1000 posts added
  • just bench-products: 5000 requests to a WooCommerce install with 1000 products added

Checking Cache Correctness

just check-caches runs correctness checks against each benchmark setup and each released version of SnapCache, then summarizes the results. just check-cache <name> checks one setup, and just check-cache-results summarizes the results so far, failing if any check found an error.

The checks in src/cache-checks.php call the object cache API directly over HTTP. Each step of a check runs in its own request, so that checks can verify what was persisted between requests. Some checks run random operations and compare the results against a model of WordPress core's object cache. Results are written to cache-checks/.

Running Dev Environment

You can start a development server with the same setup as a benchmark by running just dev <name>. WordPress will be available at http://locahost:8888/wp-admin/

Editing Benchmarks

Benchmarks are defined in finefile.toml.

Other benchmark setups are based finefile.toml, but they override values in finefile-posts.toml and finefile-products.toml.

Benchmarks

See benchmark setups for server configuration options.

The available benchmarks are:

WordPress's built-in object cache:

  • no-cache-plugins

LiteSpeed Cache, an all-in-one acceleration and caching plugin. The page cache is disabled so that we test only the object cache:

  • litespeed-memcached configured with memcached backend
  • litespeed-redis configured with redis backend

Redis Cache:

  • redis-cache

SnapCache:

  • snapcache-memcached configured with memcached backend

SQLite Object Cache:

  • sqlite-object-cache default configuration without APCu cache
  • sqlite-object-cache-apcu with APCu cache

WP Redis:

  • wp-redis

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages