Closed pcdinh closed 8 years ago
I am working on a project that is a API server. it is Python-based one built on top of Flask, PostgreSQL, Gunicorn and SQLAlchemy. However, it consumes too much memory: 71MB per worker in idle (no request, fresh start) and 76MB per worker on load tests (10 concurrent user, returns JSON object - 20kb). Our API server is very simple at the moment.
It is disappointed. I worked on several very high traffic web projects based on PHP frameworks before. I have never seen any process that consumes more than 13MB. Exceptionally, Joomla-based website can take 20MB per process. However, Joomla CMS has a huge code base.
I am not sure if Flask or SQLAlchemy is source of trouble. Gunicorn master process takes 6MB. However I think that it is acceptable if our API server takes less than 15MB per worker process. Consuming too much memory makes Python site much less scalable than PHP one in prefork mode
I know this is a very old issue, but I just wanted to comment real quick in case anyone else is searching for info on this. Falcon 1.0 takes about 10 MB for a small-ish API test, not using any additional libraries, and running under CPython 2.7.11.
Any idea how Falcon deals with memory footprint? It looks like that both Bottle and Flask micro framework consume more memory than an average PHP framework.
I use Bottle right now because its memory footprint is acceptable.
Ref: http://nuald.blogspot.com/2011/08/web-application-framework-comparison-by.html