如何消除mysql中的已删除进程?

时间:2019-04-17 15:39:19

标签: mysql lsof

$ uname -a
Linux mysql 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
$ mysql --version
mysql  Ver 8.0.15 for Linux on x86_64 (MySQL Community Server - GPL)

在工作过程中,有很多过程在lsof中显示为“已删除”:

# lsof -u mysql | grep -F deleted | tail
mysqld  30953 mysql *752u      REG              259,2      1048584  16813064 /tmp/mysql_temptable.sBa7Ou (deleted)
mysqld  30953 mysql *753u      REG              259,2      1048584  16813066 /tmp/mysql_temptable.w49jlc (deleted)
mysqld  30953 mysql *754u      REG              259,2      1048584  16813063 /tmp/mysql_temptable.xGEeE9 (deleted)
mysqld  30953 mysql *755u      REG              259,2      1048584  16813067 /tmp/mysql_temptable.DJafvz (deleted)
mysqld  30953 mysql *756u      REG              259,2      1048584  16813071 /tmp/mysql_temptable.VkIBPa (deleted)
mysqld  30953 mysql *761u      REG              259,2      1048584  16813075 /tmp/mysql_temptable.1hwMuw (deleted)
mysqld  30953 mysql *762u      REG              259,2      1048584  16813068 /tmp/mysql_temptable.Ogtc0W (deleted)
mysqld  30953 mysql *763u      REG              259,2      1048584  16813069 /tmp/mysql_temptable.Tq7Gxk (deleted)
mysqld  30953 mysql *769u      REG              259,2      1048584  16813072 /tmp/mysql_temptable.4wjILK (deleted)
mysqld  30953 mysql *770u      REG              259,2      1048584  16813073 /tmp/mysql_temptable.rcrwKk (deleted)

有很多这样的过程,随着时间的推移,它们会占用整个内存:

# lsof -u mysql | grep -cF deleted
33532

仅重新启动mysql有帮助。 为什么会出现这些过程以及如何消除它们?

0 个答案:

没有答案