This guide contains details on advanced tweaking of PHP configuration for better Deskpro performance.
All the examples below are from a test environment, please review all the steps as the settings will need to be adjusted based on your helpdesks logs.
This is not an exhaustive guide on PHP configuration and tuning theory, there are numerous guides available online that explain the configuration in more detail. This guide is to make changes to your PHP configuration so that your Deskpro instance has better performance. We have a more detailed guide on PHP here.
This method uses small changes and checking of log files to increase or decrease the PHP settings to find the spot where your helpdesk has the best balance of performance and resource usage. The changes are made on an instance by instance basis and if you are running more than one helpdesk on your OPC you will need to divide your resources appropriately.
To begin checking the PHP logs you will first need to generate an OPC diagnostic report. - guide
Within the report are the PHP error logs that we will need to check for specific resource warnings

Reviewing the PHP logs shows a number of warnings due to PHP configuration settings. Deskpro uses 4 PHP pools (dp_default, dp_broardcaster, dp_gql and dp_internal). You will want to review all the PHP error logs for warnings that look like the examples below:
[DATE TIME] WARNING: [pool dp_x] server reached pm.max_children setting
[DATE TIME] WARNING: [pool dp_x] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers) copy
Below is an example of what the logs may look like:
[05-Jun-2023 09:32:09] WARNING: [pool dp_gql] server reached pm.max_children setting (20), consider raising it
[05-Jun-2023 09:35:07] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 2 idle, and 19 total children
[05-Jun-2023 09:36:46] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 22 total children
[05-Jun-2023 09:36:47] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 3 idle, and 27 total children
[05-Jun-2023 09:36:48] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 4 idle, and 29 total children
[05-Jun-2023 09:37:23] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 2 idle, and 17 total children
[05-Jun-2023 09:37:24] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 3 idle, and 20 total children
[05-Jun-2023 09:38:15] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 19 total children
[05-Jun-2023 09:38:40] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 18 total children
[05-Jun-2023 09:40:08] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 3 idle, and 19 total children
[05-Jun-2023 09:41:32] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 17 total children
[05-Jun-2023 09:41:33] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 16 children, there are 2 idle, and 22 total children
[14-Aug-2023 09:32:53] WARNING: [pool dp_broadcaster] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 11 total children
[14-Aug-2023 09:32:54] WARNING: [pool dp_broadcaster] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 32 children, there are 0 idle, and 12 total children
[14-Aug-2023 09:47:07] WARNING: [pool dp_gql] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 17 total children
[14-Aug-2023 09:47:08] WARNING: [pool dp_gql] server reached pm.max_children setting (20), consider raising it
[14-Aug-2023 09:47:08] WARNING: [pool dp_internal] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 8 total children copy
Here you can see a number of warnings, you will need to review the frequency of the warnings in your logs and determine if configuration changes are needed. For instance, if there were 1 or 2 warnings an hour during your most busy period, you may be OK with the performance. In the above example, we can see between 2 and 3 warnings a minute. This would indicate a noticeable slowdown for users of Deskpro whilst the agent sessions wait for more PHP resource to use.
Before any PHP changes are made you will need to review the performance of your server, check the load average at the time of the warnings in your logs. A tool such as top
, atop
or htop
will be useful.

If your server is running close to the limit of RAM / CPU you will need to increase this before the PHP changes are made. In the example above we can see 2GB of RAM is currently being used and there is 2GB available. The load average is less than 0.3, so there are plenty of resource to allow PHP to use. It will be important to review these logs after PHP changes are made to make sure that the server is not using 100% of available RAM / CPU.
Here are the default values for the PHP pools
[dp_broadcaster]
pm.max_children = 1000
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 3
[dp_gql]
pm.max_children = 20
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10
[dp_internal]
pm.max_children = 1000
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 5
[dp_default]
pm.max_children = 8
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 5 copy
These values now need to be adjusted to account for the warnings in the PHP logs.
For the above example we know that the warnings were for the dp_gql
, dp_internal
and dp_broadcaster
pools. This is where you now need to make changes to the settings.
As there is only 1 instance of the dp_internal
pool I will not increase these settings, and will check to see if it is still an issue after the other warnings have been resolved. This process is very granular and can take a while to find the sweet spot for your server.
[dp_broadcaster]
pm.start_servers = 5
pm.min_spare_servers = 5
pm.max_spare_servers = 10 copy
A number of warnings about the start, min and max available servers for this pool, I am increasing the start and min from 1 to 5, and doubling the max from 5 to 10
[dp_gql]
pm.max_children = 40 copy
This value had two warnings for being reached, so I increased the value from 20 to 40
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 20 copy
A number of warnings about the start, min and max available servers for this pool, I will double the values and test to see how it affects the PHP requests
To apply these changes, from your instance page click the "Web Config" tab on the Services card

The configuration we are applying can be set in the PHP-FPM configuration page

Enter the custom PHP configuration formatted as per the above default examples, but with the updated values, then click save to apply the changes

Once the changes have been applied you can check the PHP-FPM info to see that the new values are being used

Now you will need to let your helpdesk run for a day so that logs can be gathered during the same period the first opc report was run to compare against.
You will then check for the same warnings, you should notice a decrease in the frequency of the warnings after the changes were made, also check the top
, atop
or htop
tools to make sure you have enough CPU / RAM available for other system processes. You can then further increase the PHP values as needed until you are happy with either no warnings at all in your PHP logs, or just a small number.
Please log in or register to submit a comment.