Image may be NSFW.
Clik here to view.
I’m having the following arrangement. One server compiling emails in php and another server which run postfix (thus I have network latencies).
Each email is about 300Kb and so as to send an email (using Zend email class) it takes about 0.2s . However, if I compress the email text content, the size becomes 30Kb and the latency about 0.06 . The problem is that postfix doesn’t support text compression, thus I’m thinking of developing a milter which will decompress emails from the queue.
Can you think of any drawback of this solution or can you suggest any alternative ?
edit: The company I work for sends > 100 000 emails to registered users daily and I’m trying to reduce sending time to minimum.
Image may be NSFW.
Clik here to view.
Prove that it is the network that is your bottleneck.
300KB messages over gigabit ethernet have a theoretical transfer time of about 2.5ms each; this indicates that you could send hundreds of them per second between the source and postfix.
However, postfix also has to store these messages in an on-disk queue, which is far slower – storing 100*300KB messages on disk (~30MB) would probably take up to a second or more, several times slower than the network transit time.
Gather accurate data first, then complain that something is a bottleneck.
Check more discussion of this question.