Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We're trying to optimize a Dell PowerEdge 1850, Dual 3GHz procs, 3072MB RAM, running Postfix 2.8.4 and signing mail with OpenDKIM 2.4.1.

iostat -x output is:

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.59    0.04    0.20    0.24    0.00   98.94

Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00    11.57  0.01  4.97     0.27   132.35    26.63     0.03    6.09   2.03   1.01
sda1              0.00     0.00  0.00  0.00     0.00     0.00    13.40     0.00   16.26  15.73   0.00
sda2              0.00    11.57  0.01  4.97     0.27   132.35    26.63     0.03    6.09   2.03   1.01
dm-0              0.00     0.00  0.01 16.54     0.27   132.35     8.01     0.11    6.55   0.61   1.01
dm-1              0.00     0.00  0.00  0.00     0.00     0.00     8.00     0.00    3.42   0.44   0.00

Top output:

top - 22:10:04 up 86 days,  1:46,  5 users,  load average: 2.99, 2.94, 2.82
Tasks: 227 total,   8 running, 218 sleeping,   0 stopped,   1 zombie
Cpu(s): 66.1%us,  1.3%sy,  0.0%ni, 32.3%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   3115136k total,  2819188k used,   295948k free,   248620k buffers
Swap:  5177336k total,        0k used,  5177336k free,  1695580k cached

We're using SwiftMailer to deliver mail to Postfix via SMTP. If we try to fire up more than 3 parallel instances of a PHP script that sends via SwiftMailer, the load average goes to 3+ and the delivery speed goes way down. It's taking us almost a full day to send 500K messages. The remote mail servers are happily accepting our mail, and any that defer are passed off to a fallback relay.

During a send, our qshape shows the queue emptying quickly:

                                     T  5 10 20 40 80 160 320 640 1280 1280+
                              TOTAL 10 10  0  0  0  0   0   0   0    0     0
                          gmail.com  2  2  0  0  0  0   0   0   0    0     0
                          yahoo.com  2  2  0  0  0  0   0   0   0    0     0
                            aol.com  1  1  0  0  0  0   0   0   0    0     0
                            aim.com  1  1  0  0  0  0   0   0   0    0     0
                           evhs.net  1  1  0  0  0  0   0   0   0    0     0
                         myactv.net  1  1  0  0  0  0   0   0   0    0     0
                        hotmail.com  1  1  0  0  0  0   0   0   0    0     0
                     googlemail.com  1  1  0  0  0  0   0   0   0    0     0

And because we're using a fallback relay, the deferred queue on our main SMTP server is empty.

We're using a local recursive cacheing nameserver (Unbound), and have followed all the tuning tips in the Postfix Tuning README. But we're still scratching our heads as to where to look for the bottleneck as to why it takes all day to send 500K messages. I've read other Postfix optimization articles (including one on ServerFault) but the culprit there always seems to be IO. But our iostat output looks like the disks aren't busy as at all.

Where else should we start looking?

share|improve this question
    
what's your ISP uplink utilization look like? maybe you're being throttled? –  SpacemanSpiff Jul 27 '11 at 5:36
    
Using an opcode cacher? Are the php scripts heavy on cpu? –  3molo Jul 27 '11 at 8:35
add comment

3 Answers 3

up vote 1 down vote accepted

Without signing and outbound Spam scanning Postfix can easily handle 360,000 mails per hour.

The problem here is the 66.1%us CPU usage. As you provide no information about the processes that consume this load, I would assume that they are not related to Postfix. They are either the DKIM signing process or the PHP processes.

You need to tune the processes that are responsible for the load and not the process that is responsible for mail delivery.

share|improve this answer
add comment

"If we try to fire up more than 3 parallel instances of a PHP script that sends via SwiftMailer, the load average goes to 3+ and the delivery speed goes way down."

You may want to take a closer look at the script's memory and/or CPU processing requirements/load.

share|improve this answer
add comment

Are you using software raid? I had a problem a short while ago, and raid (raid 5) was a problem. Either use raid 10, or don't use raid at all.

In terms of postfix, try looking at default_process_limit. Maybe use a value of 50. Also, install locally a caching nameserver (e.g. dnsmasq), could help with DNS.

HTH

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.