免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 36876 | 回复: 93

急求,mysql 经常导致CPU使用率100%  关闭 [复制链接]

论坛徽章:
0
发表于 2008-07-26 22:31 |显示全部楼层
不知道是什么原因,一台服务器,就装了个Discuz ,加上那个首页四格的那些后经常导致CPU使用率100%,导致整个主机挂掉 或者要等很久,或者要service mysqld restart才行


主机为奔腾双核
[root@localhost ~]# dmesg|grep cpu
cpufreq: CPU0 - ACPI performance management activated.
cpufreq: *P0: 3000 MHz, 88000 mW, 160 uS
cpufreq:  P1: 2400 MHz, 68000 mW, 160 uS
cpufreq: CPU1 - ACPI performance management activated.
cpufreq: *P0: 3000 MHz, 88000 mW, 160 uS
cpufreq:  P1: 2400 MHz, 68000 mW, 160 uS
microcode: No new microdata for cpu 1
microcode: No new microdata for cpu 0

内存1G

my.cnf的配置为
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 8
set-variable = max_connections=500
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking

# Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin

# required unique id between 1 and 2^32 - 1
# defaults to 1 if master-host is not set
# but will not function as a master if omitted
server-id       = 1

# Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# 1) Use the CHANGE MASTER TO command (fully described in our manual) -
#    the syntax is:
#
#    CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
#    MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
#    where you replace <host>, <user>, <password> by quoted strings and
#    <port> by the master's port number (3306 by default).
#
#    Example:
#
#    CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
#    MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# 2) Set the variables below. However, in case you choose this method, then
#    start replication for the first time (even unsuccessfully, for example
#    if you mistyped the password in master-password and the slave fails to
#    connect), the slave will create a master.info file, and any later
#    change in this file to the variables' values below will be ignored and
#    overridden by the content of the master.info file, unless you shutdown
#    the slave server, delete master.info and restart the slaver server.
#    For that reason, you may want to leave the lines below untouched
#    (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between 2 and 2^32 - 1
# (and different from the master)
# defaults to 2 if master-host is set
# but will not function as a slave if omitted
#server-id       = 2
#
# The replication master for this slave - required
#master-host     =   <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user     =   <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password =   <password>
#
# The port the master is listening on.
# optional - defaults to 3306
#master-port     =  <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin

# Point the following paths to different dedicated disks
#tmpdir         = /tmp/
#log-update     = /path-to-dedicated-directory/hostname

# Uncomment the following if you are using BDB tables
#bdb_cache_size = 64M
#bdb_max_lock = 100000

# Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql//var/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql//var/
#innodb_log_arch_dir = /usr/local/mysql//var/
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 256M
#innodb_additional_mem_pool_size = 20M
# Set .._log_file_size to 25 % of buffer pool size
#innodb_log_file_size = 64M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[isamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[myisamchk]
key_buffer = 128M
sort_buffer_size = 128M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout









然后show status

