Chinaunix首页 | 论坛 | 博客
  • 博客访问: 93514
  • 博文数量: 41
  • 博客积分: 1905
  • 博客等级: 上尉
  • 技术积分: 335
  • 用 户 组: 普通用户
  • 注册时间: 2009-07-10 20:07
文章分类

全部博文(41)

文章存档

2011年(1)

2010年(18)

2009年(22)

我的朋友

分类: LINUX

2010-04-21 11:40:50

postmark

 

---------------------------------------------------------------------------------

 

一、Postmark原理

Postmark是由著名的NAS提供商NetApp开发,用来测试其产品的后端存储性能。

 

Existing file system benchmarks are deficient in portraying performance in the ephemeral small-file
regime used by Internet software, especially:
         electronic mail;
         netnews; and
         web-based commerce.

Postmark主要用于测试文件系统在邮件系统或电子商务系统,新闻组中性能,这类应用的特点是:需要频繁、大量地存取小文件。

 

Although a panoply of file system benchmarks currently exists, most emphasize raw throughput or
performance on large, relatively long-lived groups of files. Current file servers provide services such as electronic mail, netnews, and commerce service, which depend on enormous numbers of relatively shortlived files. These systems are inherited from an era predating the exponential growth of the Internet and were never envisioned as being scaleable to today's required levels.

传统的测试工具只是测试原始吞量,而当前的文件系统提供如电子邮件,新闻组,电子商务类的服务,这些服务一般是大量的小文件的读写。

Postmark的测试原理是创建一个测试文件池。文件的数量和最大、最小长度可以设定,数据总量是一定的。创建完成后,Postmark对文件池进行一系列的事务(transaction)操作,根据从实际应用中统计的结果,设定每一个事务包括一次创建或删除操作和一次读或添加操作,在有些情况下,

The incidence of each transaction type and its affected files are chosen randomly to minimize the influence of file system caching, file read ahead, and disk level caching and track buffering. This incidence can be tuned by setting either the read or create bias parameters to produce the desired results.

文件系统的缓存策略可能对性能造成影响。每一个事务的发生的概率和它影响的文件是被随机选择的,这可以减少文件缓存的影响。通过设置read 和 create偏向参数可以得到需要的结果。事务操作进行完毕后,Post对文件池进行删除操作,并结束测试,输出结果。

Postmark是用随机数来产生所操作文件的序号,从而使测试更加贴近于现实应用。

When a file is created, a random initial length is selected, and text from a random pool is appended up to the chosen length.

一旦一个文件被创建,他会有一个随机的长度。

File deletion selects a random file from the list of active files and deletes it.

文件删除:从活动文件链表中选择随机选择一个文件,并删除。

输出结果中比较重要的输出数据包括测试总时间、每秒钟平均完成的事务数、在事务处理中平均每秒创建和删除的文件数,以及读和写的平均传输速度。

Appending data to a file opens a random file, seeks to its current end, and writes a random amount of data.This value is chosen to be less than the configured file size high bound. If the file is already at the
maximum size, no further data will appended.

打开一个随机文件,向里面添加数据,先找到当前的结尾,然后随机写入一系列数据。这个值必须在文件文件大小范围之内。如果这个文件已经是最大的size,那么将不会再向里面添加数据。

When all of the transactions have completed, the remaining active files are all deleted (also producing
statistics on continuous file deletion).

当所有的事务处理完成之后,仍然active的文件将被全部删除。

二.Postmark的安装:

postmark软件只有一个.c文件,在gcc下编译即可。假定编译之后的可执行文件名为postmark

三.postmark命令集

3.1 postmark命令解析

postmark的操作是在命令行的环境下的。

一个配置文件(在命令行中被指定)包含了一组可以直接运行的命令。

在命令行提示下,有如下命令:

pm > ?

set size : 设置文件大小的上限和下限。(low bound and high bound)

set number : 设置并发的文件数(simultaneous files)

set seed : 为随机数产生器设置种子(sets seed for random number generator)

set transactions : 设置事务处理的数目(set number of transactions)

set location :  设定工作文件的location(sets location of working files)

set read : 设定读取block的大小(sets read block size)

set write : 设定写block的大小(sets write block size)

set buffering : (set usage of buffered I/O)

set bias read : 设置读操作发生的频率(sets the chance of choosing read over append)

