# PHP performance

> Read your environment's PHP memory pool, and rebalance the number of PHP threads and the memory each one gets.

Source: https://docs.wpwaterfall.com/php-performance

The PHP performance panel shows how much memory an environment's PHP has and how that memory is split between threads. Your plan and the site's [tier](https://docs.wpwaterfall.com/site-tiers) set the size of the pool, and you decide how to use it. Open the site, then **Info**, and find **PHP performance**.

## Open it

1. Open a site and pick the environment in the top bar.
2. Stay on **Info**.
3. Find the **PHP performance** panel.

The panel shows one block for each thread, and three numbers:

- **Memory pool**: the most memory the PHP threads may use together on this environment. It is a limit, not memory held back for you. Your plan, the site's tier, and the PHP Performance add-on set it.
- **PHP threads**: how many PHP requests can run at the same time.
- **Memory per thread**: how much memory each of those requests can use. The default is 256 MB, or 512 MB on WP 60 and up. The pool is the threads times this memory, so a new environment on WP 20 has 6 threads of 256 MB in a 1.5 GB pool. The threads are an allowance, a cap per site, and the pool is a limit, not memory held back for you.

The whole site has one more limit that the panel does not show: the most memory it may use in all, including the database and the code cache. It is 4 GB on a Single plan and 8 GB on a WP plan. A burst past about four fifths of it is slowed before anything is stopped.

## Rebalance threads and memory

You can trade threads for memory inside the pool. Fewer threads means each request gets more memory, which suits heavy admin pages and large imports, at the cost of handling fewer visitors at the same time. A thread always keeps at least the memory per thread of your plan (256 MB, or 512 MB on WP 60 and up), so the default is the most threads a pool can run.

1. Select **Change** on the panel.
2. Pick a pair of threads and memory per thread from the list. Only the pairs that fit the pool are listed. The three numbers and the blocks show the result as you pick.
3. Select **Apply**.

The change runs as a job, and the dashboard shows the progress. Setting it on the live environment and on a staging environment are separate changes, so you can try a balance on staging first.

On a staging or preview environment, **Change** is off until that environment's own [site tier](https://docs.wpwaterfall.com/site-tiers) is above **Single 20GB**. Point at the button to read why. Upgrade the tier on the **Add-ons** tab with that environment picked in the top bar. The tier gives the environment more threads and memory, and then you can rebalance them. Live is not affected: it follows your plan, and upgrading staging never changes live.

## See what PHP really runs with

`GET /v1/environments/{id}/php/engine` reads the settings back from the server: the PHP version, the number of PHP workers and how they start, the memory limit, the maximum execution time, OPcache, and how many workers are busy right now. Use it to confirm a change took effect. An assistant connected through MCP reads the same values with `get_php_engine`. For the time each page, plugin, and query takes, see the Performance part of [Monitor](https://docs.wpwaterfall.com/monitor).

## Grow the pool

More memory is the **PHP Performance** add-on. You buy it yourself, with no support step. It costs **$10 a month** for each extra 512 MB of pool, and it applies to the site's live environment.

1. Open the site and choose **Add-ons** in the site menu.
2. On the **PHP Performance** card, choose **Enable**.
3. Enter how many blocks of 512 MB you want. The dialog shows the memory added and the monthly total.
4. Choose **Add to site**.

The new pool applies at once, as a job on the site's server, and the card shows **Applying** until it is done. It is billed from the next invoice, prorated today. The pool of a site can grow to 4 GB in all. Past that, a dedicated server is the way up: see [Dedicated Server](https://docs.wpwaterfall.com/dedicated-server).

Choose **Change** to hold more or fewer blocks, or **Remove** to give them all back. The pool returns to the size your plan and tier give it, and the unused days are credited to your account. WP Waterfall keeps the number of threads when it still fits the new pool, and moves it to the nearest allowed count when it does not. Owners, admins, and billing users can buy the add-on. Other members see the card without a button. Staging and previews do not use the add-on. Their pool comes from their own site tier.

## Quick answers

**Why can I not raise both threads and memory per thread?**
Both share one pool. Raising the memory per thread lowers the threads. Add blocks on the **PHP Performance** add-on if you need more of both.

**Can a site run more threads than the default?**
Yes, with the **PHP Performance** add-on or a higher [site tier](https://docs.wpwaterfall.com/site-tiers). Each block of 512 MB adds two threads at 256 MB.

**My site shows memory errors in the PHP log.**
Lower the thread count so each thread gets more memory, then watch `php-fpm.log` on the [Logs tab](https://docs.wpwaterfall.com/logs-viewer). If errors continue, add blocks on the **PHP Performance** add-on.

**How do I get back to the default?**
Pick the pair with your site's default threads and memory per request from the list, for example 6 threads of 256 MB on WP 20. The default pair is always in the list, as long as the pool is still the one your plan and tier give.

**Does the add-on change the memory per thread?**
No. The new 512 MB gives the environment more threads at the memory per thread it has: two more at 256 MB, one more at 512 MB. You can rebalance them afterwards.

**Does staging share live's pool?**
Each environment has its own panel. A staging or preview environment runs the included profile, with 2 threads in a 512 MB pool, and it stays that way.

**Why is there no Change button on staging?**
Staging and preview environments run the included profile, so their PHP performance is fixed. Change it on the live environment. A site tier applies to live only: [Site tiers](https://docs.wpwaterfall.com/site-tiers).

## API

- `PUT /v1/sites/{id}/php-performance`
- `PUT /v1/environments/{id}/php-performance`

`PUT /v1/sites/{id}/php-performance` sets the live environment (or staging, for a site that has not launched). `PUT /v1/environments/{id}/php-performance` sets the environment you name. On a staging or preview environment, both answer 409 with the code `environment_php_fixed`. The MCP tool `set_php_performance` follows the same rule.

## Related

- [Site information](https://docs.wpwaterfall.com/site-info)
- [Change PHP settings](https://docs.wpwaterfall.com/tools-php-settings)
- [Add-ons](https://docs.wpwaterfall.com/add-ons)
- [View logs](https://docs.wpwaterfall.com/logs-viewer)
