




全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
sysbench是一个开源的、模块化的、跨平台的多线程性能测试工具,可以用来进行CPU、内存、磁盘I/O、线程、数据库的性能测试。目前支持的数据库有MySQL、Oracle和PostgreSQL。以下操作都将以支持MySQL数据库为例进行。下载源码包在/projects/sysbench/网站上下载,我下载到的源码包是sysbench-0.4.12.tar.gz。环境准备我的系统是CentOS 5.5,在进行编译安装前需要先进性相关软件的安装和更新。首先,安装和更新gcc,否则在编译安装时会报错误:configure: error: no acceptable C compiler found in $PATH,安装命令为:yum install gcc。其次,安装和更新libtool,否则在编译安装时会报类似错误:./libtool: line 838: X-tag=CC: command not found./libtool: line 871: libtool: ignoring unknown tag : command not found./libtool: line 838: X-mode=link: command not found./libtool: line 1004: * Warning: inferring the mode of operation is deprecated.: command not found./libtool: line 1005: * Future versions of Libtool will require -mode=MODE be specified.: command not found./libtool: line 2231: X-g: command not found./libtool: line 2231: X-O2: command not found./libtool: line 2231: X-rdynamic: command not found./libtool: line 1951: X-L/usr/lib/mysql: No such file or directory./libtool: line 2400: Xsysbench: command not found Fatal server error:Server is already active for display 0 If this server is no longer running, remove /tmp/.X0-lock and start again. ./libtool: line 2412: Xsysbench: command not found./libtool: line 2547: X-lmysqlclient_r: command not found./libtool: line 2547: X-lz: command not found./libtool: line 2547: X-lcrypt: command not found./libtool: line 2547: X-lnsl: command not found./libtool: line 2547: X-lm: command not found./libtool: line 2547: X-lmygcc: command not found./libtool: line 2547: X-lrt: command not found./libtool: line 2547: X-lm: command not found./libtool: line 2629: X-L/root/tool/sysbench-0.4.12/sysbench: No such file or directory./libtool: line 2547: X-lmysqlclient_r: command not found./libtool: line 2547: X-lz: command not found./libtool: line 2547: X-lcrypt: command not found./libtool: line 2547: X-lnsl: command not found./libtool: line 2547: X-lmygcc: command not found./libtool: line 2547: X-lrt: command not found./libtool: line 2547: X-lm: command not found./libtool: line 2629: X-L/root/tool/sysbench-0.4.12/sysbench: No such file or directory./libtool: line 2547: X-lmysqlclient_r: command not found./libtool: line 2547: X-lz: command not found./libtool: line 2547: X-lcrypt: command not found./libtool: line 2547: X-lnsl: command not found./libtool: line 2547: X-lmygcc: command not found./libtool: line 2547: X-lrt: command not found./libtool: line 2547: X-lm: command not found./libtool: line 5162: Xgcc -pthread -o OUTPUT sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/root/tool/sysbench-0.4.12/sysbench -lmysqlclient_r -lz -lcrypt -lnsl -lmygcc -lrt -lm: No such file or directory./libtool: line 5163: Xgcc -pthread -o OUTPUT sysbench.o sb_timer.o sb_options.o sb_logger.o db_driver.o tests/fileio/libsbfileio.a tests/threads/libsbthreads.a tests/memory/libsbmemory.a tests/cpu/libsbcpu.a tests/oltp/libsboltp.a tests/mutex/libsbmutex.a drivers/mysql/libsbmysql.a -L/root/tool/sysbench-0.4.12/sysbench -lmysqlclient_r -lz -lcrypt -lnsl -lmygcc -lrt -lm: No such file or directory安装命令为:yum install libtool第三:需要mysql下需要安装MySQL-devel-5.0.22-0.i386.rpm、MySQL-shared-5.0.22-0.i386.rpm、MySQL-bench-5.0.22-0.i386.rpm编译安装准备好环境之后就可以开始进行编译安装了。首先对压缩包进行解压:tar zxf sysbench-0.4.12.tar.gz。其次,在解压好的目录下运行命令:./autogen.sh,对环境进行清理。该操作是sysbench0.4.12独有的,不进行的话也会出现类似如上第2个错误。然后,进行编译安装。如果MySQL是默认安装的,则直接运行如下命令进行编译安装:./configure -build=i686-pc-linux-gnu & make & make install其中,-build指定操作系统的类型,否则可能会出现如下错误:checking build system type. Invalid configuration i686-pc-linux-: machine i686-pc-linux not recognizedconfigure: error: /bin/sh config/config.sub i686-pc-linux- failed如果MySQL不是安装在标准默认目录下,那么就还需要指定MySQL的路径。如MySQL安装在/var/mysql下,则运行如下命令进行编译安装:./configure -build=i686-pc-linux-gnu with-mysql-includes=/var/mysql/include with-mysql-libs=/var/mysql/lib & make & make install如果需要sysbench支持Oracle或者PostgreSQL的话,还需要在编译时加上-with-pgsql或者-with-oracle。进行测试编译安装成功后就可以开始进行性能测试了。测试的方法和选项很多,这里大致介绍一下相关的命令和选项。CPU性能测试sysbench -test=cpu -cpu-max-prime=5000 runCPU的性能测试主要通过素数的运算来进行,-cpu-max-prime用来选项指定最大的素数,具体参数可以根据CPU的性能来设置。内存性能测试sysbench -test=memory -memory-block-size=8k -memory-total-size=4G run-memory-block-size指定每个block的大小,-memory-total-size指定总的传输量,另外还有其他选项,可通过命令sysbench test=memory help进行查看。磁盘I/O性能测试 首先生成需要测试的文件sysbench -test=fileio -num-threads=16 -file-num=2 -file-total-size=2G -file-test-mode=rndrw -file-rw-ratio=2 prepare然后执行测试sysbench -test=fileio -num-threads=16 -file-num=2 -file-total-size=2G -file-test-mode=rndrw -file-rw-ratio=2 run最后清理测试文件sysbench -test=fileio -num-threads=16 -file-num=2 -file-total-size=2G -file-test-mode=rndrw -file-rw-ratio=2 cleanup-num-threads指定最大创建的线程数,-file-num指定文件数目,-file-taotal-size指定创建的文件总大小,-file-test-mode指定文件读写模式,rndrw为随机读,-file-rw-ratio指定读写比率。另外还有更多的选项可以通过命令sysbench test=fileio help进行查看。线程测试sysbench -test=threads -num-threads=32 -thread-yields=100 -thread-locks=2 run-num-threads指定线程数,-thread-yield指定每个请求的压力,-thread-locks指定每个线程的锁数量。数据库性能测试首先,准备测试数据sysbench -test=oltp -mysql-host=server1 -mysql-user=root -mysql-password=MySQLPASSWORD -mysql-db=test -oltp-table-name=sbtest -mysql-table-engine=MyISAM -oltp-table-size=1000000 prepare然后执行测试sysbench -test=oltp -mysql-host=server1 -mysql-port=3306 -mysql-user=root -mysql-password=MySQLPASSWORD -mysql-db=test -oltp-table-name=sbtest -mysql-table-engine=MyISAM -mysql-engine-trx=no -oltp-skip-trx=on -oltp-table-s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025辽宁沈阳地铁集团有限公司所属公司拟聘用人员模拟试卷及答案详解(网校专用)
- 2025湖北荆州市石首市第二批校园招聘教师6人考前自测高频考点模拟试题及一套参考答案详解
- 安全培训教师基本条件课件
- 2025年威海火炬高技术产业开发区公开招聘教师(第二批)(61人)考前自测高频考点模拟试题及答案详解一套
- 2025年锂电池配套试剂项目建议书
- 广昌消防安全培训课件
- 2025江西赣南医科大学高层次人才招聘180人模拟试卷及答案详解(全优)
- 小学安全专项培训反思课件
- 2025年高通量试验反应堆及配套产品合作协议书
- Indene-d3-生命科学试剂-MCE
- 2025-2030中国智能制造示范工厂建设标准与绩效评价体系
- 区块链技术在资产追踪中的应用
- 2025年通信安全员(ABC证)考试题库(含答案)
- ISO9001-2015基础知教学课件
- 鼠疫防治知识讲座课件
- 考务人员管理办法
- 乡村医生超声培训课件
- 急性喉炎护理课件
- 大学生职业规划大赛《智能焊接技术专业》生涯发展展示
- 2025新外研版初中英语七年级上全册课文翻译
- 检验科室内质控培训课件
评论
0/150
提交评论