最近突然出现:网站运行30-40分钟就需要重启一次MYsql服务,网站才能正常访问,求解决方法!!

最近突然出现:网站运行30-40分钟就需要重启一次MYsql服务,网站才能正常访问,求解决方法!!
服务器配置:CPU*4 内存 4 G

windows 2008 ymsql版本:5.5.48
重启后的 mysqld.exe 任务管理器中的工作设置(内存)为171136K 进程数为28 ,运行40分钟左右,工作设置(内存)为216898K,进程数为123 网站此时已无法访问,需要重启mysql服务后才能恢复正常。

以下是我目前的My.ini文件配置:

Example MySQL config file for very large systems.

#

This is for a large system with memory of 1G-2G where the system runs mainly

MySQL.

#

MySQL programs look for option files in a set of

locations which depend on the deployment platform.

You can copy this option file to one of those

locations. For information about these locations, see:

http://dev.mysql.com/doc/mysql/en/option-files.html

#

In this file, you can use all long options that a program supports.

If you want to know which options a program supports, run the program

with the "--help" option.

The following options will be passed to all MySQL clients

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

Here follows entries for some specific programs

The MySQL server

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 512M
max_allowed_packet = 2M
table_open_cache = 512
sort_buffer_size = 32M
read_buffer_size = 32M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 64
query_cache_size = 64M

Try number of CPU's*2 for thread_concurrency

thread_concurrency = 16
basedir= D:\SOFT_PHP_PACKAGE\mysql
datadir= D:\SOFT_PHP_PACKAGE\mysql\data
max_connections = 1000

Don't listen on a TCP/IP port at all. This can be a security enhancement,

if all processes that need to connect to mysqld run on the same host.

All interaction with mysqld must be made via Unix sockets or named pipes.

Note that using this option without enabling named pipes on Windows

