sollte es mal eng werden mit den Zugriffen und somit der Serverlast, gibt es Möglichkeiten der Latverteilung:
http://forum.slicehost.com/comments.php?DiscussionID=2398
For anyone that might be searching for this, here is what I ended up doing.
1 server only handles the db.
1 server handles all static content and django. I am using lighttpd on port 80 of this server. It then proxies django requests to apache on 127.0.0.1:80. You can see the config below for lighttpd.
$HTTP["host"] =~ "^(www\.)?example.net" {
alias.url = (
"/admin_media/" => "/sources/svn/django1.0/django/contrib/admin/media/",
"/media/" => "/home/example/example.net/example_media/media/",
"/user_media/" => "/home/example/example.net/example_media/user_media/",
)
$HTTP["url"] !~ "^/(admin_media|media|user_media)/" {
proxy.server = ( "" =>
( (
"host" => "127.0.0.1",
"port" => 81
) )
)
}
}
Spannend ist diese Aussage:
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.
Ist auch das, was ich so denke
-- DetlevLengsfeld 2008-11-11 07:04:04
Python/Django/lighttpd setup (last edited 2008-11-11 07:16:26 by )