查看单个帖子
旧 12-20-2006, 18:42   #2
chyangwa
蝌蚪-小毛驴
 
chyangwa的头像
 
注册日期: Nov 2000
来自: 上海
帖子: 8,285
精华: 6
回复: Linux下Qmail、Sendmail、postfix邮局系统性能比较!

在足够好的硬件条件下Postfix比qmail更快的原因分析
经过实际的测试我也发现Postfix比qmail快(在较平等的条件下比较)。究其原因,主要是因为磁盘I/O 的差异,Postfix的磁盘I/O原则上比qmail少耗用资源,仅1/3左右,所以速度原则上应该快3倍。

以下是wietse的解释。

以下是postfix作者的原话,就偶自己的小知识,对硬盘写操作越多性能越低。it's true..
===================================================================
寄件者:Wietse Venema (wietse@porcupine.org)
主旨:Re: performance tuning


View this article only
新闻群组:mailing.postfix.users
日期:2001-02-15 17:34:07 PST


jet:
> I'm trying to dump e-mails into postfix via smtp, but can only achieve
> speeds of about 15-20 mails/second (locally).
>
> I've tried spawning multiple outgoing-mail scripts, and tweaked with them,
> but always end up in the 15-20 mail/second range.

This is pretty much single disk Postfix performance. Most other
mailers are much, much, worse than this.

The bottle neck is your disk.

When I first tested Postfix against qmail, Postfix was 3x faster
on local and LAN benchmarks because Postfix uses one queue file
where qmail uses three. The create/delete operations are much,
much, more time consuming than reading and writing the content.

In order to make Postfix fast you need to avoid queue file
create/delete operations. Multiple recipients per queue file are
a big win. With one recipient per queue file Postfix is starved
because the disk is too slow.

Postfix does mostly random writes, and it actually has to wait
until a file is safe on disk. It's not allowed to wait until dirty
blocks are synced automatically.

In order to process more mails per unit time, you need faster disks.
Well, that is not possible.

You can, however, spread the load over multiple spindles. Don't
use RAID5 because it still has single-disk performance for applications
that produce random writes like Postfix does.

Another possibility is to use non-volatile RAM of the type that
used to be sold for SUN file servers. It speeds up disk access of
random writes by an order of magnitude, because writes can be sorted
for speed without loss of reliability. Next to solid-state disks
it is the best thing you can do.

Wietse

--

>My test machine is a:
> AMD Athlon Thunderbird 800 mHz
> 128 megs memory

not enough memory for sending 50K msgs/hour. You'll need 512 or more
to get 400+ SMTP processes into memory.

You will also have to increase maxfiles and maxfilesperprocess with sysctl.

I have a client with a listar announcement list machine hitting 40
msgs/hour on a P500 + 512 megs RAM and just one IDE disk. I think 50
is reachable, but 40 is more than enough for him.

> UDMA66 IDE drive

Better to have two IDE master drives on two separate IDE channels,
one for system + logging and the other for mailq, and maybe even a
third for mailbox storage, but that means master/slave disk on IDE
which is slower.

Of course, IDE is slower than SCSI, and SCSI cards with 64 or 128
megs on-board buffer would help the disk channel congestion, which
Wietse says is the limit to an MTA.

好象wietse说不要用raid5哦。。因为也是random write,这样的效能低。确实也是。因为如果是连续的有规律的写,速度会块得多的。。
chyangwa离线中   回复时引用此帖