iis服务器助手广告广告
返回顶部
首页 > 资讯 > 数据库 >mysql sysben0.5的安装和测试步骤
  • 836
分享到

mysql sysben0.5的安装和测试步骤

2024-04-02 19:04:59 836人浏览 薄情痞子
摘要

这篇文章主要介绍“Mysql sysben0.5的安装和测试步骤”,在日常操作中,相信很多人在mysql sysben0.5的安装和测试步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望

这篇文章主要介绍“Mysql sysben0.5的安装和测试步骤”,在日常操作中,相信很多人在mysql sysben0.5的安装和测试步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”mysql sysben0.5的安装和测试步骤”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

安装sysbench 

OS readhat 6.4

mysql版本5.7

mysql安装目录

下载安装包 https://GitHub.com/akopytov/sysbench

shell> wget Https://github.com/akopytov/sysbench/arcHive/1.0.zip -O "sysbench-1.0.zip"

2. 安装依赖包 

# yum -y install  make automake libtool pkGConfig libaio-devel vim-common

3、上传到linux系统中(/usr/local/),并且解压,进入/usr/local/执行:

p unzip sysbench-0.5.zip -d  /usr/local

4、创建sysbench安装目录文件夹:

5、进入/usr/local/sysbench-master/执行:./autogen.sh

# cd /usr/local/sysbench-0.5

# ./autogen.sh

6.

#./configure --prefix=/usr/local/sysbench-0.5 --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib/;

7.

#  make

8.

# make install

9.查看版本

[root@msyqlzhu sysbench-0.5]# /usr/local/sysbench-0.5/bin/sysbench version

sysbench 0.5

如果出现:(sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory)报错,

则在(vim /etc/profile 中加入:export LD_LIBRARY_PATH=/usr/local/mysql/lib/)

常用参数: 

#-test=tests/db/oltp.lua 表示调用 tests/db/oltp.lua 脚本进行 oltp 模式测试

#--oltp_tables_count=10 表示会生成 10 个测试表

#--oltp-table-size=100000 表示每个测试表填充数据量为 100000 

#--rand-init=on 表示每个测试表都是用随机数据来填充的

#-num-threads=8 表示发起 8个并发连接

#--oltp-read-表示不要进行只读测试,也就是会采用读写混合模式测试

#--report-interval=10 表示每10秒输出一次测试进度报告

#--rand-type=unifORM 表示随机类型为固定模式,其他几个可选随机模式:uniform(固定),gaussian(高斯),special(特定的),pareto(帕累托)

#--max-time=120 表示最大执行时长为 120秒

#--max-requests=0 表示总请求数为 0,因为上面已经定义了总执行时长,所以总请求数可以设定为 0;也可以只设定总请求数,不设定最大执行时长

#--percentile=99 表示设定采样比例,默认是 95%,即丢弃1%的长请求,在剩余的99%里取最大值

测试文件IO

测试cpu的CPU测试使用64位整数,测试计算素数直到某个最大值所需要的时间。

# /usr/local/sysbench-0.5/bin/sysbench --test=cpu --cpu-max-prime=20000 run

 General statistics:

    total time:                          26.8631s

    total number of events:              10000

    total time taken by event execution: 26.8434s

    response time:

         min:                                  2.24ms

         avg:                                  2.68ms

         max:                                  7.49ms

         approx.  95 percentile:               3.20ms

Threads fairness:

    events (avg/stddev):           10000.0000/0.00

    execution time (avg/stddev):   26.8434/0.00

1.测试线程

[root@msyqlzhu t]# /usr/local/sysbench-0.5/bin/sysbench --test=threads --num-threads=64 run 

sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 64

Random number generator seed is 0 and will be ignored

Initializing worker threads...

Threads started!

General statistics:

    total time:                          5.2132s

    total number of events:              10000

    total time taken by event execution: 332.6492s

    response time:

         min:                                  0.23ms

         avg:                                 33.26ms

         max:                                282.98ms

         approx.  95 percentile:              87.66ms

Threads fairness:

    events (avg/stddev):           156.2500/5.53

    execution time (avg/stddev):   5.1976/0.01

2.互斥测试互斥锁(mutex)

/usr/local/sysbench-0.5/bin/sysbench --test=mutex --num-threads=16 --mutex-num=2048 --mutex-locks=1000000 --mutex-loops=5000 run

sysbench 0.5:  multi-threaded system evaluation benchmark

Running the test with following options:

Number of threads: 16

Random number generator seed is 0 and will be ignored

