sw-engine service cannot be started on Linux container: Unable to allocate shared memory segment

Refers to:

  • Plesk for Linux
  • Plesk

Created:

2016-11-16 13:14:09 UTC

Modified:

2017-02-20 04:29:12 UTC

0

Was this article helpful?


Have more questions?

Submit a request

sw-engine service cannot be started on Linux container: Unable to allocate shared memory segment

Symptoms

Plesk shows 502 Bad Gateway.

When attempting to start 'sw-engine' service manually, the following error appears:

# service sw-engine start
Starting sw-engine-fpm: Fri Jul 18 22:57:06 2014 (8118): Fatal Error Unable to allocate shared memory segment of 104857600 bytes:
mmap: Cannot allocate memory (12) [FAILED]

Plesk is installed inside a container.

Cause

The container is experiencing a lack of some UBC resources. For example, 'shmpages':

# cat /proc/user_beancounters
Version: 2.5 uid resource held maxheld barrier limit failcnt 10001:
shmpages 17604 17604 20480 20480 18

From the above output, we can see that there were 18 attempts to overuse. There are several memory-related UBC limits that can also cause this issue. Please refer to this article for more information.

Resolution

If you have access to the Hardware Node, use the resolution below. If not, contact your hosting provider.

You will need to increase the amount of the corresponding UBC limit for the container to at least 40960:

[root@vznode ~]# vzctl set 10001 --shmpages 40960 --save

If you do not have access to the Hardware Node, contact your provider to increase the limit for you.

Alternatively, you can decrease PHP memory consumption in '/usr/local/psa/admin/conf/php.ini' , having changed the parameter(create if does not exist) 'opcache.memory_consumption' from 100 to 64:

opcache.memory_consumption=64
Have more questions? Submit a request
Please sign in to leave a comment.