> Hello, > > We want to host ~20 distinct WSGI applications using nginx and uWSGI on a > single machine. I am looking for advice on these two candidate setups: > > 1/ Run a single uWSGI instance and use the dynamic application mode to > dynamically create a sub-interpreter for each application? > > 2/ Run one separate uWSGI instance for each application? > > Which setup would you recommend? What are the advantages and drawbacks of > each setup? Any other possible setup?
There is surely no one-fit-for-all response, i will try to comment on your statements and i will give a personal suggestion at the end > > Regarding the first setup, I am afraid of having 20 different interpreters > running in the same process. For example, what about reloading an upgraded > application? reloading/upgrading (if done in graceful mode) is not a real issue (except for a first request being very slow). What scares me of having too much apps in a single process, is the big memory usage (i prefer to have more little processes and less big one, and remember that on 32bit system you have at max a couple of gigs of memory for process) and the not-perfect isolation of python interprerers. For me, 20 apps are too much for a single process, i suggest you to avoid this approach > > Regarding the second setup, I have to choose sockets/ports for each > application and type that information twice: once in nginx config and once > in supervisord config (this is the process manager we use). Maybe I should > use a configuration tool like fabric. > This is the main issue (doing double configurations), so my suggestion is looking at this wiki page: http://projects.unbit.it/uwsgi/wiki/CustomRouting It is for 0.9.7-dev but you can use the development version for routing and the stables one for your apps -- Roberto De Ioris http://unbit.it _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