set bias create : 设置删除操作发生的频率(sets the chance of choosing create over delete)

run : 运行该软件

show : 显示当前的配置信息(displays current configuration)

help : 显出可用的命令(prints out available commands )

quit : Exit program

pm > 

 show命令显示可用于下次run的当前的配置信息。系统的默认配置信息如下:

 pm>show

 Current configuration is:

 Transactions: 500               事务处理的数目是500个;

 Files range between 500 bytes and 9.77 kilobytes in size     

文件大小的上下限分别是500字节和9.77K字节。

 Random number generator seed is 42         随机数产生器的种子是42

 The base number of files is 500               并发的文件数是500

 The working directory is: .                    工作目录是 . 

 Block sizes are: read=512 bytes, write=512 bytes   块大小是:读:512字节,写:512字节

 Biases are: read/append=5, create/delete=5  

/追加发生的概率相等;创建/删除发生的概率相等。      

Using Unix buffered file I/O                文件操作将使用标准的缓冲区I/O

pm>

If this configuration is run:

500 files will be initially created, between .. and 10 Kilobytes in size

The files will be processed in the current directory

All reads will occur in 512 byte blocks

All writes will occur in 512 byte blocks

Reads and appends are equally likely to occur

Creates and deletes are equally likely to occur

File operations will be performed using the standard buffered I/O in the runtime library

部分命令解释:

pm > set size 10000 20000  表示文件大小的下限是10000字节,文件大小的上限是20000字节;

pm > set size 15000 表示文件的大小只能固定是15000字节,不能变化。

pm > set number 整数  注意:后面的整数可以是任何大于1的整数,但是要保证文件系统有足够的空间来存放结果文件;设置并发的文件数

pm > set seed 整数;  表示随机数产生器的种子。注意:任何整数都是可以的。但是这个项很少被自行设置,因为改变这个数之后测试结果将与原先测试的结果不同。

pm > set transaction  表示即将到来的下一次run中读/追加、创建/删除等操作的事务数目。任何大于1的整数都是可以的。

p> set location 表示程序运行过程中产生文件的工作目录。例如:pm > set location user2/tmp

pm > set read 整数 以及 pm > set write 整数  表示从文件中一次读取的数据的大小或者一次写进文件的数据的大小。这两个整数的取值范围是:1 < 整数 文件的最大大小;

pm > set buffering true(默认是true) 或者 pm > set buffering false

true表示buffering is enabled. 

false表示buffering is not enabled.

pm > set bias read整数  和   pm > set bias create 整数  两个整数分别表示该操作发生的频率;

其取值范围是:-1,0,1,2,3,,10

当取值为-1时,表示系统禁止readappend这两个操作;取值从010变化过程中,值越小,表示read操作发生的几率小于append操作发生的几率;值越大,表示read操作发生的几率大于append操作发生的几率。默认是5,表示readappend两种操作发生的几率相等。

同样,对于pm > set bias write 整数  和   pm > set bias delete 整数  两个整数分别表示该操作发生的频率;

其取值范围是:-1012310;

当取值为-1时,表示系统禁止writedelete这两个操作;取值从010变化过程中,值越小,表示write操作发生的几率小于delete操作发生的几率;值越大,表示write操作发生的几率大于delete操作发生的几率。默认是5,表示writedelete两种操作发生的几率相等。

set bias read n   nread/appendread所占比例 n/10

set bias create n    create/deletecreate所占比例 n/10

set report verbose(default)/terse  设置报告模式,terse模式的输出没有文字说明,便于通过批处理运行多个测试之后,使用excel对结果进行分析

pm > run 命令表示在当前的配置下运行程序

四.postmark命令使用

postmark有两种使用方法:

1、 使用配置文件
./postmark XXX.cfg
配置文件方式,是将所有配置命令及run放入文件中,由postmark自动读取
配置文件示例:
set size 10000 50000

set location /mnt/cfs
set transactions 5000
set number 5000
run result.txt

show 
quit


2、命令行模式
./postmark
进入命令行模式,然后打入相应命令,进行配置,run命令按当前配置运行postmark将上面配置文件中的命令在命令行中依次执行,结果是相同的,没有任何区别。

阅读(873) | 评论(0) | 转发(0) |
0

上一篇:rfc3720(iSCSI)

下一篇:amanda安装配置

给主人留下些什么吧!~~