Symptoms
-
Database dump fails with the following error:
# plesk db dump example_db > /var/www/vhosts/example.com/example.sql
signal: killed
mysqldump: Got errno 32 on write -
The following entries are found in
/var/log/messages
:test kernel: systemd invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
test kernel: systemd cpuset=/ mems_allowed=0test kernel: lowmem_reserve[]: 0 0 0 0
test kernel: Node 0 DMA: 34kB (M) 68kB (UEM) 716kB (UEM) 232kB (UM) 264kB (M) 1128kB (E) 2256kB (EM) 1512kB (E) 21024kB (UE) 22048kB (EM) 04096kB = 7660kB
test kernel: Node 0 DMA32: 2834kB (UEM) 7348kB (UE) 55016kB (UE) 29732kB (UEM) 22264kB (UEM) 22128kB (EM) 1256kB (M) 0512kB 01024kB 12048kB (M) 04096kB = 44636kB
test kernel: Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
test kernel: 58470 total pagecache pages
test kernel: 0 pages in swap cache
test kernel: Swap cache stats: add 0, delete 0, find 0/0
test kernel: Free swap = 0kB
test kernel: Total swap = 0kB
test kernel: 524153 pages RAM -
Dumping the database with the native MySQL command is successful:
# MYSQL_PWD=cat /etc/psa/.psa.shadow mysqldump -uadmin example_db > /var/www/vhosts/example.com/example.sql
# -
Memory on the server might be somewhat limited, e.g:
# free -mh
total used free shared buff/cache available
Mem: 1.8G 734M 157M 235M 946M 696M
Swap: 0B 0B 0B
Cause
The 'plesk db' command uses more memory than a native MySQL dump command. As a result, the process is being killed by OOM killer.
Resolution
Apply one or more of the following:
-
Adjust OOM settings.
-
Increase RAM on the server
-
Use native 'mysqldump':
# MYSQL_PWD=cat /etc/psa/.psa.shadow mysqldump -uadmin example_db > /var/www/vhosts/example.com/example.sql