http://typesafe.com/resources/developer-contest
I was going to create a high performance HTTP API server using Typesafe Stack. But I became more interested in performance measurement. This is a simple benchmark for Typesafe Stack app and others that have the same function. I’m afraid that this entry is not suitable on the theme of the contest, but I believe it doesn’t entirely devoid of interest. Anyway, please have a look.
The application has just 2 URLs as follows.
Accepting POST requests, saving params into MySQL and finally returning 200 OK.
Accepting POST requests and returning 202 Accepted. Saving params into MySQL will be executed asynchronously.
curl -XPOST http://localhost:9000/logs -d'name=access_log&line=xxx' curl -XPOST http://localhost:9000/logs/async -d'name=access_log&line=xxx'
curl -XPOST http://localhost:8080/logs -d'name=access_log&line=xxx' curl -XPOST http://localhost:8080/logs/async -d'name=access_log&line=xxx'
curl -XPOST http://localhost:3000/logs -d'name=access_log&line=xxx' curl -XPOST http://localhost:3000/logs/async -d'name=access_log&line=xxx'
curl -XPOST http://localhost:8124/logs -d'name=access_log&line=xxx' curl -XPOST http://localhost:8124/logs/async -d'name=access_log&line=xxx'
If you’re using Mac OS X, please replace ab
command as follows.
wget http://apache.mirrors.pair.com/httpd/httpd-2.4.3.tar.bz2 brew install pcre tar xzvf httpd-2.4.3.tar.bz2 cd httpd-2.4.3 make sudo cp -p support/ab /usr/sbin/ab
brew install gnuplot
brew install mysql
create database typesafedevcontest; grant all on typesafedevcontest.* to martin@localhost; set password for martin@localhost = password('odersky');
RVM or rbenv
brew install maven
brew install node
cd Rails bundle install rake db:migrate RAILS_ENV=production rake assets:clean assets:precompile passenger start -e production -d
cd JAX-RS mvn clean jetty:run
cd Express npm install node server.js
cd TypesafeStack play start
./benchmark_c20.sh
./benchmark_c50.sh
- Play 2.0 is much faster than Rails and Express.
- JAX-RS Jersey is stable and pretty fast.
- Play 2.0 which uses Akka actors as backend is the fastest of them all.
Apache License, Version 2.0