Down load url: https://github.com/brianfrankcooper/YCSB
ycsb version: 0.3.1
环境: python2.6 centos 6.5
ycsb依赖:argparse-1.4.0 setuptools-18.3.1 jdk6以上
安装jdk:
sudo rpm -ivh jdk-7u55-linux-x64.rpm
安装python依赖包:
cd setuptools-18.3.1
sudo python setup.py install
cd argparse-1.4.0/
sudo python setup.py install
-threads
: the number of client threads
-target
: the target number of operations per second
-s
: status
Mongos: 192.168.13.132:27017 / 192.168.13.134:27017 / 192.168.13.135:27017
db /account / password: ycsb / ycsbdbo / 123
workloada模板
recordcount=1000000 # 测试数据集的记录条数
operationcount=1000000 # 测试过程中执行的操作总数
workload=com.yahoo.ycsb.workloads.CoreWorkload # workload实现类
readallfields=true # 查询时是否读取记录的所有字段
readproportion=0.5 # 读操作的百分比
updateproportion=0.5 # 更新操作的百分比
scanproportion=0 # 扫描操作的百分比
insertproportion=0 # 插入操作的百分比
requestdistribution=zipfian # 请求分布模式
开100个并发load数据
./bin/ycsb load mongodb -threads 100 -P workloads/workloada -p mongodb.url=mongodb://ycsbdbo:[email protected]:27017,192.168.13.134:27017,192.168.13.132:27017/ycsb -s >data
开100个并发run
./bin/ycsb run mongodb -threads 100 -P workloads/workloada -p mongodb.url=mongodb://ycsbdbo:[email protected]:27017,192.168.13.134:27017,192.168.13.132:27017/ycsb -s >data