From here http://postfixmail.com/blog/index.php/postfix-stress-test/
One of the questions that you will want to solve is how much mail
traffic can your hardware handle. This is often why people overbuild
hardware is that they just are not sure and no one wants to build a
mail server and then rebuild in 3 months. Fortunately, Postfix comes
with a couple programs that you can stress your server with and get a
general idea of what you need.
Hardware Considerations - When you are building a mail server,
especially if you are building a mail server that will host multiple
domains, it is very difficult to determine the necessary hardware as
growth is unknown in two areas. First, growth in terms of new domains
or new accounts on the mail server is tough because business can
change and staff may change dramatically in a 6 month period. When you
build the mail server you want to build something that will
potentially provide 3 years of service, maybe 5. So you must
compensate for the amount of growth for your business. Second, growth
is difficult to estimate based on the amount of Spam your server must
be capable of managing. This is a very frustrating aspect of mail
servers in that potentially, Spam could triple in 3 months and it
would have very little to do with how you are managing your mail
server, so you must also prepare for these kinds of issues. Spam is
especially hard on resources as you will be running a programs like
Spamassassin and an anti-virus program like ClamAv on each of these
emails that hits your system.
Stress Test - The program smtp-source will use port 25 to simulate mail
coming to your mail server to process. In this simulation you can
perform messages by themselves or in parallel. There are several
settings that you can modify to help determine the stress level that
your server will best perform at. In order to run the test you may
have to comment out a few lines in your smtpd restrictions.
smtpd_recipient_restrictions = warn_if_reject reject_non_fqdn_recipient
# reject_unknown_sender_domain reject_unknown_recipient_domain permit_mynetworks reject_unauth_destination reject_non_fqdn_hostname reject_invalid_hostname
# check_helo_access pcre:/etc/postfix/helo_checks check_sender_mx_access cidr:/etc/postfix/bogus_mx reject_rbl_client sbl-xbl.spamhaus.org reject_unverified_sender permit
Parallel sessions – This will indicate the number of concurrent
sessions or maxprocesses that your server will be running.
Message size – You can test various message sizes to simulate the mail
that you typically will receive on your server.
Total messages – You can determine the total messages that you will
test on receiving.
Display counter -This will just show a counter as the messages are
received while the command is running.
# time /usr/sbin/smtp-source -s 20 -l 5120 -m 100 -c -f email@example.com -t firstname.lastname@example.org localhost:25 100
real 0m2.664s user 0m0.020s sys 0m0.100s
This example shows 20 parallel sessions (-s 20), 5KB sized messages
(-l 5120), 100 messages ent (-m 100), counter display (-c), envelope
sender and receiver (-f email@example.com -t firstname.lastname@example.org) and
connection on port 25 of the localhost (localhost:25). The “100”
indicates the total messages sent. The real time (0m2.664s ) is the
time the injection took,. Here is an additional test on the same
server that indicates an increase to 40 sessions, 10 KB mail size and
500 messages. This gives you a way to evaluate the additional load on
the server in terms of a comparison time.
# time /usr/sbin/smtp-source -s 40 -l 10120 -m 500 -c -f email@example.com -t firstname.lastname@example.org localhost:25 500
real 0m29.795s user 0m0.200s sys 0m0.530s