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:
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:
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.
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:
Interpreter | Version | RSS (kB) |
---|---|---|
stackless python | 2.6.4 | 3916 |
ruby (via irb) | 1.8.7 | 4664 |
python | 2.7.1 | 5624 |
php | 5.3.5 | 6924 |
v8 (via node.js shell) | 2.5.9.9 | 8796 |
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:
Interpreter | FW | Version | RSS (kB) |
---|---|---|---|
php | php-cgi (only as reference) | 5.3.5 | 6116 |
v8 | node.js | 0.2.6 | 8692 |
python | bottle | 0.8.4 | 9688 |
python | itty | 0.8.1 | 9888 |
python | pyroutes | 0.4.1 | 10356 |
python | webpy | 0.34 | 10992 |
python | tornado | 1.0.1 | 11640 |
python | webob | 1.0 | 12608 |
python | django | 1.3 | 12720 |
python | flask | 0.6.1 | 14972 |
ruby | sinatra | 1.0 | 15728 |
python | twisted | 10.2.0 | 16928 |
python | web2py | 1.98.2 | 17764 |
python | juno | 0.1.2 | 19068 |
stackless python | nagare | 0.3.0 | 21232 |
python | pyramid | 1.2 | 22748 |
ruby | rails | 2.3.4 | 35412 |
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.
You have a very interesting posts,
ReplyDeleteHave you considered using Lua?
Regars
Caio Pereira
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.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI measured the 2016 versions of (bottle cherrypy flask tornado web.py); and also, before and after they served 2000 requests.
ReplyDeleteSee my code & output at
https://github.com/drandreaskrueger/pythonMicroframeworks