+-----------------------------------+----------+
| Variable_name                     | Value    |
+-----------------------------------+----------+
| Aborted_clients                   | 0        |
| Aborted_connects                  | 0        |
| Binlog_cache_disk_use             | 0        |
| Binlog_cache_use                  | 0        |
| Bytes_received                    | 3492     |
| Bytes_sent                        | 49477    |
| Com_admin_commands                | 0        |
| Com_alter_db                      | 0        |
| Com_alter_table                   | 0        |
| Com_analyze                       | 0        |
| Com_backup_table                  | 0        |
| Com_begin                         | 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_function               | 0        |
| Com_create_index                  | 0        |
| Com_create_table                  | 0        |
| Com_create_user                   | 0        |
| Com_dealloc_sql                   | 0        |
| Com_delete                        | 0        |
| Com_delete_multi                  | 0        |
| Com_do                            | 0        |
| Com_drop_db                       | 0        |
| Com_drop_function                 | 0        |
| Com_drop_index                    | 0        |
| Com_drop_table                    | 0        |
| Com_drop_user                     | 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_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_rename_table                  | 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_savepoint                     | 0        |
| Com_select                        | 41       |
| Com_set_option                    | 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_create_db                | 0        |
| Com_show_create_table             | 0        |
| Com_show_databases                | 0        |
| Com_show_errors                   | 0        |
| Com_show_fields                   | 0        |
| Com_show_grants                   | 0        |
| Com_show_innodb_status            | 0        |
| Com_show_keys                     | 0        |
| Com_show_logs                     | 0        |
| Com_show_master_status            | 0        |
| Com_show_ndb_status               | 0        |
| Com_show_new_master               | 0        |
| Com_show_open_tables              | 0        |
| Com_show_privileges               | 0        |
| Com_show_processlist              | 0        |
| Com_show_slave_hosts              | 0        |
| Com_show_slave_status             | 0        |
| Com_show_status                   | 28       |
| Com_show_storage_engines          | 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_reset                    | 0        |
| Com_stmt_send_long_data           | 0        |
| Com_truncate                      | 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                       | 1485     |
| Created_tmp_disk_tables           | 0        |
| Created_tmp_files                 | 51       |
| Created_tmp_tables                | 8        |
| 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             | 1582     |
| Handler_rollback                  | 0        |
| Handler_savepoint                 | 0        |
| Handler_savepoint_rollback        | 0        |
| Handler_update                    | 0        |
| Handler_write                     | 1707     |
| Innodb_buffer_pool_pages_data     | 25       |
| Innodb_buffer_pool_pages_dirty    | 0        |
| Innodb_buffer_pool_pages_flushed  | 0        |
| Innodb_buffer_pool_pages_free     | 487      |
| Innodb_buffer_pool_pages_latched  | 0        |
| Innodb_buffer_pool_pages_misc     | 0        |
| Innodb_buffer_pool_pages_total    | 512      |
| Innodb_buffer_pool_read_ahead_rnd | 1        |
| Innodb_buffer_pool_read_ahead_seq | 0        |
| Innodb_buffer_pool_read_requests  | 132      |
| Innodb_buffer_pool_reads          | 18       |
| Innodb_buffer_pool_wait_free      | 0        |
| Innodb_buffer_pool_write_requests | 0        |
| Innodb_data_fsyncs                | 3        |
| Innodb_data_pending_fsyncs        | 0        |
| Innodb_data_pending_reads         | 0        |
| Innodb_data_pending_writes        | 0        |
| Innodb_data_read                  | 2592768  |
| Innodb_data_reads                 | 31       |
| Innodb_data_writes                | 3        |
| Innodb_data_written               | 1536     |
| Innodb_dblwr_pages_written        | 0        |
| Innodb_dblwr_writes               | 0        |
| Innodb_log_waits                  | 0        |
| Innodb_log_write_requests         | 0        |
| Innodb_log_writes                 | 1        |
| Innodb_os_log_fsyncs              | 3        |
| Innodb_os_log_pending_fsyncs      | 0        |
| Innodb_os_log_pending_writes      | 0        |
| Innodb_os_log_written             | 512      |
| Innodb_page_size                  | 16384    |
| Innodb_pages_created              | 0        |
| Innodb_pages_read                 | 25       |
| Innodb_pages_written              | 0        |
| 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               | 0        |
| Innodb_rows_inserted              | 0        |
| Innodb_rows_read                  | 0        |
| Innodb_rows_updated               | 0        |
| Key_blocks_not_flushed            | 0        |
| Key_blocks_unused                 | 227379   |
| Key_blocks_used                   | 4581     |
| Key_read_requests                 | 203040   |
| Key_reads                         | 4605     |
| Key_write_requests                | 3061     |
| Key_writes                        | 2973     |
| Last_query_cost                   | 0.000000 |
| Max_used_connections              | 9        |
| Not_flushed_delayed_rows          | 0        |
| Open_files                        | 341      |
| Open_streams                      | 0        |
| Open_tables                       | 187      |
| Opened_tables                     | 0        |
| Prepared_stmt_count               | 0        |
| Qcache_free_blocks                | 281      |
| Qcache_free_memory                | 14483872 |
| Qcache_hits                       | 1867     |
| Qcache_inserts                    | 5538     |
| Qcache_lowmem_prunes              | 0        |
| Qcache_not_cached                 | 345      |
| Qcache_queries_in_cache           | 1274     |
| Qcache_total_blocks               | 2981     |
| Questions                         | 14697    |
| Rpl_status                        | NULL     |
| Select_full_join                  | 0        |
| Select_full_range_join            | 0        |
| Select_range                      | 0        |
| Select_range_check                | 0        |
| Select_scan                       | 8        |
| 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             | 10967    |
| Table_locks_waited                | 18       |
| Tc_log_max_pages_used             | 0        |
| Tc_log_page_size                  | 0        |
| Tc_log_page_waits                 | 0        |
| Threads_cached                    | 7        |
| Threads_connected                 | 2        |
| Threads_created                   | 9        |
| Threads_running                   | 1        |
| Uptime                            | 1514     |
+-----------------------------------+----------+
225 rows in set (0.00 sec)


