2 messages in net.sourceforge.lists.courier-users[courier-users] High load trouble whe...
FromSent OnAttachments
Arnaud JAYETJan 25, 2005 5:28 am 
Gordon MessmerJan 25, 2005 9:13 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] High load trouble when broadcasting mailActions...
From:Arnaud JAYET (aja@free.fr)
Date:Jan 25, 2005 5:28:39 am
List:net.sourceforge.lists.courier-users

Hello,

i've some trouble with system high level load when broadcasting a mail to an alias representing all my users (~ 1700 users).

i have 2 servers : smtp gateway + pop/imap server for maildir hosting.

smtp gateway is a "small/standard machine" (athlon 1 Ghz, 1 Go RAM, 9 Go SCSI HD). pop/imap server is a bi-xeon 2.4 Ghz , 2Go RAM, 8 HD 200Go IDE on a 3Ware controller).

on the imap server i'm using debian woody + postfix 2.0.13 whith VDA patch for soft quota, courier-pop/imap 1.4.3, openldap as data backend (for postfix and courier-imap). ldap server is local on the imap server.

Standard access to maildir is IMAPS (by mail client or webmail) for all users

the problem :

in normal use, my load average is OK : about ~0.1 - 0.2 , mail delivrery is fast (about 1 seconde from a MUA to the user maildir with relaying by the stmp gateway which do an AV scan of the mail). mail delivery is fast, imap connections are responsive.

13:47:31 up 28 days, 20:38, 3 users, load average: 0.00, 0.07, 0.04 490 processes: 489 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 0.4% user, 0.4% system, 0.0% nice, 99.2% idle Mem: 2068312K total, 2023296K used, 45016K free, 183508K buffers Swap: 3903712K total, 1700K used, 3902012K free, 1108740K cached

When i broadcast a mail from my PC to all users (1700 emails), the load average on the imap server increases very high and very fast (up to 60 !). RAM & cpu use seems to be OK (no swap, cpu up to 50-60% during the mail broadcast). I do some debug with postfix : nothing strange. So i think there is a critical ressource but i can't find wich one.

i verify my ldap indexes : ok. I also cut off all DNS bottlenecks by adding the smtp gateway IP in /etc/hosts. ldap searches are local.

As i don't really know how to scale the imap server (it's my first big experience with a lot of users), i took precaution with large value for courier-imap parameters (too high values ???)

maxdaemons : 40 --> 400 daemons for ldap auth : 5 --> 20 maxperip : 2 --> 1000 (because of webmail with connect to imap server from the same IP, those of the web server)

after some studies, i may say it's a delivery bottleneck. The smtp gateway relays correctly and quickly to the imap server (no high charge on the smtp gateway), the postfix queue fills quickly on the imap server but the delivery into maildirs is very slow (about 3 delivers per second). During the delivery time, system load increases a lot and imap connections are responsiveness (wich is annoying).

I/O bootleneck ? (using 8 IDE disks RAID5 on a 3ware controller, ext3 RAID5 filesystem for the maildirs, but the var/spool/postfix is on a RAID1 filesystem)

Critical process ? i did not modify postfix master.cf, So normally 100 daemons are possible simustaneoulsy for virtual delivery. I try to limit smtpd daemons to 10 to limit volontary smtp connections between smtp server and imap server but no effect to regulate mail flow, but postfix on imap server accepts quicky the broadcast mail for all users (verified with mailq , queue fills up quickly) even with 10 daemons.

Thank you for any help, advises, way to dig. (sorry for my approximate english)

-- Arnaud JAYET jay@free.fr

my main.cf and my master.cf

################################# # main.cf # bart.univ-lille3.fr #################################

################ # golbal config ################ command_directory = /usr/sbin #program_directory = /usr/lib/postfix queue_directory = /var/spool/postfix readme_directory = /etc/postfix/readme sample_directory = /etc/postfix/samples sendmail_path = /usr/sbin/sendmail manpage_directory = /usr/local/man daemon_directory = /usr/libexec/postfix newaliases_path = /usr/bin/newaliases mailq_path = /usr/bin/mailq smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) setgid_group = postdrop biff = no mail_owner = postfix unknown_local_recipient_reject_code = 450

