Ò»Ö±ÒÔÀ´£¬ÈËÃÇÆÕ±éµÄ¹Ûµã¶¼ÈÏΪqmailºÜ¿ì£¬±Èsendmail¿ìµÃ¶à£¬ÉõÖÁÓÐÈË»¹´µÐê˵qmail±ÈpostfixÒ²¿ì£¬ÎªÁËÀ´Ò»¸ö¿Í¹ÛÒ»µãµÄÆÀ¼Û£¬¶Ôqmail/Postfix½øÐвâÊÔ¿´À´ÊDZØÒªµÄÁË£¬ÖÁÉÙ¿ÉÒÔ¸øÓʼþϵͳµÄÑ¡ÔñÌṩһ¸öÆÀ¼ÛµÄ»ù×¼¡£
ÔÚ²âÊÔpostfixͬÑùÅäÖõÄÁíÍâÒ»¸ö»úÆ÷ÉÏ×°ÁËÓÉhleilÌṩµÄrpm°ü£¬²¢×ÉѯÁËÒ»ÏÂËû¹ØÓÚqmailµÄÎÊÌ⣬Ôڴ˱íʾ¸Ðл¡£
1.»·¾³
2̨ÅäÖÃÍêȫһÖµÄPIII 933*2 + 512M + U160 SCSI ´ÅÅÌ£¬qmail-1.03-7¡£ÁíÍâϵͳ×öÁËÓÅ»¯£¬µ÷ÕûÁËfs.file-max=65535²¢·Å¿ªÒ»°ãÏÞÖÆ£¬½«/varĿ¼µ¥¶À·Ö¿ª¡£
ÏÈʹÓÃsmtp-sink²âÊÔqmail£¬Ê¹ÓÃϵͳÕʺţ¬Ð§¹ûÊÇ26·â/Ã룬¾õµÃЧ¹û²»ÀíÏë¡£
hleil±íʾ£¬ÎÒ×öµÄsmtp ²âÊÔÖ»²âÊÔÁËsmtpdµÄÐÔÄܶøÒÑ£¬¶ÓÁв¢Ã»Êܵ½ÕæÕý¿¼Ñ飬ÒòΪsmtpµÄËٶȲÅÊÇbottleneck¡£
2.¼òµ¥½á¹û£º
ÓÃϵͳÕʺţ¬smtp-sink ÅäÖóɷ¢1000·âÐÅ£¬10¸ö²¢·¢£¬ºÄ·ÑÁË56Ãë¡£»»³É100²¢·¢£¬²âÊÔʧ°Ü£¬¼Ó´óÁËqmailµÄ²¢·¢ÊýºóÍê³É˳Àû£¬½á¹ûÒ²´ó¸ÅÊÇ26·â/Ãë¡£
È»ºóÓÃpostalÈí¼þ£¬50¸ö²¢·¢Á¬½Ó£¬Ã¿¸öÁ¬½Ó·¢Ò»·âÐÅ£¬qmailÅäÖõ½400¸ö²¢·¢ÉÏÏÞ¡£½á¹û¾Í´ó¸ÅÊÇ1150-1200·â/·ÖÖÓµÄÑù×Ó£¬ÔõôÌá¸ß¶¼²»ÐÐÁË¡£¿´ÁËÒ»ÏÂtop£¬·¢ÏÖkjounaldƵ·±µÄ³öÏÖ£¬¹À¼ÆÊÇд²Ù×÷ºÄ·ÑÁ˺ܶà×ÊÔ´£¬²¢¸ù¾Ýpostfix²âÊÔ½á¹ûÍÆ¶Ï¿ÉÄÜÊÇmultilogºÄ·ÑÁ˺ܶà×ÊÔ´µÄÔÒò¡£ÓÚÊÇÈ¥µômultilog¼Ç¼µÄ¹¦ÄÜ£¬qmail²»Ê¹ÓÃlogϵͳ£¬ÔÙ²âÊÔ£º
[root@ns2 postal-0.61]# ./do.sh
time,messages,data(K),errors,connections,SSL connections
14:52,2029,2767,0,2078,0
14:53,2056,2684,0,2056,0
14:54,2061,2785,0,2062,0
14:55,2022,2686,0,2021,0
14:56,1998,2684,0,1998,0
14:57,2006,2666,0,2007,0
14:58,1971,2644,0,1971,0
14:59,1971,2584,0,1970,0
15:00,1942,2596,0,1943,0
15:01,1984,2655,0,1984,0
15:02,1957,2567,0,1957,0
ºÜÃ÷ÏÔËÙ¶ÈÌáÉý1±¶×óÓÒ£¬µ«²¿·Ö²âÊÔ³öÏÖcould not creat qq(¶ÓÁУ©µÄÎÊÌ⣬¿´²»³ö¾ßÌåµÄÔÒò¡£¹À¼ÆÊÇqmailû×ã¹»×ÊÔ´È¥´´½¨¶ÓÁУ¬»òÕßËÙ¶ÈÌ«¿ì¶ÓÁгöÁËÎÊÌ⣿
È»ºóÔÙ½«/etc/passwdµÄÐÅϢת»»³ÉcdbÌá¸ß²éѯËÙ¶È£º
qmail-pw2u < /etc/passwd > /var/qmail/users/assign
qmail-newu
È»ºóÔÙ²âÊÔ£¬½á¹ûÈçÏ£º
[root@ns2 postal-0.61]# ./do.sh
time,messages,data(K),errors,connections,SSL connections
16:42,2118,2858,0,2167,0
16:43,2095,2788,0,2096,0
16:44,2114,2790,0,2114,0
16:45,2245,3002,0,2244,0
16:46,2233,2971,0,2233,0
16:47,2165,2891,0,2166,0
16:48,1977,2637,0,1976,0
16:49,1999,2645,0,2000,0
×¢ÈëËÙ¶ÈËÆºõÌá¸ßÁË5%-10%¡£
hleil¶ÔÉÏÊö²âÊÔ½á¹ûÈÏΪ£ºÕâ¸ö²âÊÔÊDzâÊÔsmtpµÄ×¢È룬²¢Ã»°ì·¨ÕæÕý¿¼Ñé¶ÓÁУ¬ÈçÉÏËù·¢ÏÖµÄÄÇÑù£¬¶ÓÁÐÓ¦¸ÃûÓÐÊܵ½ÌرðµÄ¿¼Ñ飬¼´±ãÊÇfail to create queueÒ²¿ÉÄÜÊÇÆäËûÔÒò¡£±ØÐëÊÇmx-mxÕæÊµ»·¾³Ï²ÅÓÐÒâÒ壬¶øÇÒÒ»¸ösmtp¹ý³Ì±ÈÏÖÔڵĸ´ÔÓ¡£
×¢Ò⣺ÔÎÄÎҼǵò»ÊÇÌ«ÇåÎú£¬Ö»ÊÇתÊöhleil˵µÄÄÚÈÝ¡£
µ±Ê±ÎÒÈÏΪÕâÑùµÄ²âÊÔÆðÂ뻹ÊÇÓеãЧ¹ûµÄ£¬Ê×ÏȾÍÊDzâÊÔÁËÓʼþdosÇé¿ö¡£Èç¹û³öÏÖdosµÄʱºò£¬²»¹ÜmtaÓúη½·¨£¬Ö»ÒªÖ§³Öס¾Í¿ÉÒÔÁË¡£Èç¹ûqmailÕæµÄÈçÎÒ²âÊÔÕâÑùÈÝÒ׳öÏÖ¶ÓÁÐcrashµÄ»°£¬ÊDZȽÏΣÏյġ£
µ«ËƺõÕâ¸öÎÊÌâ²»ÊÇÄÇôÑÏÖØ£¬ÓÐÄÇô¶àqmailÓû§£¬Èç¹ûÕæµÄÄÇô¶àDOS¹¥»÷£¬ÄÇô¶àqmail³öÎÊÌ⣬һ¶¨Óнâ¾ö°ì·¨µÄ¡£
Æä´Î¾ÍÊÇlogµÄÎÊÌ⣬ȥµôlogºóËÙ¶ÈÌá¸ßºÜ¶à£¬¿ÉÒÔ˵Ã÷±ØÐ뽫logµÄ¿ªÏú¾¡Á¿½µµÍ£¬µ«Ò»¸ö²úƷϵͳ±ØÐëÓÐlog¡£Õâ¸öÊDZØÐë½â¾öµÄÎÊÌâ¡£
ÁíÍ⣬ÓÉÓÚqmailµÄ¶ÓÁÐÉè¼Æ£¬Ã¿·â´¦ÀíµÄÓʼþÖÁÉÙÒªÔÚ¶ÓÁÐÖн¨Á¢3¸öÎļþ£¬Òò´ËwriteµÄi/o²Ù×÷Ƶ·±ºÜ¶à£¨topµÄʱºò¾Í¿´µ½kjounaldÕ¼ÓõÄcpu×ÊÔ´Ã÷ÏÔ¸ßÓÚpostfixµÄ²âÊÔ»·¾³£©£¬¿ÉÄÜ»áÔì³ÉÒ»¶¨bottleneck£¨ÓÈÆäÊÇlog²»ÊÇasyncдµÄʱºò¸üÃ÷ÏÔ£¬Í¨¹ý¼òµ¥µÄµ÷ÕûΪ·Çͬ²½Ð´µÄ»°¾ÍÄÜÌá¸ßºÜ¶àËÙ¶È£¬ÖÁÉÙ×¢Èë¿ìÁ˺ࣩܶ
´Ó2003ÄêÕâ¸ö²âÊÔ½á¹û˵Ã÷ÁËÈçϵÄÎÊÌ⣺
1.Õâ¸ö½á¹û±È½ÏµÄÖ»ÊÇsmtp×¢ÈëËÙ¶È
2.Õâ¸ö½á¹ûÖ÷ÒªÊÇÌåÏÖÁËÈô¸ÉMTAµÄI/OÏûºÄ¼°¸ßÁ÷Á¿ÏµIJ¢·¢´¦ÀíÄÜÁ¦
3.´Ó½á¹û¿ÉÍÆ¶Ï£¬postfixµÄfsync()²Ù×÷×îÉÙ£¬¶øqmailµÄfsync()½Ï¶à£¬´ÓÌåϵ½á¹¹¼°Éè¼ÆÀ´Ëµ£¬qmailÐèÒªµÄÊÇÒ»¸öÄÜÁ¢¿Ì½«Êý¾Ýͬ²½(sync)µ½´ÅÅ̵ÄÎļþϵͳ£¬Èç¹ûÊÇʹÓÃÁËsoftupdates»òasyncÔòÔÚϵͳ±ÀÀ£»òµôµçʱ£¬Ôì³É¶ªÐÅ¡£
Ò²¾ÍÊÇ˵£¬ÔÚbottleneckÉÏ£¬Í¬ÑùµÄÎļþϵͳ¼°´ÅÅÌ×Óϵͳ£¬postfixʹÓøüÉÙ×ÊÔ´£¬Èç¹ûcpu×ã¹»¿ì£¬Äܹ»ºöÂÔ´¦Àí¶ÓÁкķÑcpuµÄʱ¼äµÄ»°£¬ÄÇôpostfixµÄ¶ÓÁÐÓ¦¸Ã±Èqmail¿ì¶øÎȶ¨¡£
×îºó£¬²âÊÔ¹ý³ÌÖÐqmailµÄ¶ÓÁгöÏÖ¹ýcrash£¬¶øpostfix´Óδ·¢Éú¹ý¡£
²Î¿¼×ÊÁÏ£º
Ò»¸öרÃÅ×ö²âÊÔµÄÍøÕ¾
Serverwatch
Postfix vs qmail
Posted by hzqbbc at 08:22 AM | Comments (1)
Á½È˸ßÊÖ¹ýÕУ¬Ò»¸ömtaËùÐèÒª×öµÄ¹¤×÷²»¶à£¬Ò²²»ÖÁÓÚʲô¶¼¸É°É??ÏÞÖÆsmtp log´óСÊÇlogµÄÊÂ.ÎÒ¾õµÃ¡£µ±È»,·´¹ýÀ´¿´£¬mtaÈç¹ûÄÜ×Ô¼ºÏÞÖÆ£¬Ò²²»´í¡£ÀàËÆqmailµÄÅäÌ×¹¤¾ßÒ»Ñù¡£
ÒÔÏÂÊÇwietseµÄÓʼþ£¬¹ØÓÚdjbµÄдµÄslander»ØÓ¦.
http://groups.google.com/groups?q=artificial+limit+postfix+log+group:mailing.postfix.users&hl=zh-CN&lr=&ie=UTF-8&inlang=zh-CN&selm=9t130n%2412ha%241%40FreeBSD.csie.NCTU.edu.tw&rnum=1
DJB¶ÔvenemaµÄ˵·¨
http://cr.yp.to/qmail/venema.html
ÁíÍâÒ»¸ömaillistÉϵÄÓʼþ£¬°üº¬ÁËÒ»¸ö¼òµ¥µÄpatch
http://lists.q-linux.com/pipermail/plug-misc/2001-November/000963.html
Posted by hzqbbc at 07:18 PM | Comments (0)
¾¹ýʵ¼ÊµÄ²âÊÔÎÒÒ²·¢ÏÖ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£¬ÕâÑùµÄЧÄܵ͡£È·ÊµÒ²ÊÇ¡£ÒòΪÈç¹ûÊÇÁ¬ÐøµÄÓйæÂɵÄд£¬ËÙ¶È»á¿éµÃ¶àµÄ¡£¡£
| ×ÔÓÉ¹ã¸æÇø |
| ¡¡ |