Aerospike C客户端手册———Benchmarks

来源:互联网 发布:ubuntu创建新用户密码 编辑:程序博客网 时间:2024/06/02 01:28


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 3000hosts:          127.0.0.1port:           3000namespace:      testset:            testsetkeys/records:   1000000object spec:    intrandom values:  falseminimum number of transactions:  -1workload:       read 50% write 50%threads:        16max throughput: unlimitedread timeout:   0 mswrite timeout:  0 msmax retries:    1debug:          falselatency:        falseshared memory:  falseread replica:   masterread consistency level: onewrite commit level: all2014-11-06 11:43:29 INFO Read/write using 1000000 records2014-11-06 11:43:29 INFO Start 16 generator threads2014-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

来源: <http://www.aerospike.com/docs/client/c/benchmarks/>
 
0 0
原创粉丝点击