# appending .domain is the MUA's job. #append_dot_mydomain = yes

myhostname = bart.univ-lille3.fr mydomain = $myhostname myorigin = $myhostname

# 2 Mo maxi de taille du mail message_size_limit = 3145728

# limitation du nombre de recipients smtpd_recipient_limit = 2000

mydestination = $myhostname localhost localhost.$mydomain # etu.univ-lille3.fr # pers.univ-lille3.fr

# mail accepted only from smtp gateway and locally mynetworks = 127.0.0.1/32 , 194.254.131.216/32

relayhost=194.254.131.216

notify_classes = resource,software,bounce,2bounce #header_checks = regexp:/etc/postfix/header_checks

######################## # Comptes Locaux ######################## home_mailbox = Maildir/ local_recipients_maps= $alias_maps, unix:passwd.byname mailbox_size_limit = 0 recipient_delimiter = +

################## # transport # @bart.univ-lille3.fr = local # @etu.univ-lille3.fr = virtual # @pers.univ-lille3.fr = virtual ################### transport_maps= hash:/etc/postfix/transport

#################### # local delivery #################### alias_maps = hash:/etc/postfix/aliases alias_database = hash:/etc/postfix/aliases

#################### # virtual delivery #################### ###mailbox_transport = virtual virtual_mailbox_base = /lille3/mail virtual_maildir_extended = yes virtual_maildir_suffix = / virtual_create_maildirsize = yes

# le mail sera géré par le user postfix, groupe postfix (201) virtual_minimum_uid = 201 virtual_uid_maps = static:201 virtual_gid_maps = static:201

##################### # gestion des mailbox ##################### virtual_mailbox_maps = ldap:ldapmaildir virtual_recipient_maps = ldap:ldapmaildir virtual_result_attribute = mailMessageStore

########################## # gestion des ré-écritures # @pers.univ-lille3.fr ########################## recipient_canonical_maps = regexp:/etc/postfix/canonical-regexp,hash:/etc/postfix/canonical sender_canonical_maps = hash:/etc/postfix/canonical-sender

##################### # gestion des quotas ##################### # taille mailbox maxi = 100 Mo virtual_mailbox_limit = 104857600 virtual_mailbox_limit_maps = hash:/etc/postfix/vquota virtual_mailbox_limit_override = yes virtual_overquota_bounce = yes

ldapmaildir_timeout = 30 ldapmaildir_server_host = 127.0.0.1 ldapmaildir_search_base = dc=univ-lille3,dc=fr ldapmaildir_server_port = 389 ldapmaildir_query_filter = (mail=%s) ldapmaildir_result_attribute = mailbox ldapmaildir_bind = yes ldapmaildir_bind_dn = cn=mailadmin,ou=admin,dc=univ-lille3,dc=fr ldapmaildir_bind_pw = xxxxxxxxxxxx

######################## # debug parameters ######################## debug_peer_list = 194.254.131.216/32 debug_peer_level = 1

smtp inet n - n - 10 smtpd #628 inet n - n - - qmqpd pickup fifo n - n 60 1 pickup cleanup unix n - n - 0 cleanup qmgr fifo n - n 300 1 qmgr #qmgr fifo n - n 300 1 nqmgr rewrite unix - - n - - trivial-rewrite bounce unix - - n - 0 bounce defer unix - - n - 0 bounce flush unix n - n 1000? 0 flush proxymap unix - - n - - proxymap smtp unix - - n - - smtp relay unix - - n - - smtp # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5 showq unix n - n - - showq error unix - - n - - error local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - n - - lmtp # # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. # # maildrop. See the Postfix MAILDROP_README file for details. # maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient} # # The Cyrus deliver program has changed incompatibly, multiple times. # old-cyrus unix - n n - - pipe flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} # Cyrus 2.1.5 (Amos Gouaux) cyrus unix - n n - - pipe user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user} uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient