运行大查询时,Mysql在Ubuntu Server上不断重启

时间:2015-03-04 01:58:32

标签: mysql ubuntu

我有一个带有mysql 5.5.37的Ubuntu 12.04服务器

我只使用InnoDB表。其中一张表中有大约30万条记录。

一切都在顺利进行,直到我针对那个30万密耳的大表运行一个大的选择查询。该查询可能会产生大约2密耳的行。

'show processlist'以“复制到tmp表”状态显示查询约20秒。然后它就会消失,因为mysql只是重新启动。

这是syslog显示的内容:

Mar  3 18:32:53 lf1 kernel: [22530141.649970] init: mysql main process (31675) terminated with status 1
Mar  3 18:32:53 lf1 kernel: [22530141.649990] init: mysql main process ended, respawning
Mar  3 18:32:53 lf1 kernel: [22530141.657028] type=1400 audit(1425432773.505:51): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=24168 comm="apparmor_parser"
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24232]: Upgrading MySQL tables if necessary.
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24235]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24235]: Looking for 'mysql' as: /usr/bin/mysql
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24235]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24235]: This installation of MySQL is already upgraded to 5.5.37, use --force if you still need to run mysql_upgrade
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24246]: Checking for insecure root accounts.
Mar  3 18:32:55 lf1 /etc/mysql/debian-start[24251]: Triggering myisam-recover for all MyISAM tables

是什么导致它重新启动?显然它耗尽了内存或类似的东西。所以这是db服务器变量:

key_buffer = 512M
max_allowed_packet = 16M
sort_buffer_size = 24M
myisam_sort_buffer_size = 64M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
thread_cache_size = 8
query_cache_size= 216M
table_cache = 128
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 12
max_connections = 200
max_connect_errors = 500
max_heap_table_size = 512M
tmp_table_size = 512M
query_cache_limit = 32M

盒子本身有32 GB的RAM。

0 个答案:

没有答案