Initializing worker threads...

Threads started!

General statistics:

    total time:                          2.5536s

    total number of events:              16

    total time taken by event execution: 39.6446s

    response time:

         min:                               2348.59ms

         avg:                               2477.79ms

         max:                               2553.24ms

         approx.  95 percentile:            2549.79ms

Threads fairness:

    events (avg/stddev):           1.0000/0.00

    execution time (avg/stddev):   2.4778/0.07

3.内存测试

 [root@msyqlzhu ~]# /usr/local/sysbench-0.5/bin/sysbench --test=memory --memory-block-size=8K --memory-total-size=1G  --num-threads=16 run

4. 文件IO基准测试

 共1G

 [root@msyqlzhu ~]# /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-total-size=1G prepare

 1073741824 bytes written in 8.15 seconds (125.60 MB/sec).

 测试文件IO 4个文件共4G

 [root@msyqlzhu ~]#  /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-num=4 --file-total-size=4G prepare

 4261412864 bytes written in 6.52 seconds (623.68 MB/sec).

 测试文件IO 4个文件共4G.块大小为16K

 [root@msyqlzhu ~]#  /usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-num=4 --file-block-size=16384 --file-total-size=4G prepare

这个命令会在当前工作目录下创建测试文件,后续的运行(run)阶段将通过读写这些文件进行测试。 第二步就是运行(run)阶段,针对不同的IO 类型有不同的测试选项:

seqwr 顺序写入

seqrewr 顺序重写

seqrd 顺序读取

rndrd 随机读取

rndwr 随机写入

rndrw 混合随机读/写

下面的命令运行文件I/O混合随机读/写基准测试:

混合随机读/写

/usr/local/sysbench-0.5/bin/sysbench --test=fileio --file-total-size=4G --file-test-mode=rndrw  --init-rng=on --max-time=300 --max-requests=0 run

清除测试的文件

/usr/local/sysbench-0.5/bin/sysbench --test=fileio --fil-total-size=30G cleanup

测试oltp

1.找到select.lua脚本路径

[root@msyqlzhu t]# find / -name oltp.lua

/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua

2.创建测试的时候默认用sbtest库

> create database sbtest;

3.prepare生成数据和表

使用的参数

--oltp-table-size 生成的表的记录数

--oltp-tables-count生成的表的个数

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua  --oltp-table-size=100000  --mysql-user=root --oltp-tables-count=10 --mysql-passWord=oracle --mysql-Socket=/mysqldata/mysql/data/mysql.sock prepare

4.run运行

也可使用parallel_prepare.lua脚本并行准备测试数据, 

运行时使用的参数

--oltp-dist-pct 热点数据的比例

--oltp-dist-res 热点数据访问频率

--num-threads   线程数

--max-time=3000   执行时间

--report-interval  打印报告的时间间隔

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua --num-threads=20 --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=100 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --max-time=3000 --max-requests=0 --report-interval=3 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock run

生成的报告,tps:约为495,响应时间response time约为380毫秒,qps约为6千多

[ 141s] threads: 100, tps: 481.38, reads: 6728.28, writes: 2001.18, response time: 369.82ms (95%), errors: 0.33, reconnects:  0.00

[ 144s] threads: 100, tps: 495.94, reads: 6958.09, writes: 1970.41, response time: 339.89ms (95%), errors: 0.00, reconnects:  0.00

[ 147s] threads: 100, tps: 513.72, reads: 7193.10, writes: 2076.22, response time: 326.33ms (95%), errors: 0.33, reconnects:  0.00

[ 150s] threads: 100, tps: 494.33, reads: 6921.66, writes: 1971.33, response time: 333.44ms (95%), errors: 0.33, reconnects:  0.00

[ 153s] threads: 100, tps: 441.32, reads: 6032.87, writes: 1685.30, response time: 396.06ms (95%), errors: 0.00, reconnects:  0.00

[ 156s] threads: 100, tps: 502.62, reads: 7007.69, writes: 2000.82, response time: 398.92ms (95%), errors: 0.00, reconnects:  0.00

[ 159s] threads: 100, tps: 428.68, reads: 6192.48, writes: 1805.71, response time: 365.53ms (95%), errors: 0.00, reconnects:  0.00

[ 162s] threads: 100, tps: 438.70, reads: 6140.14, writes: 1777.47, response time: 586.58ms (95%), errors: 0.33, reconnects:  0.00

