USE SysBench test Mysql and PostgreSQL - 2
INSERT INTO sbtest(k,c,pad) values(?,?,?)SELECT c from sbtest where id=$1UPDATE sbtest set k=k+? where id=$1SELECT DISTINCT c from sbtest where id between $1 and $2 order by cSELECT c from sbtest where id between $1 and $2 order by cSELECT SUM(K) from sbtest where id between $1 and $2SELECT c from sbtest where id between $1 and $2UPDATE sbtest set c=$1 where id=$2DELETE from sbtest where id=$1
[root@db-172-16-3-33 bin]# ./sysbench --max-requests=0 --max-time=60 --num-threads=16 --test=oltp --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=1999 --pgsql-user=postgres --pgsql-password=postgres --pgsql-db=postgres --oltp-test-mode=complex --oltp-reconnect-mode=session run
sysbench 0.4.12: multi-threaded system evaluation benchmarkRunning the test with following options:
Number of threads: 16Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
FATAL: query execution failed: 145040784
FATAL: database error, exiting...
Done.
日志 :
2013-05-14 16:36:31.259 CST,"postgres","postgres",13938,"127.0.0.1:23937",5191f78f.3672,3,"INSERT",2013-05-14 16:36:31 CST,7/464628,
32112157,ERROR,23505,"duplicate key value violates unique constraint ""sbtest_pkey""","Key (id)=(5014) already exists.",,,,,"INSERT
INTO sbtest values($1,0,' ','aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy')",,"_bt_check_unique, nbtinsert.c:398",""
vi sysbench-0.4.12/sysbench/tests/oltp/sb_oltp.c
找到
/* Prepare the insert statement */snprintf(query, MAX_QUERY_LEN, "INSERT INTO %s values(?,0,' ',""'aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy')",args.table_name);
改成 :
/* Prepare the insert statement */if (args.auto_inc)snprintf(query, MAX_QUERY_LEN, "INSERT INTO %s(k,c,pad) values(0,' ',""'aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy')",args.table_name);elsesnprintf(query, MAX_QUERY_LEN, "INSERT INTO %s values(?,0,' ',""'aaaaaaaaaaffffffffffrrrrrrrrrreeeeeeeeeeyyyyyyyyyy')",args.table_name);
[root@db-172-16-3-33 bin]# ./sysbench --oltp-auto-inc=on --max-requests=0 --max-time=60 --num-threads=16 --test=oltp --db-driver=pgsql --pgsql-host=127.0.0.1 --pgsql-port=1999 --pgsql-user=postgres --pgsql-password=postgres --pgsql-db=postgres --oltp-test-mode=complex --oltp-reconnect-mode=session run
sysbench 0.4.12: multi-threaded system evaluation benchmarkRunning the test with following options:
Number of threads: 16Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 15 times)
Done.OLTP test statistics:queries performed:read: 4328002write: 1545715other: 618286total: 6492003transactions: 309143 (5152.10 per sec.)deadlocks: 0 (0.00 per sec.)read/write requests: 5873717 (97889.81 per sec.)other operations: 618286 (10304.19 per sec.)Test execution summary:total time: 60.0034stotal number of events: 309143total time taken by event execution: 956.5899per-request statistics:min: 1.34msavg: 3.09msmax: 179.74msapprox. 95 percentile: 8.93msThreads fairness:events (avg/stddev): 19321.4375/325.75execution time (avg/stddev): 59.7869/0.02
2. MySQL
[root@db-172-16-3-33 bin]# ./sysbench --oltp-auto-inc=off --max-requests=0 --max-time=60 --num-threads=16 --test=oltp --db-driver=mysql --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=root --mysql-password=root --mysql-db=test --oltp-test-mode=complex --oltp-reconnect-mode=session run
sysbench 0.4.12: multi-threaded system evaluation benchmarkRunning the test with following options:
Number of threads: 16Doing OLTP test.
Running mixed OLTP test
Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases)
Using "BEGIN" for starting transactions
Not using auto_inc on the id column
Threads started!
Time limit exceeded, exiting...
(last message repeated 15 times)
Done.OLTP test statistics:queries performed:read: 1380960write: 493088other: 197237total: 2071285transactions: 98597 (1643.12 per sec.)deadlocks: 43 (0.72 per sec.)read/write requests: 1874048 (31231.08 per sec.)other operations: 197237 (3286.96 per sec.)Test execution summary:total time: 60.0059stotal number of events: 98597total time taken by event execution: 958.6545per-request statistics:min: 2.30msavg: 9.72msmax: 204.51msapprox. 95 percentile: 26.08msThreads fairness:events (avg/stddev): 6162.3125/43.34execution time (avg/stddev): 59.9159/0.00
[参考]
USE SysBench test Mysql and PostgreSQL - 2相关推荐
- Install SysBench support MySQL and PostgreSQL
[测试环境] CentOS 5.7 x64 [安装MySQL] 1. 下载Mysql Red Hat & Oracle Linux 5 (x86, 64-bit), RPM Package M ...
- 使用sysbench对mysql压力测试
sysbench是一个模块化的.跨平台.多线程基准测试工具,主要用于评估测试各种不同系统参数下的数据库负载情况.关于这个项目的详细介绍请看:https://github.com/akopytov/sy ...
- 通过mysqlslap与sysbench对MySQL进行压测
介绍 mysqlslap是mysql自带的基准测试工具,该工具查询数据,语法简单,灵活容易使用.该工具可以模拟多个客户端同时并发的向服务器发出查询更新,给出了性能测试数据而且提供了多种引擎的性能比较. ...
- 使用sysbench对mysql进行基准测试
文章目录 测试环境说明 硬件 软件 测试过程 1. 测试innodb 100w条记录的读写性能 1.1 生成100w数据 1.2 进行读写测试 1.2.1 第一次直接执行100w次读写 1.2.2 第 ...
- 在MySQL和PostgreSQL之外,为什么阿里要研发HybridDB数据库?
编者按 \\ 在大数据火遍IT界之前,大家对数据信息的挖掘通常聚焦在BI(Business Intelligence)之上.BI具有着明确的分析需求,清晰地知道需要处理哪些信息,并且如何最终获得多维度 ...
- MySQL和PostgreSQL数据库安全配置
shewey · 2016/05/26 16:40 0x00 MySQL和PostgreSQL安全配置 针对开源数据库MySQL和PostgreSQL的安全配置主要主要通过身份鉴别.访问控制.安全审计 ...
- 微软宣布MySQL和PostgreSQL的Azure数据库服务正式可用
\ 看新闻很累?看技术新闻更累?试试下载InfoQ手机客户端,每天上下班路上听新闻,有趣还有料! \ \\ 微软宣布MySQL和PostgreSQL的Azure数据库服务正式可用.Azure将这两个开 ...
- golang beego orm mysql sqlite3 postgresql 模型字段 数据库类型 对应关系
目录 MySQL Sqlite3 PostgreSQL 关系型字段 在此列出 ORM 推荐的对应数据库类型,自动建表功能也会以此为标准. 默认所有的字段都是 NOT NULL MySQL go mys ...
- sysbench mysql测试_使用sysbench对MySQL进行测试
为什么要测试,测什么东西? 测试的种类非常多,测试的目的也非常多,我这里主要的目的就两个 测试MySQL的极限IO 对比不同版本MySQL,不同参数, 不同硬件,不同系统对MySQL的性能影响 为什么 ...
最新文章
- c语言单链表需要头结点,一个关于C语言链表头结点的问题
- php表单登录跳转页面跳转页面,form表单页面跳转方式提交练习
- c语言程序设计B试题,c语言程序设计期末试题B(含答案)Word版
- html jq移到出现内容,jquery操作html元素之( 获得内容和属性)
- java比较时间sql_如何正确比较日期 java.sql.Date
- 思科光传输功率查询_常见的6款40G QSFP+光模块型号介绍及应用
- Eclipse开发工具之崩溃和备份
- window 快捷键使用 + idear 编辑器使用
- Native Crash 分析
- 安卓开发笔记(二十二):读取本地(内置)html文件并实现和Javascript交互
- 设计模式学习笔记——桥接(Bridge)模式
- 微软宣布已获批:重新向华为出口软件!
- 互联网高并发之Hystrix实现服务隔离和降级
- 《『若水新闻』客户端开发教程》——07.升级新闻内容UI
- 力扣-240 搜索二维矩阵 II
- IT项目经验和难点分享
- LINQ Enumerable 续 II
- 火车票售票系统需求分析
- 【5G之道】第二十三章:5G无线接入
- Thinkpad E430C 跳过电池检测更新bios
热门文章
- [Java]Stack栈和Heap堆的区别(终结篇)[转]
- LINQ to Entities 不识别方法“System.String ToString()”,因此该方法无法转换为存储表达式。...
- POJ-3414 Pots BFS+记忆路径
- SQL Server 2008中原生的分层数据类型:hierarchyid
- LR学习笔记三 之 界面分析
- [转] HOWTO:使ASP.NET网站Forms验证可以指定多个登录页面
- IT工程师实战英语之一
- 怎么改善现有网站为xhtml+CSS
- c语言x1=abc什么意思,c语言起步(课件)2.1
- python 词云_利用Python生成词云