MySQL Fail
I'm running a CENTOS 6.7 x86_64 virtuozzo VPS host with WHM 54.0 (build 19) and MariaDB 10.0. I ran MySQL up until a couple of weeks ago, but converted to MariaDB since it was the recommended database. This is the first mysql crash I've had in the nine years this server has been running.
The only thing I changed today was to upgrade from PHP 5.6.18 to 5.6.19 using EasyApache 3 a couple of hours before the crash. A couple of hours after the upgrade, I received an email notice that mysql had failed with the following log entry:
160309 14:40:50 mysqld_safe mysqld from pid file /var/lib/mysql/host.mydomain.com.pid ended
160309 14:40:49 mysqld_safe mysqld restarted
160309 14:40:49 mysqld_safe Number of processes running now: 0
followed by a long list of database tables that were marked as crashed and should be repaired. The other relevant information in the email was as follows: Memory Information Used 2.85 GB Available 5.64 GB Installed 8.5 GB Load Information 0.09 0.45 0.39 Uptime 20 days, 8 hours, 40 minutes, and 1 second IOStat Information avg-cpu: %user %nice %system %iowait %steal %idle 1.27 0.01 0.25 0.01 0.00 98.46 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn Top Processes PID Owner CPU % Memory % Command 13798 siteone 66.67 0.50 lsphp5:/home/siteone/public_html/index.php 13771 mysql 10.05 1.14 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/host.mydomain.com.err --pid-file=/var/lib/mysql/host.mydomain.com.pid 13583 root 8.90 0.30 tailwatchd - chkservd - imap check 13803 sitetwo 6.76 0.29 lsphp5 9334 root 4.16 0.99 spamd child
I checked some of the database tables using phpMyAdmin, and they checked out OK, but I ran repair on them all anyway. I'm wondering why it would fail when it has functioned so well for so long, and if there is anything I can do to prevent it from happening again.
followed by a long list of database tables that were marked as crashed and should be repaired. The other relevant information in the email was as follows: Memory Information Used 2.85 GB Available 5.64 GB Installed 8.5 GB Load Information 0.09 0.45 0.39 Uptime 20 days, 8 hours, 40 minutes, and 1 second IOStat Information avg-cpu: %user %nice %system %iowait %steal %idle 1.27 0.01 0.25 0.01 0.00 98.46 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn Top Processes PID Owner CPU % Memory % Command 13798 siteone 66.67 0.50 lsphp5:/home/siteone/public_html/index.php 13771 mysql 10.05 1.14 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/host.mydomain.com.err --pid-file=/var/lib/mysql/host.mydomain.com.pid 13583 root 8.90 0.30 tailwatchd - chkservd - imap check 13803 sitetwo 6.76 0.29 lsphp5 9334 root 4.16 0.99 spamd child
I checked some of the database tables using phpMyAdmin, and they checked out OK, but I ran repair on them all anyway. I'm wondering why it would fail when it has functioned so well for so long, and if there is anything I can do to prevent it from happening again.
-
I had another failure of mysqld this morning. This time, the email included the following: 160310 9:14:52 [ERROR] mysqld: Can't find file: './mysql/plugin.frm' (errno: 12 "Cannot allocate memory") 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1520 bytes) 160310 9:14:52 [ERROR] mysqld: Aria engine: log initialization failed 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 524280 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 221184 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 319488 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 442368 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 589824 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 811008 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1105920 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1499136 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1998848 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1253376 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 1695744 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 2260992 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 3022848 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 4055040 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 5406720 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 7225344 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 9658368 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 12877824 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 17178624 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 22929408 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 30572544 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 40771584 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 54362112 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 72499200 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 160310 9:14:52 [ERROR] mysqld: Out of memory (Needed 128909312 bytes)
However, the email with the above log excerpt showed the following: Memory Information Used 2.7 GB Available 5.79 GB Installed 8.5 GB
I tried running:find -name plugin.frm -print
and didn't find the file, if that helps any.0 -
Hello :) Could you post the contents of your /etc/my.cnf file? Thank you. 0 -
Here is /etc/my.cnf: [mysqld] performance-schema=0 slow-query-log=1 long-query-time=1 innodb_file_per_table=1 innodb_buffer_pool_size=134217728 innodb_use_sys_malloc=0 datadir="/var/lib/mysql" query_cache_limit=1M query_cache_size=128M query_cache_type=1 max_user_connections=80 max_connections=100 thread_cache_size=128 table_open_cache=4K table_definition_cache=2512 key_buffer=128M max_connect_errors=20 max_allowed_packet=128M join_buffer_size=2M sort_buffer_size=2M read_buffer_size=2M read_rnd_buffer_size=2M thread_concurrency=4 myisam_sort_buffer_size=16M #open_files_limit=9244 concurrent_insert=1 local-infile=0 max_heap_table_size=256M tmp_table_size=256M tmpdir="/var/lib/mysql/tmpdir/tmp" key_cache_segments=4 default-storage-engine=InnoDB [myisamchk] ;key_buffer=32M sort_buffer=32M read_buffer=32M write_buffer=32M 0 -
MySQL failed again last night. I ran a check table with phpMyAdmin on some of the tables that were listed as crashed, but their status shows they're okay. Do I need to run repair on all the tables listed every time mysql crashes like this? 0 -
Looking at the error logs you have provided, mysql is crashing due to the problem with memory allocation It can be due to the insufficient memory on hardware node on which your vps is created or may be due to kernel issues. It is better to contact your hosting provider and check with this issue with them. 0 -
Thanks for the reply. I was hoping it was something simple I was not familiar with. I'll check with the host. 0
Please sign in to leave a comment.
Comments
6 comments