Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.
I find that maintenance and security are simplified by compartmentalizing functionality such that each server is responsible for as few tasks as possible. Ideally, this means 3 slices: one each for db, dynamic and static content. Each can then be scaled independently of the others as the need arises.
If you must start with only 2 slices, the database should still be on its own slice. Combine the dynamic/static web serving onto the second slice. But don’t mess with proxying. Get a second IP on that slice, and use DNS to send all static requests to nginx (eg. static.mysite.com) and all dynamic requests to apache. This will give you better performance and make it dead simple to move the static stuff over to its own slice in the future (just update DNS).
How much traffic do you expect your sites to receive?
I’ve had a half dozen low-traffic Django sites running on a single 256slice with Lighttpd and FastCGI with no problems. My higher-traffic Django sites run on their own slices.
I am assuming that your “static files” component must handle user-uploaded files. You might consider implementing a file storage backend that uploads to Amazon S3 to address this component.
meppum,
That is certainly true for apache in prefork mode, but much less so with the threaded worker mpm that he’s using. I concur with railsninja. Once you go to worker mpm + mod_wsgi, apache is already offloading django requests to the mod_wsgi daemon and static requests can be handled quickly with little overhead by an apache worker thread. Any gains for static requests from putting lighttd in front of apache for this particular config would be questionable, and it actually adds overhead to the django requests.
Again, not particularly applicable to the config that started this thread. With separate WSGI deamon processes handling the django requests, there is no reason apache processes would balloon to 100MB. Yes, that could be possible with the prefork mpm and mod_python. But that is not the config we’re discussing in this case. Apache processes should stay small, and with several threads per process in worker mpm, apache can handle a very high workload with minimal memory utilization.
I see this knee-jerk assessment quite often (“Apache is a memory hog.”) However, that assessment arises from the fact that the default apache config on many distros is prefork mpm + mod_php / mod_python / etc. It is not necessarily true in a general sense.
In the past, I have benchmarked apache/worker against nginx and lighttpd for static file handling and it compares quite favorably both in terms of performance and memory utilization. Yes, it uses somewhat more memory. But in many cases, that is an acceptable tradeoff for the reduction in complexity you get from avoiding multiple web servers, reverse proxying, etc.
Posted By: artageswAgain, not particularly applicable to the config that started this thread.
1 to 20 of 20