Silly http benchmark

Luis Neves luis.neves at gmail.com
Thu Jan 28 20:25:09 EST 2010


Thought I would share the results of a silly http benchmark of netty
against the competition.
To keep thinks interesting I added the nginx http server to the mix to
get an idea of how Java server compares to a highly optimized C
server.

Nginx has a module called  "empty_gif" that serves a 1x1 transparent
gif directly from memory which is perfect for this purpose.
I used the exact same gif for all the Java servers.

Both the client and the server machines are quad cores running Linux
2.6.31 that are linked via a 1GB switch.

I used ab as the testing tool with 4 parallel processes. The testing
script is as follows:

*******************************************************************

#!/bin/bash

set -e
cd $(dirname $0)
rm -fv *.log

for i in $(seq 1 4); do
ab -c500 -n1000000 -k -S -r -d http://<host>/bench > $i.log &
done

wait

cat *.log | grep Requests | awk '{ sum+= $4 } END {printf "\n\n
Average requests per second: %8.2f\n\n",sum}'
*******************************************************************


As you can see it's not a very scientific method :-) ... anyway, each
of the ab processes creates 500 connections and makes 1000000
keep-alive requests.
The average results across several runs were:

mina (trunk) - 25K req/sec
grizzly (1.9.18-i)- 55K  req/sec
netyy (3.2-ALPHA3) - 80K req/sec
nginx - 115K req/seq


Impressive results for Netty I think.
The code used is available here:
<http://dl.dropbox.com/u/279023/netty/http_test.tar.gz>

If there is something wrong with it please let me know.


--
Luis Neves


More information about the netty-users mailing list