请大家帮忙看看
另外奇怪的是我的数据库格式都为MyISAM格式的,但show status为什么会出现那么多Innodb的值呢?

大家帮忙看看my.cnf配置是否正确呢?

而且论坛也不是很多人,平时在现也就100来个,数据库最大的大概80万记录这样子

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
发表于 2008-07-26 22:33 |显示全部楼层
当CPU占百分百的时候看一下sql里的进程

show full processlist;

我遇到的极多都是垃圾SQL造成的。

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
发表于 2008-07-26 22:36 |显示全部楼层
如果是INNODB的话改大一些这个值,如果这台机器只有DB服务,可以设为内存的60%-80%

#innodb_buffer_pool_size = 256M

但是在设置前要先将库dump出来,然后再改,然后删除data目录下的INNODB表空间文件

重启动MYSQL。再把库dump回来。

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
发表于 2008-07-26 22:37 |显示全部楼层
INNODB表空间文件名为这样的

ib_开头

论坛徽章:
0
发表于 2008-07-26 22:53 |显示全部楼层
原帖由 枫影谁用了 于 2008-7-26 22:33 发表
当CPU占百分百的时候看一下sql里的进程

show full processlist;

我遇到的极多都是垃圾SQL造成的。



我迟点再导出来看看


不过我昨天大致show processlist;
看了一下
主要比较多的是这个语句
SELECT t.*, f.name FROM cdb_threads t, cdb_forums f WHERE f.fid=t.fid $NotShow AND t.displayorder not in (-1,-2) AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0,

我看了一下cdb_threads的INDEX为如下:
mysql> show index from cdb_threads;
+-------------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+
| Table       | Non_unique | Key_name     | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+
| cdb_threads |          0 | PRIMARY      |            1 | tid          | A         |       30539 |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | digest       |            1 | digest       | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | displayorder |            1 | fid          | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | displayorder |            2 | displayorder | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | displayorder |            3 | lastpost     | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | blog         |            1 | blog         | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | blog         |            2 | authorid     | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | blog         |            3 | dateline     | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | typeid       |            1 | fid          | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | typeid       |            2 | typeid       | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | typeid       |            3 | displayorder | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| cdb_threads |          1 | typeid       |            4 | lastpost     | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
+-------------+------------+--------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+
12 rows in set (0.04 sec)


不知道是否有问题?

论坛徽章:
0
发表于 2008-07-26 22:57 |显示全部楼层
原帖由 枫影谁用了 于 2008-7-26 22:37 发表
INNODB表空间文件名为这样的

ib_开头



我的数据库表都是MyISAM的

文件后缀名cdb_memberfields.frm    cdb_memberfields.MYD  cdb_memberfields.MYI  
类似这样的

论坛徽章:
0
发表于 2008-07-26 22:59 |显示全部楼层
原帖由 枫影谁用了 于 2008-7-26 22:36 发表
如果是INNODB的话改大一些这个值,如果这台机器只有DB服务,可以设为内存的60%-80%

#innodb_buffer_pool_size = 256M

但是在设置前要先将库dump出来,然后再改,然后删除data目录下的INNODB表空间文件

...



