The last days I spend some time to benchmark the speed of the current SMTP implementation of Apache James Server. The implementation is written on top of netty and so make heavy use of NIO.
I was interested on the "pure speed" of the framework so I removed the queuing and just wrote an MessageHook implementation which returns an 'OK' to the client once the client terminate the DATA command with an '\r\n.\r\n' sequence. I also disabled the logging as this would need to write to disk and slow down things.
I used smtp-source for the tests and used the following settings:
-c -l 5000 -t testuser@localhost -s 2 -m 10000
I also did a second test with adjusted settings...
To get an better overview about this please checkout the smtp-source manpage. The most important options are:
-l 5000 = 5kb message size
-s 2 = two concurrent smtp sessions
-m 10000 = submit 10000 messages
-d = reuse smtp connections
Apache James Server (3.0-beta4-SNAPSHOT):
# time smtp-source -c -l 5000 -t testuser@localhost -s 2 -m 10000 127.0.0.1:2525
10000
real 0m14.496s
user 0m1.020s
sys 0m3.450s
# time smtp-source -c -l 5000 -t testuser@localhost -s 100 -m 50000 127.0.0.1:2525
50000
real 0m44.849s
user 0m5.550s
sys 0m13.360s
# time smtp-source -l 5000 -m 50000 -s 100 -d -t testuser@localhost -c 127.0.0.1:2525
50000
real 0m20.664s
user 0m1.220s
sys 0m5.250s
To get a better feeling about this I did the same tests with haraka, which is a SMTP server written on top of node.js. I also removed any logging from it and wrote a plugin which just returned 'OK' after the DATA termination too.
Here are the stats for it:
Haraka.js Version: 0.9.0
# time smtp-source -c -l 5000 -t testuser@localhost -s 2 -m 10000 127.0.0.1:25
10000
real 0m19.411s
user 0m0.680s
sys 0m2.150s
# time smtp-source -c -l 5000 -t testuser@localhost -s 100 -m 50000 127.0.0.1:25
50000
real 1m24.421s
user 0m6.620s
sys 0m16.240s
# time smtp-source -l 5000 -m 50000 -s 100 -d -t testuser@localhost -c 127.0.0.1:25
50000
real 1m0.033s
user 0m1.500s
sys 0m5.800s
As you can see Apache James Server SMTP implementation is a lot faster on my tests. I did no special configuration for it. Just untar it configured the custom MessageHook.... Thats it.
So I must say I'm very pleased with this benchmark. I think its really fast ;)
I was interested on the "pure speed" of the framework so I removed the queuing and just wrote an MessageHook implementation which returns an 'OK' to the client once the client terminate the DATA command with an '\r\n.\r\n' sequence. I also disabled the logging as this would need to write to disk and slow down things.
I used smtp-source for the tests and used the following settings:
-c -l 5000 -t testuser@localhost -s 2 -m 10000
I also did a second test with adjusted settings...
To get an better overview about this please checkout the smtp-source manpage. The most important options are:
-l 5000 = 5kb message size
-s 2 = two concurrent smtp sessions
-m 10000 = submit 10000 messages
-d = reuse smtp connections
Apache James Server (3.0-beta4-SNAPSHOT):
# time smtp-source -c -l 5000 -t testuser@localhost -s 2 -m 10000 127.0.0.1:2525
10000
real 0m14.496s
user 0m1.020s
sys 0m3.450s
# time smtp-source -c -l 5000 -t testuser@localhost -s 100 -m 50000 127.0.0.1:2525
50000
real 0m44.849s
user 0m5.550s
sys 0m13.360s
# time smtp-source -l 5000 -m 50000 -s 100 -d -t testuser@localhost -c 127.0.0.1:2525
50000
real 0m20.664s
user 0m1.220s
sys 0m5.250s
To get a better feeling about this I did the same tests with haraka, which is a SMTP server written on top of node.js. I also removed any logging from it and wrote a plugin which just returned 'OK' after the DATA termination too.
Here are the stats for it:
Haraka.js Version: 0.9.0
# time smtp-source -c -l 5000 -t testuser@localhost -s 2 -m 10000 127.0.0.1:25
10000
real 0m19.411s
user 0m0.680s
sys 0m2.150s
# time smtp-source -c -l 5000 -t testuser@localhost -s 100 -m 50000 127.0.0.1:25
50000
real 1m24.421s
user 0m6.620s
sys 0m16.240s
# time smtp-source -l 5000 -m 50000 -s 100 -d -t testuser@localhost -c 127.0.0.1:25
50000
real 1m0.033s
user 0m1.500s
sys 0m5.800s
As you can see Apache James Server SMTP implementation is a lot faster on my tests. I did no special configuration for it. Just untar it configured the custom MessageHook.... Thats it.
So I must say I'm very pleased with this benchmark. I think its really fast ;)