얼마전부터 생긴 현상인데,
mysql 프로세스들이 죽지 않고 계속 살아 있습니다. 다음은 해당자료들입니다.
펜3 1기가 듀얼, 1기가 램입니다
사람들이 없는 새벽시간입니다.
top 내용
5:01am up 147 days, 23:08, 2 users, load average: 0.68, 0.46, 0.41 74 processes: 73 sleeping, 1 running, 0 zombie, 0 stopped CPU0 states: 3.4% user, 3.3% system, 0.0% nice, 92.1% idle CPU1 states: 5.1% user, 3.3% system, 0.0% nice, 90.4% idle Mem: 1028156K av, 1023744K used, 4412K free, 0K shrd, 3212K buff Swap: 2048276K av, 740K used, 2047536K free 958828K cached
mysqladmin extended-status +--------------------------+-----------+ | Variable_name | Value | +--------------------------+-----------+ | Aborted_clients | 0 | | Aborted_connects | 0 | | Bytes_received | 27152794 | | Bytes_sent | 940620852 | | Com_admin_commands | 0 | | Com_alter_table | 0 | | Com_analyze | 0 | | Com_backup_table | 0 | | Com_begin | 0 | | Com_change_db | 219834 | | Com_change_master | 0 | | Com_check | 0 | | Com_commit | 0 | | Com_create_db | 0 | | Com_create_function | 0 | | Com_create_index | 0 | | Com_create_table | 0 | | Com_delete | 20 | | Com_drop_db | 0 | | Com_drop_function | 0 | | Com_drop_index | 0 | | Com_drop_table | 0 | | Com_flush | 0 | | Com_grant | 0 | | Com_insert | 124 | | Com_insert_select | 0 | | Com_kill | 0 | | Com_load | 0 | | Com_load_master_table | 0 | | Com_lock_tables | 0 | | Com_optimize | 0 | | Com_purge | 0 | | Com_rename_table | 0 | | Com_repair | 0 | | Com_replace | 0 | | Com_replace_select | 0 | | Com_reset | 0 | | Com_restore_table | 0 | | Com_revoke | 0 | | Com_rollback | 0 | | Com_select | 180806 | | Com_set_option | 0 | | Com_show_binlogs | 0 | | Com_show_create | 0 | | Com_show_databases | 0 | | Com_show_fields | 0 | | Com_show_grants | 0 | | Com_show_keys | 0 | | Com_show_logs | 0 | | Com_show_master_stat | 0 | | Com_show_open_tables | 0 | | Com_show_processlist | 1 | | Com_show_slave_stat | 0 | | Com_show_status | 3 | | Com_show_tables | 0 | | Com_show_variables | 4 | | Com_slave_start | 0 | | Com_slave_stop | 0 | | Com_truncate | 0 | | Com_unlock_tables | 0 | | Com_update | 67318 | | Connections | 37145 | | Created_tmp_disk_tables | 0 | | Created_tmp_tables | 3814 | | Created_tmp_files | 0 | | Delayed_insert_threads | 0 | | Delayed_writes | 0 | | Delayed_errors | 0 | | Flush_commands | 1 | | Handler_delete | 12 | | Handler_read_first | 1 | | Handler_read_key | 4022149 | | Handler_read_next | 23491726 | | Handler_read_prev | 0 | | Handler_read_rnd | 709429 | | Handler_read_rnd_next | 51728098 | | Handler_update | 3617800 | | Handler_write | 230133 | | Key_blocks_used | 7990 | | Key_read_requests | 2675750 | | Key_reads | 7986 | | Key_write_requests | 548 | | Key_writes | 542 | | Max_used_connections | 36 | | Not_flushed_key_blocks | 0 | | Not_flushed_delayed_rows | 0 | | Open_tables | 227 | | Open_files | 375 | | Open_streams | 0 | | Opened_tables | 233 | | Questions | 505253 | | Select_full_join | 0 | | Select_full_range_join | 0 | | Select_range | 0 | | Select_range_check | 0 | | Select_scan | 6703 | | Slave_running | OFF | | Slave_open_temp_tables | 0 | | Slow_launch_threads | 0 | | Slow_queries | 0 | | Sort_merge_passes | 0 | | Sort_range | 61949 | | Sort_rows | 709429 | | Sort_scan | 9817 | | Table_locks_immediate | 242872 | | Table_locks_waited | 5399 | | Threads_cached | 36 | | Threads_created | 37 | | Threads_connected | 1 | | Threads_running | 1 | | Uptime | 3185 |
pstree init-+-bdflush |-crond---crond---run-parts---awk |-keventd |-khubd |-klogd |-kreclaimd |-kswapd |-kupdated |-login---bash |-mdrecoveryd |-5*[mingetty] |-proftpd |-sa1---sadc |-sendmail |-sshd |-syslogd `-xinetd---in.telnetd---login---bash---su---bash-+-pstree `-safe_mysqld---mysqld---mysqld---38*[mysqld]
mysqladmin processlist +-------+-------+-------------+----------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-------+-------+-------------+----------+---------+------+-------+------------------+ | 38389 | aaaa | 192.168.0.1 | book | Sleep | 1 | | | | 38393 | aaaa | 192.168.0.1 | book | Sleep | 0 | | | | 38398 | aaaa | 192.168.0.1 | book | Sleep | 0 | | | | 38401 | aaaa | 192.168.0.1 | fantasy0 | Sleep | 0 | | | | 38402 | root | localhost | | Query | 0 | | show processlist | +-------+-------+-------------+----------+---------+------+-------+------------------+
현재 이런식으로 나옵니다.
리스타트 시켜서 확인 한 것입니다.
실제 접속이 빈번하게 일어날때는 데몬숫자가 100이 넘어갑니다.
문제는 위의 extended-status에서 Max_used_connections 36 이고
pstree 에서 `-safe_mysqld---mysqld---mysqld---38*[mysqld] 입니다.
프로세스 리스트에서 보듯이 sleep 되어 있는것이 4개 뿐인데 pstree에서 38개가 살아서 kill 로도 안죽습니다.
아시는 분 답변 부탁드립니다. |