You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
步骤:
一、创建files文件夹
二、将gen_file.py复制到files文件夹中,通过python gen_file.py 生成大量文件
三、将benchmark.py放到 files目录外(即与files目录同一级),通过python benchmark.py进行压测(注意对benchmark.py中的ip进行修改)
先用gen_file.py产生大量文件(注意如果要生成大文件,自已在内容中乘上一个大的数即可)
例如:
# -*- coding: utf-8 -*-
import os
j=0
for i in range(0,1000000):
if i%1000==0:
j=i
os.system('mkdir %s'%(i))
with open('%s/%s.txt'%(j,i),'w+') as f:
f.write(str(i)*1024)
接着用benchmark.py进行压测
也可以多机同时进行压测,所有节点都是可以同时读写的