JavaScript Node.js vs. Python Tornado (fully asynchronous stack with MongoDB): performance comparison benchmarks

Monday, June 17, 2013

At a glance.

Deployment platform: Ubuntu 64 bit on a Intel quad-core CPU

- Node.js version 0.10.11 + Express

- Python 2.7.4 + Tornado 3.0.1

- nginx 1.2.6

- MongoDB 2.4  (official driver for Node.js, asyncmongo 1.2 for Python/Tornado)



The Node and Tornado App simply exposes a REST API for accessing "persons" resources.
In particular the API:


GET /persons/51a6254e564b6cb01d498700

called through:

Apache Benchmark tool with:

ab -c 25 -n 100000 http://myserver/persons/51a6254e564b6cb01d498700

from a MacBook connected to the same LAN (ethernet 100Mb)

Results are:



1 nginx + 4 node.js + MongoDB (async driver) 
======================================

best: 2198 req/s, 11.3  ms/req

worst: 1500 req/s, 17 ms/req




1 nginx + 4 Tornado + MongoDB (async driver)
======================================

best: 2178 req/s, 11.4  ms/req

worst: 1545 req/s, 16 ms/req  




That's all.


You Might Also Like

1 commenti

Subscribe