Applicable to:
- Plesk for Linux
Symptoms
-
Website is unavailable with the following error:
CONFIG_TEXT: 503 Service Unavailable
- Website is configured with
php-fpm
handler at Plesk > Domains > example.com > PHP Settings. -
The following error can be found in domain's
error_log
:# tail -fn0 /var/www/vhosts/example.com/logs/error_log
[Fri May 13] [proxy:error] [pid 13377:tid] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/example.com/php-fpm.sock (*) failed
[Fri May 13] [proxy_fcgi:error] [pid 13377:tid] [client 203.0.113.2:44054] AH01079: failed to make connection to backend: httpd-UDS -
php5-fpm.service
service is down:# service php5-fpm status
php5-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/lib/systemd/system/php5-fpm.service; enabled)
Active: failed (Result: exit-code) since Fri 2016-05-13 22:05:30 EEST; 44s ago
...
May 13 22:05:30 example.com php5-fpm[17263]: [13-May-2016 22:05:30] ERROR: unable to allocate 1168 bytes in shared memory: Cannot allocate memory: Cannot...emory (12)
Cause
The system cannot allocate the required amount of memory.
Resolution
Note: if direct SSH access to the server is not possible, contact the server administrator for further assistance.
Note: if container virtualization is used, these steps should be applied on a hardware node side.
-
Connect to the server via SSH;
-
increase the default value of vm.max_map_count parameter. An example of how to do that is shown below:
# sysctl -w vm.max_map_count=655300
vm.max_map_count = 655300Or:
# echo 655350 > /proc/sys/vm/max_map_count
-
To change it permanently edit
/etc/sysctl.conf
with a text edito and add the following parameter with the new value. For example:CONFIG_TEXT: vm.max_map_count=655350
-
Run the command to immediately apply the changes made in
/etc/sysctl.conf
:# sysctl -p
Additional information
The file /etc/sysctl.conf
contains the maximum number of memory map areas a process may have. Memory map areas are used as a side-effect of calling malloc, directly by mmap
and mprotect
, and also when loading shared libraries.
While most applications need less than a thousand maps, certain programs, particularly malloc debuggers, may consume lots of them, e.g. up to one or two maps per allocation.
The default value is 65536.
Comments
4 comments
Hello, Plesk runs on a vmware. I get this error:
sysctl: permission denied on key 'vm.max_map_count'
Any ideas?
These error messages might be related to this article:
[Sun Apr 15 08:03:37.590003 2018] [proxy_fcgi:error] [pid 31251:tid 140465712113408] [client 66.249.89.58:35768] AH01079: failed to make connection to backend: httpd-UDS
[Sun Apr 15 08:03:48.204218 2018] [proxy:error] [pid 31250:tid 140465850922752] (2)No such file or directory: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/parkscanner.de/php-fpm.sock (*) failed
I found this article while searching for my 503 problem, that needs to be solved and finding this article:
https://support.plesk.com/hc/en-us/articles/213411429?page=1#comment_360000262173
root@h2738982:~# systemd-detect-virt
openvz
@Jakob Alexander Eichler
It is not possible to apply kernel setting from within the container. If container virtualization is used, these steps should be applied on a hardware node side.
Please sign in to leave a comment.