昨天有了第一篇的测试之后,仅仅是一个开始。
我接下来做sysbench压测的主要思路是根据现有的配置作出调整,能够持续性的优化和压力测试达到目的,而不是简单的去对比连接数在不同数量级会有多大的差别,所以你会在里面看到一些问题的排查,一些问题的解决,可能有些又不是压测相关的。
我设置了max_connections为3000,但是压测的时候到了300个线程就跑不上去了。这个问题很有典型性。
sysbench抛出的错误如下:
FATAL: mysql_stmt_prepare() failed FATAL: MySQL error: 1461 "Can't create more than max_prepared_stmt_count statements (current value: 16382)" FATAL: `thread_init' function failed: /usr/local/share/sysbench/oltp_common.lua:282: SQL API errorMySQL的错误日志信息如下:
2017-03-14T15:01:57.839154Z 348 [Note] Aborted connection 348 to db:
'sysbenchtest' user: 'root' host: 'localhost' (Got an error reading
communication packets) 2017-03-14T15:01:57.839185Z 346 [Note] Aborted
connection 346 to db: 'sysbenchtest' user: 'root' host: 'localhost'
(Got an error reading communication packets)看起来两者关联不大,所以有些信息就会有一些误导了。 根据错误的信息,当前的参数max_prepared_stmt_count设置值为16382,是安装后的默认值。
mysql
|