[ 165s] threads: 100, tps: 495.63, reads: 6928.11, writes: 1951.51, response time: 380.04ms (95%), errors: 0.00, reconnects:  0.00

5.clearnup

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/oltp.lua  --oltp-table-size=100000 --mysql-db=sbtest --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE --mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup

测试select 

1.prepare生成数据

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua  --oltp-table-size=10000000  --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE --mysql-socket=/mysqldata/mysql/data/mysql.sock prepare

2.run运行

运行时使用的参数

--oltp-dist-pct 热点数据的比例

--oltp-dist-res 热点数据访问频率

--num-threads   线程数

--max-time=3000   执行时间

--report-interval  打印报告的时间间隔

打印的报告种的reads表示qps,response time表示响应时间

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua --num-threads=20 --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=10 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --max-time=3000 --max-requests=0 --report-interval=3 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock run

[  84s] threads: 100, tps: 0.00, reads: 22529.11, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

[  87s] threads: 100, tps: 0.00, reads: 22455.45, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

[  90s] threads: 100, tps: 0.00, reads: 22569.36, writes: 0.00, response time: 0.13ms (95%), errors: 0.00, reconnects:  0.00

[  93s] threads: 100, tps: 0.00, reads: 21957.72, writes: 0.00, response time: 0.15ms (95%), errors: 0.00, reconnects:  0.00

[  96s] threads: 100, tps: 0.00, reads: 21588.06, writes: 0.00, response time: 0.14ms (95%), errors: 0.00, reconnects:  0.00

cleanup

# /usr/local/sysbench-0.5/bin/sysbench --test=/usr/local/sysbench-0.5/sysbench/tests/db/select.lua --oltp-dist-pct=1  --oltp-dist-res=75 --oltp-table-size=100000  --num-threads=10 --mysql-db=sbtest  --mysql-user=root --oltp-tables-count=10 --mysql-password=ORACLE  --mysql-socket=/mysqldata/mysql/data/mysql.sock cleanup

常用参数:

Run的时候常用的参数

–oltp-tables-count

–oltp-read-only 仅执行SELECT测试 on | off,默认为off

–oltp-dist-type 随机数分布状态。uniform(均匀分布)、gauss(高斯分布)、special(特殊分布)

–oltp-dist-pct 特殊分布的百分比值

–oltp-dist-res 特殊分布的百分比

–oltp-point-selects 单个事务中指定的selec查询个数

–oltp-range-size 范围查询的范围大小,该值应比oltp-table-size小

–oltp-simple-ranges 单个事务中指定的简单范围查询个数

–oltp-sum-ranges 单个事务中指定的SUM范围查询个数

–oltp-order-ranges 单个事务中指定的ORDER范围查询个数

–oltp-distinct-ranges 单个事务中指定的DISTINCT范围查询个数

–oltp-index-updates 单个事务中指定的使用索引更新的个数

–oltp-non-index-updates 单个事务中指定的不使用索引更新的个数

到此,关于“mysql sysben0.5的安装和测试步骤”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程网网站,小编会继续努力为大家带来更多实用的文章!

您可能感兴趣的文档:

--结束END--

本文标题: mysql sysben0.5的安装和测试步骤

