I spent the last 5 hours or so updating my imaptest tool. It's beginning to become almost like a real IMAP client. http://dovecot.org/tools/imaptest10.c contains a version that compiles against Dovecot v1.0 (instead of against CVS HEAD).
imaptest is this tool that I've been using for a few years to do stress testing. It can create a lot of dummy IMAP client connections which execute some commands. Today I added some new features to it:
- Support for pipelining commands (where allowed by IMAP spec). Looks like it about doubles the throughput. "no_pipelining" option disables this.
- Support for MULTIAPPEND extension. When multiple mails are APPENDed one after another this extension is used to save them all in one transaction.
- Previous versions gave an error when trying to append large mails. Now large mails work too.
- By default the commands are executed in one specific order. Using "random" option randomizes the order.
- You can separately specifify probabilities of how often to execute each command. 0 means never, 100 means always, 10 means 10% of the time and so on. 100,30 means that it's always executed, and then it's executed again and again with 30% probability.
The basic way to run it is:
./imaptest user=test pass=password host=imap.domain.org mbox=/home/user/mail/dovecot clients=1
Or if you want to run multiple users, you can use user=test%d which will use users test1..test100 (the size is hardcoded in USER_RAND define).
If you want to do benchmarking, you can set it to run for specified amount of time, and you should also give random number generator the same seed every time:
./imaptest seed=123 secs=300
If you want to test/benchmark only the login+logout speed, use:
./imaptest - select=0
To create a lot of long-running clients doing STATUS and NOOPs:
./imaptest clients=100 - logout=0 status=50 noop=50 delay=100
To test copying messages:
./imaptest copybox=Trash
By default LOGIN command is used. If you want to try AUTHENTICATE:
./imaptest auth=100
Hmm. I guess that's about it. The list of commands that you can use starts from line 134. You can use either the long names or the short names.