• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question Plesk PHP-FPM APCu SHM Mismatch: phpinfo() shows 512M but apcu_sma_info() returns ~32M

marekp

New Pleskian
Server operating system version
CentOS 7.9
Plesk version and microupdate number
Plesk 18.0.69
Hello Plesk community,
I’m running a CakePHP 4.6 application on CentOS 7.9 with Plesk 18. My PHP version is 8.2.28, and I have PHP-FPM enabled for the domain. In Plesk’s PHP Settings for this domain, I added:
apc.enabled = 1
apc.shm_size = 512M
After applying and letting Plesk restart FPM, I verified via a simple phpinfo() call that apc.shm_size is indeed set to 512M in the FPM environment. However, when I call apcu_sma_info() from a CakePHP controller (i.e. executed via the browser, not CLI), I see:
Array
(
[num_seg] => 1
[seg_size] => 33554312 // ~32 MB in bytes
[avail_mem] => 31328296
[block_lists] => Array(…)
)
Despite ini_get('apc.shm_size') outputting “512M,” the actual segment size in apcu_sma_info() is only ~33,554,312 bytes, indicating FPM has only reserved ~32 MB of APCu shared memory. I need to understand:
  1. Where exactly is APCu’s ini for the active PHP-FPM pool?
  2. Why does phpinfo() report 512M but apcu_sma_info() still show only ~32M?
  3. How can I force the FPM workers to truly initialize APCu with 512M SHM?
I have checked:
  • SAPI: Confirmed PHP_SAPI is fpm-fcgi.
  • Loaded php.ini: /opt/plesk/php/8.2/etc/php.ini
  • Scanned ini files: includes /opt/plesk/php/8.2/etc/php.d/apcu.ini
  • ini_get('apc.shm_size'): 512M
  • apcu_sma_info()['seg_size']: 33554312
It looks like the FPM-workers may still be using some default (32M) instead of picking up the 512M override. Any pointers on where Plesk keeps the pool-specific APCu configuration, or how to ensure the FPM process actually reserves the full 512M? Thanks in advance!
 
Hello, @marekp . APCu is not officially supported by Plesk and was not tested extensively, so I cannot confirm that for sure. Our engineers previously reviewed a similar case and were able to determine (through a test script) that the limit of apc.shm_size for the environment is the manually defined one (e.g. 512MB), and the 32MB memory segment limit is set on the system level.

If it's absolutely necessary, what you can try is adding apc.shm_size = 512M to /opt/plesk/php/8.2/etc/php.d/apcu.ini. However, please proceed with caution and at your own risk.
 
Back
Top