本文链接: https://www.lsjlt.com/news/60069.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • mysql sysben0.5的安装和测试步骤
    这篇文章主要介绍“mysql sysben0.5的安装和测试步骤”,在日常操作中,相信很多人在mysql sysben0.5的安装和测试步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望...
    99+
    2024-04-02
  • MySQL 安装后设置和测试
    让我们看看成功安装 MySQL 后需要完成的安装后设置和测试 -安装 MySQL 后,执行以下步骤数据目录如果需要,必须初始化数据目录并创建MySQL 授权表。对于某些MySQL安装方法,数据目录初始化是自动完成的。MySQL安装程序Win...
    99+
    2023-10-22
  • CentOS7.3安装MySQL的步骤
    这篇文章主要介绍“CentOS7.3安装MySQL的步骤”,在日常操作中,相信很多人在CentOS7.3安装MySQL的步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ce...
    99+
    2024-04-02
  • MYSQL MGR的安装步骤
    本篇内容介绍了“MYSQL MGR的安装步骤”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!########...
    99+
    2024-04-02
  • MySQL在Centos的卸载和安装步骤
    本篇内容主要讲解“MySQL在Centos的卸载和安装步骤”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQL在Centos的卸载和安装步骤”吧!MySQL...
    99+
    2024-04-02
  • MySQL下载和安装详细步骤
    下载步骤详解 本教程以 MySQL 5.7.29 为例介绍其在 Windows 10 操作系统下的安装和配置过程。 步骤 1):打开 MySQL 官方网站(http://www.mysql.com) 步骤 2):滑到网页底部,点击 DOWN...
    99+
    2023-10-18
    mysql 数据库
  • Mysql-5.5.32 cmake安装的步骤
    这篇文章主要介绍“Mysql-5.5.32 cmake安装的步骤”,在日常操作中,相信很多人在Mysql-5.5.32 cmake安装的步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望...
    99+
    2024-04-02
  • linux下mysql的安装步骤
    1.mysql tar文件下载: https://dev.mysql.com/downloads/mysql/5.6.html#downloads 2.进入安装包所在目录 执行命令:tar mysql-5...
    99+
    2024-04-02
  • 升级 MySQL 安装的步骤
    下面是升级 MySQL 安装的步骤 -升级路径 准备升级安装在 Unix 或 Linux 上升级 MySQL 二进制或基于包的安装 MySQL 还可以使用 MySQL yum 存储库或 APT 存储库或 SLES 进行升级 在存储库或Win...
    99+
    2023-10-22
  • 安装jboss3+Tomcat4+mysql的步骤
    这篇文章主要讲解了“安装jboss3+Tomcat4+mysql的步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“安装jboss3+Tomcat4+mys...
    99+
    2024-04-02
  • Mysql详细安装步骤
    目录 1、解压服务端Mysql安装包  2.复制改变my.ini文件  3、安装MySQL服务 4、启动mysql服务  6.记录初始密码,利用初始密码登录 &7.改变MySQL链接密码        1、解压服务端Mysql安装包 ...
    99+
    2023-09-06
    mysql 数据库 服务器
  • CentOS中httpd源代码安装与测试步骤是怎样的
    CentOS中httpd源代码安装与测试步骤是怎样的,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。环境:CentOS6.4   x86_64所需应用程序:APR(...
    99+
    2023-06-10
  • Python装饰器使用接口测试的步骤
    目录第一步,先看一下闭包的语法:第二步,再来看一下闭包的装饰器版本的语法:最后一步,再看一下装饰器的语法:写接口case时,有时需要对cae做一些共性的操作,最典型的场景如:获取ca...
    99+
    2024-04-02
  • macOS安装和配置mysql具体步骤
            MySQL是一个开源的关系数据库管理系统(RDBMS),广泛用于构建Web应用程序和管理大型数据集。它使用SQL(结构化查询语言)作为管理数据的主要语言,它因其易用性、可靠性和可扩展性而广受欢迎。MySQL是由Oracle公...
    99+
    2023-08-31
    mysql 数据库
  • ubuntu14.04上安装Mysql 5.7的步骤
    这篇文章主要介绍“ubuntu14.04上安装Mysql 5.7的步骤”,在日常操作中,相信很多人在ubuntu14.04上安装Mysql 5.7的步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操...
    99+
    2024-04-02
  • MySQL客户端的安装步骤
    这篇文章主要介绍“MySQL客户端的安装步骤”,在日常操作中,相信很多人在MySQL客户端的安装步骤问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”MySQL客户端的安装步骤”...
    99+
    2024-04-02
  • mysql的安装方法及步骤
    这篇文章主要讲解了“mysql的安装方法及步骤”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“mysql的安装方法及步骤”吧!环境centos 7 ...
    99+
    2024-04-02
  • CentOS7-安装MySQL详细步骤
    目录  1.卸载MariaDB 1 查看是否存在MariaDB文件 2 卸载 3 检查是否卸载干净  2.安装MySQL 把MySQL加到Linux里 解压&重命名  5.创建数据目录&用户组&用户 1创建数据目录 2创建用户组 3创建用户...
    99+
    2023-09-01
    mysql 数据库 linux
  • mysql 8.0.11 安装步骤详解
    本文为大家分享了mysql 8.0.11 安装步骤,供大家参考,具体内容如下 第一步:下载安装包 MYSQL官方下载地址:官方下载   这里第一项是在线安装,第二项是离线包安装,我选择的是第...
    99+
    2024-04-02
  • Centos7安装Mysql详细步骤
      本文主要介绍如何在Centos7下安装Mysql。 一、下载Mysql 使用wget命令下载mysql安装包。确保系统已经安装了wget,如果没有安装,执行 yum install wget 安装。 wget https://dev....
    99+
    2023-08-31
    mysql 数据库 服务器
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作