Web application framework comparison by memory consumption

Memory consumption is slightly specific to my area of software development now, but I did some research recently and maybe these results can be useful for others. Of course, I know that precious comparison is very difficult to carry out, but actually I needed only overall picture. And let me admit that results are pretty interesting and even frustrated (at least for me).

As a basis I took so-starving project, and measured initial RSS (Resident Set Size) of the each process (local development webservers). Platform: x86_64 Linux (latest Ubuntu with all updates).

As a reference, here is the RSS of the interpreters in interactive console mode:

InterpreterVersionRSS (kB)
stackless python2.6.43916
ruby (via irb)1.8.74664
python2.7.15624
php5.3.56924
v8 (via node.js shell)2.5.9.98796

One more reference - the most simplest WSGI app (example in the Python documentation). It's RSS: 7336 Kb, so I assume it's almost impossible to consume less memory without additional tweaks and optimization.

The WF comparison itself:

InterpreterFWVersionRSS (kB)
phpphp-cgi (only as reference)5.3.56116
v8node.js0.2.68692
pythonbottle0.8.49688
pythonitty0.8.19888
pythonpyroutes0.4.110356
pythonwebpy0.3410992
pythontornado1.0.111640
pythonwebob1.012608
pythondjango1.312720
pythonflask0.6.114972
rubysinatra1.015728
pythontwisted10.2.016928
pythonweb2py1.98.217764
pythonjuno0.1.219068
stackless pythonnagare0.3.021232
pythonpyramid1.222748
rubyrails2.3.435412

Of course, development servers are not optimized and can't be use in production, but overall image is clear and give us an idea of the memory usage of different WF.

Comments

  1. You have a very interesting posts,
    Have you considered using Lua?

    Regars

    Caio Pereira

    ReplyDelete
  2. I considered, but it's difficult to find Lua developers. Actually, I'd prefer to use Lua - it has pretty good, not overcomplicated syntax, less memory consumption, good C binding support. I believe it's perfect for embedded systems, but we should consider human factor too - people even suck in Python and JavaScript, I doubt they will write good Lua code.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I measured the 2016 versions of (bottle cherrypy flask tornado web.py); and also, before and after they served 2000 requests.

    See my code & output at

    https://github.com/drandreaskrueger/pythonMicroframeworks

    ReplyDelete

Post a Comment

Popular posts from this blog

Trac Ticket Workflow

Shellcode detection using libemu