用法
./weed benchmark -h
Example: weed benchmark -master=localhost:9333 -c=10 -n=100000
Default Usage:
-c int
number of concurrent write or read processes (default 16)
-collection string
write data to this collection (default "benchmark")
-cpuprofile string
cpu profile output file
-debug
verbose debug information
-deletePercent int
the percent of writes that are deletes
-disk string
[hdd|ssd|<tag>] hard drive or solid state drive or any tag
-fsync
flush data to disk after write
-list string
list of uploaded file ids (default "/tmp/benchmark_list.txt")
-master string
SeaweedFS master location (default "localhost:9333")
-maxCpu int
maximum number of CPUs. 0 means all available CPUs
-n int
number of files to write for each thread (default 1048576)
-options string
a file of command line options, each line in optionName=optionValue format
-read
enable read (default true)
-readSequentially
randomly read by ids from "-list" specified file
-replication string
replication type (default "000")
-size int
simulated file size in bytes, with random(0~63) bytes padding (default 1024)
-write
enable write (default true)
Description:
benchmark on an empty SeaweedFS file system.
Two tests during benchmark:
1) write lots of small files to the system
2) read the files out
The file content is mostly zeros, but no compression is done.
You can choose to only benchmark read or write.
During write, the list of uploaded file ids is stored in "-list" specified file.
You can also use your own list of file ids to run read test.
Write speed and read speed will be collected.
The numbers are used to get a sense of the system.
Usually your network or the hard drive is the real bottleneck.
Another thing to watch is whether the volumes are evenly distributed
to each volume server. Because the 7 more benchmark volumes are randomly distributed
to servers with free slots, it's highly possible some servers have uneven amount of
benchmark volumes. To remedy this, you can use this to grow the benchmark volumes
before starting the benchmark command:
http://localhost:9333/vol/grow?collection=benchmark&count=5
After benchmarking, you can clean up the written data by deleting the benchmark collection
http://localhost:9333/col/delete?collection=benchmark
默认情况下,benchmark会先生成文件写入到SeaweedFS,测试写性能,而后从SeaweedFS读取文件,测试读性能。仅测试写性能或者读性能亦可, 可以通过-list
指定fid的路径。
测试完成后,可以通过以下命令清理benchmark测试数据
http://localhost:9333/col/delete?collection=benchmark
例子
20并发,测试100000个文件的写读性能(先写后读),文件平均大小为2048 bytes,复制模式为001
./weed benchmark -master=192.168.209.3:9333 -c=20 -n=100000 -replication=001 -size=2048
写入性能:
读取性能: