Applicable to:
- Plesk for Linux
Symptoms
-
Plesk and websites are down from time to time:
503 Service Unavailable
Server Error
500
Zend_Db_Adapter_Exception
SQLSTATE[HY000] [2002] Connection refused
ERROR: PleskDBException: Unable to connect to database: mysql_connect(): Connection refused /var/lib/mysql/mysql.sock (Error code: 2002). Please check that database server is started and accessible. (Abstract.php:69)
Cause
Insufficient amount of free RAM on the server.
-
In the log file
/var/log/mariadb/mariadb.log
or/var/log/mysql/mysql.log
, the following error messages are found:InnoDB: Fatal error: cannot allocate memory for the buffer pool
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] mysqld: Out of memory (Needed 128917504 bytes)
[ERROR] mysqld: Out of memory (Needed 96681984 bytes) -
The following error messages can be found in the log file
/var/log/messages
:kernel: Free swap = 0kB kernel: Total swap = 2097148kB ...
kernel: Out of memory: Kill process 21770 (mysqld) score 17 or sacrifice child
kernel: Killed process 21770 (mysqld) total-vm:2698392kB, anon-rss:24616kB, file-rss:0kB, shmem-rss:0kB
Resolution
Contact the server administrator or provider to increase the amount of the server's RAM and add swap if it is not enabled.