- Plesk for Linux
Websites can't be reached.
Plesk is not accessible:
CONFIG_TEXT: Gateway error 502
The following entry can be found in
CONFIG_TEXT: Fatal Error Unable to allocate shared memory segment of 134217728 bytes: mmap: Cannot allocate memory (12)
topcommand shows enough RAM on the server, more than was mentioned in the error entry above;
sw-engine service cannot start:
# service sw-engine start
Starting sw-engine-fpm: Fri Aug 17 20:40:58 2018 (11150): Fatal Error Unable to allocate shared memory segment of 134217728 bytes: mmap: Cannot allocate memory (12)
Container limits checking shows the following:
# cat /proc/user_beancounters | grep shm
shmpages 17604 17604 20480 20480 18
Container limit shmpages is exceeded by OPcache, which needs more, than segments available.
Connect to the server via SSH;
Check current segment size:
# ipcs -lm
------ Shared Memory Limits --------
max number of segments = 4096
max seg size (kbytes) = 32768
max total shared memory (kbytes) = 8388608
min seg size (bytes) = 1
Go to Tools & Settingsx > PHP Settings > <PHP version, that has many domains> > php.ini.
opcache.memory_consumptionoption and set it equal to the segment limit (In this case 32) - changes applied automatically to all the domains, that are using this PHP version.
Note: If you have access to the Hardware Node, use the resolution below. If not, contact your provider to increase the limit for you.
1.Connect to the server via SSH;
Increase the amount of the corresponding UBC limit for the container to at least 40960:
# vzctl set 10001 --shmpages 40960 --save