Aerospike C客户端手册———Benchmarks

20 篇文章 0 订阅
20 篇文章 0 订阅


Benchmarks

Aerospike C客户端函数库附带了一个benchmark工具,是使用C客户端函数库构建。 利用这个benchmark工具,能够:

  • 以特定的读取比率向数据库写入数据与读取数据。
  • 改变客户端线程数,模拟客户端并发情况。
  • 从客户端的角度观察延迟的分布。

在可以使用benchmark工具之前,需要安装“开发包”及其先决条件要求的包。

构建benchmark工具:

$ cd benchmarks
$ make

启动工具

$ make run

此命令将用默认的负载、以localhost为集群服务器地址启动benchmark,简要输出内容如下:

$ make run
./target/benchmarks -h 127.0.0.1 -p 3000
hosts:          127.0.0.1
port:           3000
namespace:      test
set:            testset
keys/records:   1000000
object spec:    int
random values:  false
minimum number of transactions:  -1
workload:       read 50% write 50%
threads:        16
max throughput: unlimited
read timeout:   0 ms
write timeout:  0 ms
max retries:    1
debug:          false
latency:        false
shared memory:  false
read replica:   master
read consistency level: one
write commit level: all
2014-11-06 11:43:29 INFO Read/write using 1000000 records
2014-11-06 11:43:29 INFO Start 16 generator threads
2014-11-06 11:43:30 INFO write(tps=10847 timeouts=0 errors=0) read(tps=10772 timeouts=0 errors=0) total(tps=21619 timeouts=0 errors=0)
2014-11-06 11:43:31 INFO write(tps=11477 timeouts=0 errors=0) read(tps=11271 timeouts=0 errors=0) total(tps=22748 timeouts=0 errors=0)
2014-11-06 11:43:32 INFO write(tps=11051 timeouts=0 errors=0) read(tps=10698 timeouts=0 errors=0) total(tps=21749 timeouts=0 errors=0)
  • 随机读取/更新的键是1000000个。
  • 50%的读取请求,50%的写入请求。

更详细的工具属性,请使用如下命令查看:

$ ./target/benchmarks -u

Benchmark示例

示例1

  • 连接127.0.0.1:3000,使用名称为test的namespace。
  • 使用1亿个键(键使用整型值,范围1~100000000)、名称为testbin的bin、bin值为50个字符的字符串。
  • 90%的读与10%的写入,20个并发线程。
$ ./target/benchmarks -h 127.0.0.1 -p 3000 -n test -k 100000000 -o S:50 -w RU,90 -z 20

示例2

  • 连接127.0.0.1:3000,使用名称为test的namespace与名称为demoset的set。
  • 使用1百万个键,1400个字符的字符串做为值。
  • 80%的读取与20%的写入,8个并发线程。
  • 限制每秒事务数为2500
  • 读写的超时时间50毫秒
  • 显示客户端延迟百分比为四栏:<=1ms, >1ms, >8ms, >64ms。
$ ./target/benchmarks -h 127.0.0.1 -p 3000 -n test -s demoset -k 1000000 -o S:1400 -g 2500 -w RU,80 -z 8 -L 4,3
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值