(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=, MASTER_PORT=,

MASTER_USER=, MASTER_PASSWORD= ;

#

where you replace , , by quoted strings and

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 =
#

The username the slave will use for authentication when connecting

to the master - required

#master-user =
#

The password the slave will authenticate with when connecting to

the master - required

#master-password =
#

The port the master is listening on.

optional - defaults to 3306

#master-port =
#

binary logging - not required for slaves, but recommended

#log-bin=mysql-bin
#

binary logging format - mixed recommended

#binlog_format=mixed

Uncomment the following if you are using InnoDB tables

#innodb_data_home_dir = C:\mysql\data\
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = C:\mysql\data\

You can set .._buffer_pool_size up to 50 - 80 %

of RAM but beware of setting memory usage too high

#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M

Set .._log_file_size to 25 % of buffer pool size

#innodb_log_file_size = 100M
#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

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

经过了一次调整为以下(但是问题还存在)

Example MySQL config file for very large systems.

#

This is for a large system with memory of 1G-2G where the system runs mainly

MySQL.

#

MySQL programs look for option files in a set of

locations which depend on the deployment platform.

You can copy this option file to one of those

locations. For information about these locations, see:

http://dev.mysql.com/doc/mysql/en/option-files.html

#

In this file, you can use all long options that a program supports.

If you want to know which options a program supports, run the program

with the "--help" option.

The following options will be passed to all MySQL clients

[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock

Here follows entries for some specific programs

The MySQL server

[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 1024M
max_allowed_packet = 4M
table_open_cache = 1024
sort_buffer_size = 64M
read_buffer_size = 64M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 128M
thread_cache_size = 128
query_cache_size = 128M

Try number of CPU's*2 for thread_concurrency

thread_concurrency = 16
basedir= D:\SOFT_PHP_PACKAGE\mysql
datadir= D:\SOFT_PHP_PACKAGE\mysql\data
max_connections = 10000
#log
#long_query_time =2 --是指执行超过多久的sql会被log下来,这里是2秒
#log-slow-queries= /usr/local/mysql/log/slowquery.log --将查询返回较慢的语句进行记录
#log-queries-not-using-indexes = nouseindex.log --就是字面意思,log下来没有使用索引的query
#log=mylog.log --对所有执行语句进行记录
log-error="D:/SOFT_PHP_PACKAGE/mysql/logs/error.log"

#log="D:/SOFT_PHP_PACKAGE/mysql/logs/mysql.log"

long_query_time=5

log-slow-queries= "D:/SOFT_PHP_PACKAGE/mysql/logs/slowquery.log"

Don't listen on a TCP/IP port at all. This can be a security enhancement,

if all processes that need to connect to mysqld run on the same host.

All interaction with mysqld must be made via Unix sockets or named pipes.

Note that using this option without enabling named pipes on Windows

(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=, MASTER_PORT=,

MASTER_USER=, MASTER_PASSWORD= ;

#

where you replace , , by quoted strings and

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 =
#

The username the slave will use for authentication when connecting

to the master - required

#master-user =
#

The password the slave will authenticate with when connecting to

the master - required

#master-password =
#

The port the master is listening on.

optional - defaults to 3306

#master-port =
#

binary logging - not required for slaves, but recommended

#log-bin=mysql-bin
#

binary logging format - mixed recommended

#binlog_format=mixed

Uncomment the following if you are using InnoDB tables

#innodb_data_home_dir = C:\mysql\data\
#innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
#innodb_log_group_home_dir = C:\mysql\data\

You can set .._buffer_pool_size up to 50 - 80 %

of RAM but beware of setting memory usage too high

#innodb_buffer_pool_size = 384M
#innodb_additional_mem_pool_size = 20M

Set .._log_file_size to 25 % of buffer pool size

#innodb_log_file_size = 100M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit = 1
#innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 64M

[mysql]
no-auto-rehash

Remove the next comment character if you are not familiar with SQL

#safe-updates

[myisamchk]
key_buffer_size = 1024M
sort_buffer_size = 1024M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
interactive-timeout

问题步充:每次产生异常时,资源监视器中mysqld.exe 的线程数从剧增至123左右,CPU资源迅速升高,直致网站访问无响应,需要重启Mysql后方能正常一段时间

产生的慢查询日志:
MySQL, Version: 5.5.48-log (MySQL Community Server (GPL)). started with:
TCP Port: 3306, Named Pipe: /tmp/mysql.sock
Time Id Command Argument

Time: 161018 14:43:10

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.187500 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 5112

use bluearc;
SET timestamp=1476772990;
SELECT * FROM pre_forum_thread WHERE fid='5' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10, 10;

Time: 161018 14:43:21

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 33.687500 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 178253

SET timestamp=1476773001;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772967-60;

Time: 161018 14:43:24

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.281250 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 5102

SET timestamp=1476773004;
SELECT * FROM pre_forum_thread WHERE fid='5' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10;

Time: 161018 14:43:28

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 8.250000 Lock_time: 0.000000 Rows_sent: 30 Rows_examined: 3898

SET timestamp=1476773008;
SELECT * FROM pre_forum_thread WHERE fid='47' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 30;

Time: 161018 14:43:35

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 13.531250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 26951

SET timestamp=1476773015;
SELECT t.tid, t.closed, t.author, t.authorid FROM pre_forum_thread t WHERE t.fid IN ('68','82','29','4','73','64','5','30','47','43','52','67','54','65','55','17','59','81','63','45','25','72','28','61') AND t.displayorder>='0' AND (0 OR t.subject LIKE '%��%') ORDER BY tid DESC LIMIT 500;

Time: 161018 14:43:48

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 6.578125 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 1644

SET timestamp=1476773028;
SELECT * FROM pre_forum_thread WHERE fid='29' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10;

Time: 161018 14:43:49

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.437500 Lock_time: 0.000000 Rows_sent: 30 Rows_examined: 4198

SET timestamp=1476773029;
SELECT * FROM pre_forum_thread WHERE fid='47' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 300, 30;

新产生的慢查询日志:
MySQL, Version: 5.5.48-log (MySQL Community Server (GPL)). started with:
TCP Port: 3306, Named Pipe: /tmp/mysql.sock
Time Id Command Argument

Time: 161018 14:43:10

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.187500 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 5112

use bluearc;
SET timestamp=1476772990;
SELECT * FROM pre_forum_thread WHERE fid='5' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10, 10;

Time: 161018 14:43:21

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 33.687500 Lock_time: 0.000000 Rows_sent: 1 Rows_examined: 178253

SET timestamp=1476773001;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772967-60;

Time: 161018 14:43:24

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.281250 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 5102

SET timestamp=1476773004;
SELECT * FROM pre_forum_thread WHERE fid='5' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10;

Time: 161018 14:43:28

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 8.250000 Lock_time: 0.000000 Rows_sent: 30 Rows_examined: 3898

SET timestamp=1476773008;
SELECT * FROM pre_forum_thread WHERE fid='47' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 30;

Time: 161018 14:43:35

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 13.531250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 26951

SET timestamp=1476773015;
SELECT t.tid, t.closed, t.author, t.authorid FROM pre_forum_thread t WHERE t.fid IN ('68','82','29','4','73','64','5','30','47','43','52','67','54','65','55','17','59','81','63','45','25','72','28','61') AND t.displayorder>='0' AND (0 OR t.subject LIKE '%��%') ORDER BY tid DESC LIMIT 500;

Time: 161018 14:43:48

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 6.578125 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 1644

SET timestamp=1476773028;
SELECT * FROM pre_forum_thread WHERE fid='29' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 10;

Time: 161018 14:43:49

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 7.437500 Lock_time: 0.000000 Rows_sent: 30 Rows_examined: 4198

SET timestamp=1476773029;
SELECT * FROM pre_forum_thread WHERE fid='47' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 300, 30;

Time: 161018 14:45:26

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 6.468750 Lock_time: 0.000000 Rows_sent: 10 Rows_examined: 5122

SET timestamp=1476773126;
SELECT * FROM pre_forum_thread WHERE fid='5' AND displayorder IN('0','1') ORDER BY displayorder DESC, dateline DESC LIMIT 20, 10;

Time: 161018 14:46:21

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 157.046875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25400

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773022-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 119.546875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16405

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773061-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 128.828125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18412

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773050-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.312500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30383

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 151.671875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 23959

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773028-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 153.468750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 24566

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773026-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 206.328125 Lock_time: 0.015625 Rows_sent: 0 Rows_examined: 54788

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772974-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 147.437500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22793

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773032-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 201.328125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 48942

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772979-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 191.968750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 40661

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772988-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 198.937500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 45511

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772981-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.046875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30471

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 199.828125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 46515

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772980-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 212.437500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 148435

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772968-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 126.437500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18070

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773054-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 145.093750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22198

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773035-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 155.781250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25102

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773023-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 144.531250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 21902

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773036-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 139.296875 Lock_time: 0.015625 Rows_sent: 0 Rows_examined: 20646

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773041-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 140.703125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 21014

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773038-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 154.718750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 24879

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773024-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 196.140625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 42889

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772984-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 168.640625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 29440

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773011-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 123.562500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17295

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773057-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 160.109375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 26226

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773019-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 207.421875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 57038

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772973-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 180.531250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 34475

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772999-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 163.625000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 27485

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773016-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 140.140625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20840

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773039-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 149.593750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 23381

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773031-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 139.515625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20728

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773040-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 208.515625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 59287

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772972-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 165.046875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 27954

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773015-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 122.140625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16947

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773058-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 134.671875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 19401

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773046-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 136.671875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 19899

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773044-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 123.796875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17325

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773057-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 145.437500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22259

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773035-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 168.203125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 29268

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773012-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 121.140625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16702

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773059-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 127.906250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18265

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773052-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 197.250000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 43594

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772983-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 125.640625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17755

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773055-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 152.828125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 24336

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773027-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 167.781250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 29032

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773012-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 139.578125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20720

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773040-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.453125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30452

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 210.312500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 70519

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772970-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 155.296875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25042

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773024-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 130.859375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18746

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773049-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 124.609375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17522

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773056-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 154.968750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25163

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773024-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 151.109375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 23791

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773029-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 126.984375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18091

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773053-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 120.687500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16601

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773060-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 155.296875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25043

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773024-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 133.718750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 19146

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773047-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 146.281250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22535

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773034-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 209.140625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 60556

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772971-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 148.109375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22885

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773032-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 202.500000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 50066

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772978-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.375000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30577

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 135.671875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 19631

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773045-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 126.156250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17886

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773054-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 130.671875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18697

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773049-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 139.453125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20690

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773041-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 165.906250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 28211

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773014-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 203.125000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 50856

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772977-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 135.421875 Lock_time: 0.015625 Rows_sent: 0 Rows_examined: 19534

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773045-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 138.218750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20330

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773042-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 147.312500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 22707

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773033-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 120.218750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16560

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773060-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.515625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30422

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 127.843750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18227

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773052-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 128.234375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18349

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773051-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 208.171875 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 58011

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772972-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 191.484375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 39909

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772989-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 129.687500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18508

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773050-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 123.218750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17170

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773057-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 140.062500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 20809

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773039-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 168.640625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 29614

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773011-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 202.265625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 49496

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772978-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 127.906250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 18239

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773052-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 158.312500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25667

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773021-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 121.734375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 16826

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773059-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 122.765625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 17090

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773058-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 162.984375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 27130

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773017-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 154.281250 Lock_time: 0.015625 Rows_sent: 0 Rows_examined: 24701

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773025-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 198.234375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 44474

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772982-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 166.859375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 28694

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773013-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 155.359375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 24998

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773024-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 135.968750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 19809

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773044-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 180.843750 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 34587

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772999-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.062500 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30184

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 198.531250 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 44825

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476772982-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 171.109375 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 30297

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773009-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 143.250000 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 21448

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773037-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 151.390625 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 25338

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773029-60;

User@Host: bluearc[bluearc] @ localhost [127.0.0.1]

Query_time: 153.578125 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 24495

SET timestamp=1476773181;
SELECT COUNT(*) FROM pre_common_searchindex WHERE srchmod=2 AND dateline>1476773026-60;
MySQL, Version: 5.5.48-log (MySQL Community Server (GPL)). started with:
TCP Port: 3306, Named Pipe: /tmp/mysql.sock
Time Id Command Argument

会不会是session打开了太多,没有关

优化你的慢查询sql,比如创建索引。拆分表格。减少多表join查询

数据库连接没关闭,程序问题

补充锁死时的线程:
mysql> show processlist;
+------+-----------+-----------------+-----------+---------+------+--------------+--------------------------------------
--------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info
|
+------+-----------+-----------------+-----------+---------+------+--------------+--------------------------------------
--------------------------------------------------+
| 3957 | 651100com | localhost:52394 | 651100com | Query | 594 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042966-60 |
| 3958 | 651100com | localhost:52395 | 651100com | Query | 594 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042966-60 |
| 3963 | 651100com | localhost:52400 | 651100com | Query | 593 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042967-60 |
| 3964 | 651100com | localhost:52401 | 651100com | Query | 593 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042967-60 |
| 3965 | 651100com | localhost:52403 | 651100com | Query | 592 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042968-60 |
| 3966 | 651100com | localhost:52404 | 651100com | Query | 592 | Sending data | SELECT COUNT(*) FROM pre_common_searc
hindex WHERE srchmod=2 AND dateline>1477042968-60 |