Задавайте вопросы, мы ответим
Вы не зашли.
Привет. Время от времени (пару раз в месяц) возникает проблема с работой mysql.
Сначала происходит резкий рост Threads_connected пока не достигает лимита max_threads=250. Причём обычное
значение Threads_connected не превышает 5.
Если попытаться перезапустить mysql, ничего не выходит, очень долго (10 минут ждал) висит текст "Waiting for PIDS: 99125". Приходится убивать процесс (и после этого восстанавливать кучу таблиц).
В Show processlist присутствовали запросы к различным таблицам во всевозможных различных статусах: end, Locked, update, NULL
Неактивен
Вот данные, собранные при последнем падении:
В 12:31 Threads_connected достиг лимита в 251 соединений
/usr/local/bin/mysql -e"show processlist;" показывает 250 совершенно обычных на первый
взгляд запросов.
/usr/local/bin/mysql -e"show status;"
Variable_name Value
Aborted_clients 539
Aborted_connects 8
Binlog_cache_disk_use 0
Binlog_cache_use 0
Bytes_received 115
Bytes_sent 171
Com_admin_commands 0
Com_assign_to_keycache 0
Com_alter_db 0
Com_alter_db_upgrade 0
Com_alter_event 0
Com_alter_function 0
Com_alter_procedure 0
Com_alter_server 0
Com_alter_table 0
Com_alter_tablespace 0
Com_analyze 0
Com_backup_table 0
Com_begin 0
Com_binlog 0
Com_call_procedure 0
Com_change_db 0
Com_change_master 0
Com_check 0
Com_checksum 0
Com_commit 0
Com_create_db 0
Com_create_event 0
Com_create_function 0
Com_create_index 0
Com_create_procedure 0
Com_create_server 0
Com_create_table 0
Com_create_trigger 0
Com_create_udf 0
Com_create_user 0
Com_create_view 0
Com_dealloc_sql 0
Com_delete 0
Com_delete_multi 0
Com_do 0
Com_drop_db 0
Com_drop_event 0
Com_drop_function 0
Com_drop_index 0
Com_drop_procedure 0
Com_drop_server 0
Com_drop_table 0
Com_drop_trigger 0
Com_drop_user 0
Com_drop_view 0
Com_empty_query 0
Com_execute_sql 0
Com_flush 0
Com_grant 0
Com_ha_close 0
Com_ha_open 0
Com_ha_read 0
Com_help 0
Com_insert 0
Com_insert_select 0
Com_install_plugin 0
Com_kill 0
Com_load 0
Com_load_master_data 0
Com_load_master_table 0
Com_lock_tables 0
Com_optimize 0
Com_preload_keys 0
Com_prepare_sql 0
Com_purge 0
Com_purge_before_date 0
Com_release_savepoint 0
Com_rename_table 0
Com_rename_user 0
Com_repair 0
Com_replace 0
Com_replace_select 0
Com_reset 0
Com_restore_table 0
Com_revoke 0
Com_revoke_all 0
Com_rollback 0
Com_rollback_to_savepoint 0
Com_savepoint 0
Com_select 1
Com_set_option 0
Com_show_authors 0
Com_show_binlog_events 0
Com_show_binlogs 0
Com_show_charsets 0
Com_show_collations 0
Com_show_column_types 0
Com_show_contributors 0
Com_show_create_db 0
Com_show_create_event 0
Com_show_create_func 0
Com_show_create_proc 0
Com_show_create_table 0
Com_show_create_trigger 0
Com_show_databases 0
Com_show_engine_logs 0
Com_show_engine_mutex 0
Com_show_engine_status 0
Com_show_events 0
Com_show_errors 0
Com_show_fields 0
Com_show_function_status 0
Com_show_grants 0
Com_show_keys 0
Com_show_master_status 0
Com_show_new_master 0
Com_show_open_tables 0
Com_show_plugins 0
Com_show_privileges 0
Com_show_procedure_status 0
Com_show_processlist 0
Com_show_profile 0
Com_show_profiles 0
Com_show_slave_hosts 0
Com_show_slave_status 0
Com_show_status 1
Com_show_storage_engines 0
Com_show_table_status 0
Com_show_tables 0
Com_show_triggers 0
Com_show_variables 0
Com_show_warnings 0
Com_slave_start 0
Com_slave_stop 0
Com_stmt_close 0
Com_stmt_execute 0
Com_stmt_fetch 0
Com_stmt_prepare 0
Com_stmt_reprepare 0
Com_stmt_reset 0
Com_stmt_send_long_data 0
Com_truncate 0
Com_uninstall_plugin 0
Com_unlock_tables 0
Com_update 0
Com_update_multi 0
Com_xa_commit 0
Com_xa_end 0
Com_xa_prepare 0
Com_xa_recover 0
Com_xa_rollback 0
Com_xa_start 0
Compression OFF
Connections 23848
Created_tmp_disk_tables 0
Created_tmp_files 2640
Created_tmp_tables 0
Delayed_errors 0
Delayed_insert_threads 0
Delayed_writes 0
Flush_commands 1
Handler_commit 0
Handler_delete 0
Handler_discover 0
Handler_prepare 0
Handler_read_first 0
Handler_read_key 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_rnd 0
Handler_read_rnd_next 0
Handler_rollback 0
Handler_savepoint 0
Handler_savepoint_rollback 0
Handler_update 0
Handler_write 0
Innodb_buffer_pool_pages_data 500
Innodb_buffer_pool_pages_dirty 0
Innodb_buffer_pool_pages_flushed 624
Innodb_buffer_pool_pages_free 0
Innodb_buffer_pool_pages_misc 12
Innodb_buffer_pool_pages_total 512
Innodb_buffer_pool_read_ahead_rnd 5
Innodb_buffer_pool_read_ahead_seq 3
Innodb_buffer_pool_read_requests 128862
Innodb_buffer_pool_reads 655
Innodb_buffer_pool_wait_free 0
Innodb_buffer_pool_write_requests 4888
Innodb_data_fsyncs 699
Innodb_data_pending_fsyncs 0
Innodb_data_pending_reads 0
Innodb_data_pending_writes 0
Innodb_data_read 16109568
Innodb_data_reads 815
Innodb_data_writes 1096
Innodb_data_written 20973056
Innodb_dblwr_pages_written 624
Innodb_dblwr_writes 97
Innodb_log_waits 0
Innodb_log_write_requests 588
Innodb_log_writes 447
Innodb_os_log_fsyncs 505
Innodb_os_log_pending_fsyncs 0
Innodb_os_log_pending_writes 0
Innodb_os_log_written 496128
Innodb_page_size 16384
Innodb_pages_created 12
Innodb_pages_read 722
Innodb_pages_written 624
Innodb_row_lock_current_waits 0
Innodb_row_lock_time 0
Innodb_row_lock_time_avg 0
Innodb_row_lock_time_max 0
Innodb_row_lock_waits 0
Innodb_rows_deleted 212
Innodb_rows_inserted 146
Innodb_rows_read 35022
Innodb_rows_updated 224
Key_blocks_not_flushed 172
Key_blocks_unused 428304
Key_blocks_used 10060
Key_read_requests 313007071
Key_reads 8671089
Key_write_requests 825632
Key_writes 334058
Last_query_cost 0.000000
Max_used_connections 251
Not_flushed_delayed_rows 0
Open_files 424
Open_streams 0
Open_table_definitions 256
Open_tables 335
Opened_files 6293706
Opened_table_definitions 0
Opened_tables 0
Prepared_stmt_count 0
Qcache_free_blocks 6
Qcache_free_memory 24128
Qcache_hits 655750
Qcache_inserts 2657724
Qcache_lowmem_prunes 2631682
Qcache_not_cached 183486
Qcache_queries_in_cache 10
Qcache_total_blocks 35
Queries 3639002
Questions 2
Rpl_status NULL
Select_full_join 0
Select_full_range_join 0
Select_range 0
Select_range_check 0
Select_scan 0
Slave_open_temp_tables 0
Slave_retried_transactions 0
Slave_running OFF
Slow_launch_threads 0
Slow_queries 0
Sort_merge_passes 0
Sort_range 0
Sort_rows 0
Sort_scan 0
Table_locks_immediate 3811889
Table_locks_waited 279
Tc_log_max_pages_used 0
Tc_log_page_size 0
Tc_log_page_waits 0
Threads_cached 0
Threads_connected 251
Threads_created 23847
Threads_running 251
Uptime 9943
Uptime_since_flush_status 9943
Выдача top в 12:31
last pid: 51595; load averages: 0.72, 0.62, 0.60 up 33+21:40:03 12:31:01
851 processes: 2 running, 845 sleeping, 4 stopped
Mem: 4266M Active, 5081M Inact, 1914M Wired, 562M Cache, 1236M Buf, 51M Free
Swap: 4096M Total, 12M Used, 4084M Free
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
51560 user231 1 46 0 192M 39560K CPU7 7 0:00 0.10% httpd
865 root 1 44 0 11920K 2056K select 3 53:08 0.00% ntpd
654 bind 11 44 0 129M 47164K kqread 6 23:20 0.00% named
642 root 1 44 0 7048K 1292K select 4 9:29 0.00% syslogd
1059 root 1 44 0 7000K 1388K kqread 0 0:46 0.00% dovecot
21658 www 1 44 0 39080K 28728K kqread 1 0:35 0.00% nginx
12759 root 1 44 0 160M 23744K select 4 0:20 0.00% httpd
64676 root 1 44 0 36580K 7176K connec 3 0:17 0.00% sendmail
1064 root 1 44 0 11100K 1756K kqread 0 0:15 0.00% dovecot-auth
78188 root 1 44 0 36580K 6892K select 7 0:15 0.00% sendmail
90403 root 1 44 0 21244K 8228K select 2 0:13 0.00% perl5.12.4
91558 root 1 44 0 36580K 6656K connec 2 0:12 0.00% sendmail
2962 root 1 44 0 36580K 6704K select 5 0:11 0.00% sendmail
12383 root 1 44 0 36580K 6632K select 1 0:08 0.00% sendmail
22737 root 1 44 0 36580K 6572K connec 4 0:07 0.00% sendmail
99125 mysql 260 44 0 1041M 387M ucond 0 0:07 0.00% mysqld
51938 root 1 44 0 16228K 3384K select 0 0:06 0.00% proftpd
32598 root 1 44 0 34532K 6260K select 6 0:05 0.00% sendmail
Выдача top в 12:20
last pid: 47797; load averages: 1.12, 0.67, 0.60 up 33+21:29:03 12:20:01
99 processes: 3 running, 92 sleeping, 4 stopped
Mem: 708M Active, 8869M Inact, 1621M Wired, 497M Cache, 1236M Buf, 180M Free
Swap: 4096M Total, 12M Used, 4084M Free
PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND
99125 mysql 11 44 0 609M 168M sbwait 0 0:04 0.29% mysqld
865 root 1 44 0 11920K 2056K select 0 53:07 0.00% ntpd
654 bind 11 44 0 129M 47164K kqread 7 23:20 0.00% named
642 root 1 44 0 7048K 1292K select 1 9:28 0.00% syslogd
1059 root 1 44 0 7000K 1388K kqread 2 0:46 0.00% dovecot
21658 www 1 44 0 39080K 29228K kqread 5 0:31 0.00% nginx
12759 root 1 44 0 160M 23744K select 6 0:20 0.00% httpd
64676 root 1 44 0 36580K 7100K connec 6 0:16 0.00% sendmail
1064 root 1 44 0 11100K 1756K kqread 4 0:15 0.00% dovecot-auth
78188 root 1 44 0 36580K 6856K select 7 0:14 0.00% sendmail
90403 root 1 44 0 21244K 8228K select 3 0:13 0.00% perl5.12.4
91558 root 1 44 0 36580K 6648K select 2 0:11 0.00% sendmail
2962 root 1 44 0 36580K 6672K connec 4 0:10 0.00% sendmail
12383 root 1 44 0 36580K 6620K connec 2 0:08 0.00% sendmail
22737 root 1 44 0 36580K 6528K connec 7 0:07 0.00% sendmail
51938 root 1 44 0 16228K 3384K select 0 0:06 0.00% proftpd
42835 root 1 44 0 19512K 6424K select 4 0:04 0.00% mc
32598 root 1 44 0 34532K 6256K select 4 0:04 0.00% sendmail
Выдача iostat в 12:31
aacd0 aacd1 pass1 pass2
KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s
56.29 26 1.43 21.56 82 1.72 0.02 0 0.00 0.09 0 0.00
В логах mysql время от времени появляется сообщение
111025 10:09:26 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.
key_buffer_size=536870912
read_buffer_size=262144
max_used_connections=17
max_threads=250
threads_connected=5
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 606838 K
bytes of memory
Hope thats ok; if not, decrease some variables in the equation.
Есть выдача Munin в тот день, когда последний раз был сбой:
Особенно хорошо видно на графике "Memory Usage".
Неактивен