呃,都不是innodb的
都是MYISAM的
所以你看 show status出来的是否有问题呢/
mysql> show status;
+-----------------------------------+-----------+
| Variable_name                     | Value     |
+-----------------------------------+-----------+
| Aborted_clients                   | 0         |
| Aborted_connects                  | 0         |
| Binlog_cache_disk_use             | 0         |
| Binlog_cache_use                  | 0         |
| Bytes_received                    | 3637      |
| Bytes_sent                        | 58851     |
| Com_admin_commands                | 0         |
| Com_alter_db                      | 0         |
| Com_alter_table                   | 0         |
| Com_analyze                       | 0         |
| Com_backup_table                  | 0         |
| Com_begin                         | 0         |
| Com_call_procedure                | 0         |
| Com_change_db                     | 1         |
| Com_change_master                 | 0         |
| Com_check                         | 0         |
| Com_checksum                      | 0         |
| Com_commit                        | 0         |
| Com_create_db                     | 0         |
| Com_create_function               | 0         |
| Com_create_index                  | 0         |
| Com_create_table                  | 0         |
| Com_create_user                   | 0         |
| Com_dealloc_sql                   | 0         |
| Com_delete                        | 0         |
| Com_delete_multi                  | 0         |
| Com_do                            | 0         |
| Com_drop_db                       | 0         |
| Com_drop_function                 | 0         |
| Com_drop_index                    | 0         |
| Com_drop_table                    | 0         |
| Com_drop_user                     | 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_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_rename_table                  | 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_savepoint                     | 0         |
| Com_select                        | 42        |
| Com_set_option                    | 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_create_db                | 0         |
| Com_show_create_table             | 0         |
| Com_show_databases                | 0         |
| Com_show_errors                   | 0         |
| Com_show_fields                   | 0         |
| Com_show_grants                   | 0         |
| Com_show_innodb_status            | 0         |
| Com_show_keys                     | 1         |
| Com_show_logs                     | 0         |
| Com_show_master_status            | 0         |
| Com_show_ndb_status               | 0         |
| Com_show_new_master               | 0         |
| Com_show_open_tables              | 0         |
| Com_show_privileges               | 0         |
| Com_show_processlist              | 0         |
| Com_show_slave_hosts              | 0         |
| Com_show_slave_status             | 0         |
| Com_show_status                   | 29        |
| Com_show_storage_engines          | 0         |
| Com_show_tables                   | 1         |
| 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_reset                    | 0         |
| Com_stmt_send_long_data           | 0         |
| Com_truncate                      | 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                       | 3151      |
| Created_tmp_disk_tables           | 0         |
| Created_tmp_files                 | 95        |
| Created_tmp_tables                | 11        |
| 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             | 1942      |
| Handler_rollback                  | 0         |
| Handler_savepoint                 | 0         |
| Handler_savepoint_rollback        | 0         |
| Handler_update                    | 0         |
| Handler_write                     | 2064      |
| Innodb_buffer_pool_pages_data     | 25        |
| Innodb_buffer_pool_pages_dirty    | 0         |
| Innodb_buffer_pool_pages_flushed  | 0         |
| Innodb_buffer_pool_pages_free     | 487       |
| Innodb_buffer_pool_pages_latched  | 0         |
| Innodb_buffer_pool_pages_misc     | 0         |
| Innodb_buffer_pool_pages_total    | 512       |
| Innodb_buffer_pool_read_ahead_rnd | 1         |
| Innodb_buffer_pool_read_ahead_seq | 0         |
| Innodb_buffer_pool_read_requests  | 132       |
| Innodb_buffer_pool_reads          | 18        |
| Innodb_buffer_pool_wait_free      | 0         |
| Innodb_buffer_pool_write_requests | 0         |
| Innodb_data_fsyncs                | 3         |
| Innodb_data_pending_fsyncs        | 0         |
| Innodb_data_pending_reads         | 0         |
| Innodb_data_pending_writes        | 0         |
| Innodb_data_read                  | 2592768   |
| Innodb_data_reads                 | 31        |
| Innodb_data_writes                | 3         |
| Innodb_data_written               | 1536      |
| Innodb_dblwr_pages_written        | 0         |
| Innodb_dblwr_writes               | 0         |
| Innodb_log_waits                  | 0         |
| Innodb_log_write_requests         | 0         |
| Innodb_log_writes                 | 1         |
| Innodb_os_log_fsyncs              | 3         |
| Innodb_os_log_pending_fsyncs      | 0         |
| Innodb_os_log_pending_writes      | 0         |
| Innodb_os_log_written             | 512       |
| Innodb_page_size                  | 16384     |
| Innodb_pages_created              | 0         |
| Innodb_pages_read                 | 25        |
| Innodb_pages_written              | 0         |
| 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               | 0         |
| Innodb_rows_inserted              | 0         |
| Innodb_rows_read                  | 0         |
| Innodb_rows_updated               | 0         |
| Key_blocks_not_flushed            | 0         |
| Key_blocks_unused                 | 225796    |
| Key_blocks_used                   | 6164      |
| Key_read_requests                 | 437742    |
| Key_reads                         | 6191      |
| Key_write_requests                | 3555      |
| Key_writes                        | 3328      |
| Last_query_cost                   | 10.499000 |
| Max_used_connections              | 11        |
| Not_flushed_delayed_rows          | 0         |
| Open_files                        | 361       |
| Open_streams                      | 0         |
| Open_tables                       | 206       |
| Opened_tables                     | 0         |
| Prepared_stmt_count               | 0         |
| Qcache_free_blocks                | 549       |
| Qcache_free_memory                | 13447632  |
| Qcache_hits                       | 4343      |
| Qcache_inserts                    | 11201     |
| Qcache_lowmem_prunes              | 0         |
| Qcache_not_cached                 | 677       |
| Qcache_queries_in_cache           | 2104      |
| Qcache_total_blocks               | 4914      |
| Questions                         | 29439     |
| Rpl_status                        | NULL      |
| Select_full_join                  | 0         |
| Select_full_range_join            | 0         |
| Select_range                      | 0         |
| Select_range_check                | 0         |
| Select_scan                       | 11        |
| 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             | 21152     |
| Table_locks_waited                | 47        |
| Tc_log_max_pages_used             | 0         |
| Tc_log_page_size                  | 0         |
| Tc_log_page_waits                 | 0         |
| Threads_cached                    | 1         |
| Threads_connected                 | 10        |
| Threads_created                   | 13        |
| Threads_running                   | 6         |
| Uptime                            | 3325      |
+-----------------------------------+-----------+
225 rows in set (1.12 sec)

