On 1/5/07, David Abrahams <[EMAIL PROTECTED]> wrote:
...
> Most likely, KeepAlive is holding processes unavailable while
> sitting idle.
How would I tell if that was happening?
Turn it off and see if performance suddenly becomes rediculously good. :)
If you want more evidence, perhaps the status module would interest you.
> Next most likely is # of child processes. Try fiddling with Min and
> MaxSpareServers.
> http://httpd.apache.org/docs/2.0/mod/prefork.html
According to the docs that should only be necessary if I have very
heavy traffic. I don't; far from it. So I'm reluctant to mess with
those.
Except that KeepAlive ties up processes waiting for further requests
from a client, which may never come (and certainly won't if you run
media separately as recommended.
The thing to remember is that apache+modpython+django+your app is a
very large process, and you should try to keep it busy doing Django
where possible. Otherwise, you're wasting resources... swatting flies
with hammers, so to speak.
> Next most likely is that you're serving media and django on the save httpd.
I definitely am. However, on a relatively low-traffic server like
mine it's hard to imagine that it's causing the kind of slow responses
I sometimes see. Maybe I'm deluding myself?
If your processes are tied up listening to a client that's not
talking, your server will sit completely idle doing nothing for as
long as KeepAlive makes them.
Want to see ridiculously bad performance? Make 1 server process, set
KeepAlive, and server media from it. It'll take (timeout * # of http
request seconds) to serve if your client doesn't actually utilize the
keepalive feature.
I could probably install lighthttpd, although
getting that running alongside Apache seems like a minefield (just a
feeling; I have no data).
There's no need at all to run a separate machine for media. Lightty
serving media files is crazy-fast. As long as you have a separate IP
(and Apache is doing IP-based, rather than name-based, service), it's
quite simple.
In your lighttpd.conf:
=======
server.port = 80
server.bind = "your.media.ip"
server.username = "same as apache"
server.groupname = "same as apache"
server.pid-file = "/var/run/lighttpd.pid"
server.dir-listing = "disable"
server.document-root = "/path/to/media_root/"
server.errorlog = "/var/log/lighttpd/error.log"
accesslog.filename = "/var/log/lighttpd/access.log"
#mime support if you want it:
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
=============
Then set MEDIA_URL = media.yourdomain.com
and make a DNS entry pointing media.yourdomain.com to your.media.ip.
The LightHttpd docs make it sound like it
would be better than apache for all _my_ webserver needs, but using it
that way with Django sounds like it's still pretty experimental at
best.
Apparently a fair number of people are using fcgi, though I'm not one of them.
Did you see this?
http://www.djangoproject.com/documentation/fastcgi/#lighttpd-setup
In any case, you seem reluctant to make changes, but IMHO, the best
thing you can do is keep a copy of your existing (bad) conf and do a
series of A/B performance tests, starting with the suggestions here
and in Jacob's post. :)
To help future suggestions, what apache and OS versions are you running?
-Jeremy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---