内容简介:SwiftStack Benchmark Suite(ssbench)是一个灵活且可扩展的 OpenStack Swift 对象存储系统的基准测试工具。github 上提供了在不同系统上详细的安装方法:Traceback (most recent call last):
SwiftStack Benchmark Suite(ssbench)是一个灵活且可扩展的 OpenStack Swift 对象存储系统的基准测试工具。
2.ssbench 安装
github 上提供了在不同系统上详细的安装方法: https://github.com/swiftstack/ssbench
3.debug
3.1 运行时报错没有相应的文件
Info:
Traceback (most recent call last):
args.func(args)
File “./ssbench-master”, line 217, in run_scenario
close_fds=True))
File “/usr/lib/python2.7/subprocess.py”, line 710, in init
errread, errwrite)
File “/usr/lib/python2.7/subprocess.py”, line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Solution:
ssbench-worker 命令没有添加到环境变量,不能直接输入 ssbench-worker 运行,需要以 ./ssbench-worker 的方式运行
在 ssbench-master 的 213 行行后面添加一行代码
cmd_i[0] = './ssbench-worker'
3.2 测试读取性能时出错
如果测试 swift 的 1MB 的读性能,测试的 container 为 demo_container,且 demo_container中包含 object,那么ssbench 会直接从中读取 object 进行测试,而不管而不管这些 object 的大小。如果 demo_container 中没有object,则会先写入 1MB 的object 再进行测试。只有保证测试的 container 中无 object ,才能保证测试的读性能准确。 所以,建议在测试读性能之前,确保系统中不存在任何数据。
4. 生成 scenario 文件的脚本
import argparse
import sys
import re
def get_size(size_str):
pat = ('(\d+)B\n','(\d+)KB\n','(\d+)MB\n','(\d+)GB\n')
base = 1;
for p in pat:
size = re.findall(p,size_str)
if len(size) != 0:
#print(size[0])
return int(size[0])*base
base = base * 1024;
print('invalid object size')
sys.exit(0)
def output(args):
size = get_size(args.size+'\n')
if(args.type not in ['C','R','U','D']):
print('invalid operation size')
sys.exit(0)
f = open(args.output,'w');
f.write('{\n')
f.write(' "name": "Demo scenario",\n')
f.write(' "sizes": [{\n')
f.write(' "name": "test",\n')
f.write(' "size_min":' + str(size) + ',\n')
f.write(' "size_max":' + str(size) + '\n')
f.write(' }],\n')
f.write(' "initial_files": {\n')
f.write(' "test": 10000\n')
f.write(' },\n')
f.write(' "policy": "' + args.policy +'",\n')
f.write(' "operation_count": ' + str(args.count) + ',\n')
if(args.type == 'C'):
f.write(' "crud_profile": [100, 0, 0, 0],\n')
elif(args.type == 'R'):
f.write(' "crud_profile": [0, 100, 0, 0],\n')
elif(args.type == 'U'):
f.write(' "crud_profile": [0, 0, 100, 0],\n')
elif(args.type == 'D'):
f.write(' "crud_profile": [0, 0, 0, 100],\n')
else:
assert(0)
f.write(' "user_count": 10,\n')
f.write(' "container_base": "ssbench",\n')
f.write(' "container_count": 100,\n')
f.write(' "container_concurrency": 10\n')
f.write('}\n')
f.close()
if __name__ == "__main__":
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-c', '--count', type=int, required=True, help='Operation count')
arg_parser.add_argument('-t', '--type', type=str, required=True, help='Operation type: C,R,D,U')
arg_parser.add_argument('-o', '--output', type=str, required=True, help='Output file name')
arg_parser.add_argument('-s', '--size', type=str, required=True, help='Object size')
arg_parser.add_argument('-p', '--policy', type=str, required=True, help='Storage policy')
args = arg_parser.parse_args(sys.argv[1:])
output(args)
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Django 1.0 Template Development
Scott Newman / Packt / 2008 / 24.99
Django is a high-level Python web application framework designed to support the rapid development of dynamic websites, web applications, and web services. Getting the most out of its template system a......一起来看看 《Django 1.0 Template Development》 这本书的介绍吧!