邮件服务器压力测试工具Postal
postal下载
http://doc.coker.com.au/projects/postal/
postal安装
1
2
3
4
5
|
[root@Mailbox ~]
#tar zxvf postal7.tgz
[root@Mailbox ~]
#./configure
[root@Mailbox ~]
#make
[root@Mailbox ~]
#make install
[root@Mailbox ~]
#make clean
|
创建测试邮件列表文件test.list,里面写上你需要用来测试的email地址清单
1
2
3
4
5
6
7
8
|
[root@Mailbox ~]
#mkdir /mailbox
[root@Mailbox ~]
#cd /mailbox
[root@Mailbox ~]
#vim test.list
test1@
test
.com
test2@
test
.com
...
test999@
test
.com
|
这些地址必须在你的邮件系统中存在。postal会随机从一个地址发送到另一个地址,邮件大小根据下面的-m指定的size为上限,发送随机邮件。
然后用postal命令进行测试,格式如下:
1
2
3
4
5
6
7
8
9
10
|
[root@Mailbox ~]
# postal help
Usage: postal [-m maximum-message-size] [-M minimum-message-size] [-t threads]
[-c messages-per-connection] [-r messages-per-minute] [-a]
[-b [no]netscape] [-p port] [-[z|Z] debug-
file
]
[-s ssl-percentage]
[-L] [-l
local
-address] [-f sender-
file
]
smtp-server user-list-filename
Postal Version: 0.72
[root@Mailbox ~]
#
|
执行以下命令开始测试:
1
|
[root@Mailbox ~]
#postal -m 100 -p 25 -r 60 192.168.30.130 test.list
|
-m 是每份邮件最大size,以KB为单位
-p 是进程数
后面是email服务器的地址,后面再跟测试邮件地址列表以及转换格式文件(这里我们不需要转换格式文件,最后有个 “-”符号)。
还可以指定rate,使用-r参数指定。
具体的命令参数用man postal看。
返回结果为
1
2
3
4
5
|
time
,messages,data(K),errors,connections,SSL connections
14:19,4964,4333,0,266,0
14:20,4909,4238,0,176,0
14:21,4935,4254,0,192,0
......
|
分别表示
统计时间,发送邮件总计,发送数据总计(KB),错误数,连接数,SSL连接数(如果选用了SSL连接选项)
将记录输出到文本
1
2
|
[root@Mailbox ~]
#postal -m 100 -p 25 -r 60 192.168.1.11 test.list >> filename
[root@Mailbox ~]
#postal -m 100 -p 25 -r 60 192.168.1.11 test.list | tee -a filename
|