论坛徽章:
0
发表于 2008-07-26 23:03 |显示全部楼层
刚刚突然间慢下来
我show processlist 看了一下
主要如下
mysql> show processlist;
+------+-----------+-----------+------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+
| Id   | User      | Host      | db         | Command | Time | State                | Info                                                                                                 |
+------+-----------+-----------+------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+
|  185 | szxnmysql | localhost | szxndiscuz | Query   |    0 | NULL                 | show processlist                                                                                     |
| 3075 | szxnmysql | localhost | szxndiscuz | Sleep   |  256 |                      | NULL                                                                                                 |
| 3304 | szxnmysql | localhost | szxndiscuz | Query   |   33 | Copying to tmp table | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3307 | szxnmysql | localhost | szxndiscuz | Query   |   32 | Copying to tmp table | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3318 | szxnmysql | localhost | szxndiscuz | Query   |   24 | Sorting result       | SELECT p.*,m.username,m.adminid,m.groupid,m.credits FROM cdb_posts p LEFT JOIN cdb_members m ON m.ui |
| 3328 | szxnmysql | localhost | szxndiscuz | Query   |   19 | Locked               | UPDATE cdb_threads SET lastposter='??????', lastpost='1217084339', replies=replies+1 , subscribed='0 |
| 3330 | szxnmysql | localhost | szxndiscuz | Query   |   17 | Locked               | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3331 | szxnmysql | localhost | szxndiscuz | Query   |   15 | Locked               | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3335 | szxnmysql | localhost | szxndiscuz | Query   |   13 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3336 | szxnmysql | localhost | szxndiscuz | Query   |   13 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3337 | szxnmysql | localhost | szxndiscuz | Query   |   11 | Locked               | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3339 | szxnmysql | localhost | szxndiscuz | Query   |    9 | Locked               | SELECT t.* FROM cdb_threads t
                WHERE t.tid IN (3366,24640,29321,28806) AND t.displayorder IN (2, 3 |
| 3340 | szxnmysql | localhost | szxndiscuz | Query   |   10 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3342 | szxnmysql | localhost | szxndiscuz | Query   |    9 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3343 | szxnmysql | localhost | szxndiscuz | Query   |    8 | Locked               | UPDATE cdb_members SET credits='784' WHERE uid='910'                                                 |
| 3347 | szxnmysql | localhost | szxndiscuz | Query   |    3 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3348 | szxnmysql | localhost | szxndiscuz | Query   |    2 | Locked               | SELECT t.tid, t.closed, t.dateline, t.special, t.lastpost AS lastthreadpost,  f.*, ff.*  , f.fid AS  |
| 3349 | szxnmysql | localhost | uchome     | Query   |    1 | update               | INSERT INTO uchome_log (`id`, `idtype`) VALUES ('865', 'uid')                                        |
+------+-----------+-----------+------------+---------+------+----------------------+------------------------------------------------------------------------------------------------------+
18 rows in set (0.00 sec)

mysql> show processlist;
+------+-----------+-----------+------------+---------+------+-------------------+------------------------------------------------------------------------------------------------------+
| Id   | User      | Host      | db         | Command | Time | State             | Info                                                                                                 |
+------+-----------+-----------+------------+---------+------+-------------------+------------------------------------------------------------------------------------------------------+
|  185 | szxnmysql | localhost | szxndiscuz | Query   |    0 | NULL              | show processlist                                                                                     |
| 3075 | szxnmysql | localhost | szxndiscuz | Sleep   |  280 |                   | NULL                                                                                                 |
| 3330 | szxnmysql | localhost | szxndiscuz | Query   |   41 | Sorting for group | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3331 | szxnmysql | localhost | szxndiscuz | Query   |   39 | Sorting for group | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3337 | szxnmysql | localhost | szxndiscuz | Query   |   35 | Sorting for group | SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM cdb_attachments attach LEFT JOIN  |
| 3354 | szxnmysql | localhost | szxndiscuz | Query   |   12 | Sending data      | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3361 | szxnmysql | localhost | szxndiscuz | Query   |    8 | Locked            | UPDATE cdb_members SET newpm='0' WHERE uid='910'                                                     |
| 3362 | szxnmysql | localhost | szxndiscuz | Query   |    5 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3363 | szxnmysql | localhost | szxndiscuz | Query   |    5 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3364 | szxnmysql | localhost | szxndiscuz | Query   |    4 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3366 | szxnmysql | localhost | szxndiscuz | Query   |    4 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3368 | szxnmysql | localhost | szxndiscuz | Sleep   |    1 |                   | NULL                                                                                                 |
| 3370 | szxnmysql | localhost | szxndiscuz | Query   |    1 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
| 3371 | szxnmysql | localhost | szxndiscuz | Sleep   |    1 |                   | NULL                                                                                                 |
| 3372 | szxnmysql | localhost | szxndiscuz | Query   |    1 | Locked            | SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestpos |
+------+-----------+-----------+------------+---------+------+-------------------+------------------------------------------------------------------------------------------------------+
15 rows in set (0.00 sec)

论坛徽章:
1
白银圣斗士
日期:2015-11-23 08:33:04
发表于 2008-07-26 23:27 |显示全部楼层
原帖由 zcongwei 于 2008-7-26 23:03 发表
刚刚突然间慢下来
我show processlist 看了一下
主要如下
mysql> show processlist;
+------+-----------+-----------+------------+---------+------+----------------------+--------------------------- ...


uptime的结果呢?现在负载是多少?

论坛徽章:
0
发表于 2008-07-26 23:38 |显示全部楼层
唉 刚才很慢的时候忘了看负载
和 cpu use等
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP