Guides

Preparing a server for Black Friday: PHP-FPM, MySQL and NGINX cache checklist

Black Friday 2026 falls on 27 November: commands and configuration files for PHP-FPM, MySQL/MariaDB and NGINX cache on Ubuntu 22.04/24.04, to test within two weeks.

UptimeMag editorial team · 20 October 2026 · 2 min read

Preparare un server per il Black Friday: checklist PHP-FPM, MySQL e cache NGINX

Black Friday 2026 falls on Friday, 27 November. Two weeks beforehand — by Friday, 13 November — it's time to open the terminal and check four points that, under load, make the difference between a slow site and a down site. None of the changes below require new hardware: they are configuration parameters that on many default installations remain those of a VPS with few daily visits.

1. PHP-FPM: pm.max_children

This is the maximum number of PHP processes the server can run simultaneously. If it's too low, excess requests queue up and TTFB increases; if it's too high, RAM fills before traffic subsides.

To calculate it, first measure how much RAM an active PHP-FPM process uses on average: the command ps -ylC php-fpm --sort:rss shows the memory used by each child process, with the RSS value expressed in kilobytes.

Then apply the formula: pm.max_children = total RAM available for PHP / average size of a PHP process. A practical example from the same source: with 2000 MB of RAM available and processes around 50 MB each, 2000/50 gives a pm.max_children of 40.

The file to modify is /etc/php/8.1/fpm/pool.d/www.conf on Ubuntu 22.04 (PHP 8.1 by default) and /etc/php/8.3/fpm/pool.d/www.conf on Ubuntu 24.04 (PHP 8.3 by default). After modification: systemctl reload php8.1-fpm (or php8.3-fpm).

2. MySQL/MariaDB: max_connections

Each PHP request querying the database opens a connection. Since 2010, with MySQL 5.5, the default value of max_connections is 151, the same value applies on MySQL 8.0.46 and MariaDB 10.11.14, the versions included in Ubuntu 24.04. During a spike of simultaneous checkouts, 151 runs out quickly.

Check with SHOW VARIABLES LIKE 'max_connections'; and raise it by modifying, on Ubuntu/Debian, the file /etc/mysql/mariadb.conf.d/50-server.cnf, adding under [mysqld] the line max_connections = 300 (or 500 if the server has sufficient RAM), followed by systemctl restart mariadb. Attention: each open connection consumes additional RAM, raise it alongside the pm.max_children check, not instead of it.

3. Static fallback page

If PHP-FPM saturates the workers, NGINX responds with 502. A static emergency page (even just HTML with the message "cart temporarily busy, try again in a few seconds") prevents the user seeing the naked error. In practice, add to the location block a try_files $uri @fallback; with a @fallback block that serves a static file from /var/www/maintenance.html when the backend doesn't respond within the timeout set with proxy_intercept_errors on; and error_page 502 503 504 /maintenance.html;.

4. CDN failover testing

Having a CDN configured is not enough: test it before the day. Temporarily disable the origin (or simulate a timeout) and verify with curl -I that the response arrives anyway, checking the cache header (e.g. X-Cache or your provider's equivalent) to understand whether the content is served from edge cache or fails along with the origin.

Summary

Check Verification command File to modify
pm.max_children ps -ylC php-fpm --sort:rss /etc/php/8.1(or 8.3)/fpm/pool.d/www.conf
max_connections SHOW VARIABLES LIKE 'max_connections'; /etc/mysql/mariadb.conf.d/50-server.cnf
Static page curl -I https://yoursite.it location block in NGINX
CDN failover curl -I with origin disabled CDN provider panel

Each modification should be tested before 13 November, not on the day of the campaign launch.

Written with the help of artificial intelligence and checked by the editors (EU AI Act, art. 50).