1

I have a strange issue with my MySQL server. It suddenly restarts. It's a rare but very big problem for me.

This server is running as Master in Master-Slave replication. I'm using MySQL 5.6.16-1+sury.org~precise+1-log

In syslog I see next info:

Jun  4 10:53:32 localhost kernel: [18821099.786264] init: mysql main process (25937) terminated with status 1
Jun  4 10:53:32 localhost kernel: [18821099.786329] init: mysql main process ended, respawning
Jun  4 10:53:32 localhost kernel: [18821100.064250] type=1400 audit(1433404412.925:26): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=9957 comm="apparmor_parser"

I see no errors in mysql common error files. I use Ubuntu 12.04 LTS, there is 32G of RAM on the server. Here is the config

[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql

query_cache_type = 1
innodb_buffer_pool_size = 9500M
max_heap_table_size = 268435456
tmp_table_size = 268435456
query_cache_size = 512M
sort_buffer_size = 8388608

innodb_additional_mem_pool_size = 16M
innodb_log_file_size = 32M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = 'O_DIRECT'
skip-external-locking
low-priority-updates
skip-name-resolve

key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
max_connections        = 600
query_cache_limit       = 4M
log_bin                 = /var/lib/mysql/mysql-bin
binlog_format           = MIXED
expire_logs_days        = 7
max_binlog_size         = 100M
binlog-do-db            = db1
binlog-do-db            = db2
binlog-do-db            = db3

server-id               = 1355115082

max_binlog_size         = 100M

[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[isamchk]
key_buffer              = 16M

Could you please help me with this problem or give some advice to think about?

Thank you in advance!

  • you need to locale and check mysqld.log (on my ubuntu it is in /var/log(/mysql)) for exact error – jkavalik Jun 4 '15 at 10:07
  • Thank you, but I've already checked it and there is no info about the issue. – Alex Pryakhin Jun 4 '15 at 11:02
  • Thats unfortunate.. But I saw some tip about attaching gdb to process and wait for a crash, then collect stack trace - I did not test it, but maybe it would give more info for debugging and possible bug report - mariadb.atlassian.net/browse/… (it is from MariaDB tracker, but seems like generic trick) – jkavalik Jun 4 '15 at 18:13
  • (unrelated) query_cache_size = 512M is much too big. Don't make it more than 50M. – Rick James Jun 9 '15 at 0:36
  • Check mysqld.err – Rick James Jun 9 '15 at 0:36
1

Today I found new logs at /var/log/upstart

So, terminating with signal 1 was the after effect but not the cause.

I saw next information

It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 5016582 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

So, I do assume, that the reason was in memory excess. Thus, I decreased max_threads (actually, it's the max_connections parameter) to have a security delta of memory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.