One WordPress site per AI agent: native sites or Docker?

Dave Hilditch •

When you have two or three AI agents working on WordPress plugins at the same time, they need a WordPress each. Share one and a half-saved file from one agent is a fatal error for all of them, and each goes off to debug a problem it didn’t cause. Their test data collides too.

The usual answer is Docker: a docker-compose.yml with a WordPress container and a database container, and one copy of that per agent. It works, and I used it for a while before moving away from it. My agents now use native sites: one nginx, one PHP-FPM and one MariaDB already running on the machine, with each site being a directory and a database. The skill that sets them up is free on GitHub as parallel-dev (superspeedyplugins/skills).

This is how the two compare on the same machine, and when I’d still use Docker.

How native sites work

nginx has one wildcard server block. It takes the document root from the hostname, so http://tests.my-plugin.localhost:8081/ is served from /var/www/sites/my-plugin/tests/. Creating a site is: copy a pristine WordPress core into a new directory, create a database and a database user that can only see it, write wp-config.php, run wp core install, and symlink your plugin in from its repository. No server config changes and no reload. *.localhost resolves to your own machine without editing /etc/hosts.

Every site shares the same three servers. An idle site costs nothing but disk: no process waits for it.

The test

On my dev box, in the same session: create N WordPress sites at the same time, wait until every one has a finished install and returns its home page, then measure memory with the sites idle and after five requests to each.

  • Native: the parallel-dev skill’s own scripts.
  • Docker: the official wordpress:php8.4-apache and mariadb:11 images, one WordPress and one database container per site, installed with the official wordpress:cli image. Images were already downloaded, so download time isn’t counted.

The machine is my everyday dev box: an AMD Ryzen 9 5900X (12 cores, about 40 GB of RAM given to WSL2), Ubuntu 24.04 under WSL2, with other work running at the same time. Docker Engine runs inside WSL2 itself, so there’s no extra virtual machine in the way. On a Mac, Docker runs its containers inside a Linux virtual machine, and that machine’s memory comes on top of the figures below. Treat the numbers as a comparison on one machine, not as how fast either is in general.

The results

Time until every site has finished installing and returns its home page:

Sites at onceNativeDocker
11.4 to 2.2 s9.9 s
105.4 to 6.2 s24.3 s
208.6 to 8.9 s42.0 s

Native ran twice and the table shows both; Docker ran once. Native was between four and seven times quicker at every size. Once they were up, request speed was close: with 10 and 20 sites, the burst of five requests per site finished in about the same time either way, and with one site Docker answered its five requests faster (0.06 s against about 0.2 s).

Memory is where they really differ. Each Docker site is two containers, a web server with PHP and a database server, and they stay running whether you’re using the site or not:

Sites at onceDocker memory, idleDocker memory, after 5 requests each
1171 MB186 MB
101,691 MB1,852 MB
203,360 MB3,683 MB

That’s about 170 MB per site, growing in a straight line.

Native sites don’t add processes. Twenty sites use the same MariaDB, nginx and PHP-FPM as one. What grows is the PHP-FPM pool, and it grows with the number of requests arriving at the same moment, not the number of sites; it stops at the pool’s limit (20 workers in the skill’s config) however many sites exist. I’m not quoting a native megabyte figure, because the shared MariaDB on this box also holds my main dev site and every other test site, and the number moved by hundreds of megabytes between runs for reasons that had nothing to do with the test.

How many can you run?

At about 170 MB each, every six idle Docker sites cost you a gigabyte of RAM, before your editor, your browser and the agents themselves. On a 16 GB laptop that puts a practical ceiling of a few dozen on it, and you’ll be stopping and starting stacks long before that.

With native sites, the number you can keep is limited by disk, not memory, because idle sites hold no processes. There are 614 of them on this machine right now: test suites, smoke tests and per-branch sites for my agents. Each new one is a copy of WordPress core (110 MB here) plus its uploads and its database.

When I’d still use Docker

Native sites share one PHP, one MariaDB and one set of PHP extensions. Use Docker when the test needs something different from the machine’s own stack:

  • A different PHP or database version. Testing your plugin on PHP 7.4, or on MySQL 8 against MariaDB, is exactly what containers are good at.
  • System-level changes you don’t want on your machine. A profiler extension, a different php.ini, a database restarted with different settings.
  • Something that must match production exactly. If production is a container image, test in that image.

My own rule is native by default, and Docker only when a test needs one of those system-level changes.

For everyday work (several agents on several plugins, test suites, a site per branch) native is the default.

Two rules that matter more than the stack

Whichever you use:

  1. One site per agent, not per plugin. The agent is what leaves half-saved files around, so the agent is what needs isolating.
  2. Clear test data when a run starts, not when it ends. A test that tidies up after itself destroys the evidence when it fails. Keep the site; reset it on the way in.

Summary

  • Twenty native sites were installed and serving in under 9 seconds; twenty Docker sites took 42.
  • Docker costs about 170 MB of RAM per site, running or not; native sites add no processes.
  • Native sites cost disk, not memory, when idle, so you can keep one per agent, branch and test suite.
  • Use Docker when the test needs a different PHP, database or system setup from your machine’s.
  • The parallel-dev skill sets all of this up for Claude Code: github.com/superspeedyplugins/skills.

Comments