- The container memory: the amount of memory you can allot for PHP processing depending on your defined application resources.
- The request memory: the amount of memory an average PHP request is expected to require.
- The reserved memory: the amount of memory you need to reserve for tasks that aren’t related to requests.
The number is calculated as follows:

To ensure that Upsun doesn’t add more workers than the CPU can handle,
a CPU limit applies as soon as the number of set workers equals or exceeds 25.
This limit is calculated as follows:
number of vCPU cores * 5.For example, if you have a 2XL container with 8 CPU cores,
you can have up to 40 workers as long as you have sufficient memory.Before you begin
You need: Note that the memory settings mentioned on this page are different from thememory_limit PHP setting.
The memory_limit setting is the maximum amount of memory a single PHP process can use
before it’s automatically terminated.
1. Estimate the optimal request memory for your app
To determine what the optimal request memory is for your app, you can refer to your PHP access logs. Run a command similar to:- The majority of requests peaked at 2,048 KB of memory.
- Most other requests used up to around 10 MB of memory.
- A few requests used up to around 12 MB of memory.
- Only 68 requests peaked at around 46 MB of memory.
2. Adjust the maximum number of PHP-FPM workers
By default, the request memory is set to 45 MB and the reserved memory is set to 70 MB. These values allow most programs to run, but you can amend them to fit your needs. To do so, adjust your app configuration. Underruntime in the sizing_hints setting,
set the values for reserved_memory and request_memory.
For example,
if you estimate your optimal request memory to be 110 MB
and your reserved memory to be 80 MB,
you can use:
Note that the minimum value for the request_memory key is 10 MB
and the minimum value for the reserved_memory key is 70 MB.
If you set lower values,
they’re automatically overridden with those minimums.
To check the maximum number of PHP-FPM workers available to your app,
run the following command, where children refers to PHP-FPM workers: