Coder Social home page Coder Social logo

typesafe-dev-contest-entry's Introduction

Typesafe Developer Contest 2012 Entry

http://typesafe.com/resources/developer-contest

What’s this

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.

URLs

The application has just 2 URLs as follows.

POST /logs {name: “accesslog”, line: “xxx”}

Accepting POST requests, saving params into MySQL and finally returning 200 OK.

POST /logs/async {name: “accesslog”, line: “xxx”}

Accepting POST requests and returning 202 Accepted. Saving params into MySQL will be executed asynchronously.

Frameworks and app servers

Typesafe Stack (Play 2.0.4 + Akka 2.0.2) + MySQL 5.5.24 + Play server 2.0.4

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'

JAX-RS (Jersey 1.13 + Spring 3.1.2.RELEASE) + MySQL 5.5.24 + Jetty 6.1.26

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'

Ruby on Rails 3.2.9 + MySQL 5.5.24 + Passenger 3.0.18

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'

Express 3.0.3 + MySQL 5.5.24 + Node 0.8.0

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'

Precondition

Apache Bench

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

gnuplot

brew install gnuplot

MySQL 5.5.x

brew install mysql
create database typesafedevcontest;
grant all on typesafedevcontest.* to martin@localhost;
set password for martin@localhost = password('odersky');

Ruby 1.9.3

RVM or rbenv

Maven 2.x or 3.x

brew install maven

Node.js 0.8.x

brew install node

Starting applications

Rails 3.2 on Passenger 3.0

cd Rails
bundle install
rake db:migrate RAILS_ENV=production
rake assets:clean assets:precompile
passenger start -e production -d

JAX-RS on Jetty 6.1

cd JAX-RS
mvn clean jetty:run

Express on Node 0.8

cd Express
npm install
node server.js

Play 2.0 on Play server

cd TypesafeStack
play start

Running benchmark scripts

./benchmark_c20.sh
./benchmark_c50.sh

Results

  • 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.

Concurrency 20

c20

Concurrency 50

c50

License

Apache License, Version 2.0

http://www.apache.org/licenses/LICENSE-2.0.html

typesafe-dev-contest-entry's People

Contributors

seratch avatar

Stargazers

l0rdn1kk0n avatar Jonas Bonér avatar

Watchers

 avatar Seshendra Nalla avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.