Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm scratching my head on this one.

Django is installed on my production and dev servers but the live server under not ver heavy load is running extremely slow. Every page is taking more than 30 seconds at times.

here is my Apache sites-available/example.com file:

<VirtualHost *:80>
ServerName www.example.com
ServerAdmin derek@example.com
<Directory /var/www/sites/example.com>
    Order Deny,Allow
    Allow from all  
</Directory>

WSGIDaemonProcess example.com user=example group=example threads=25
WSGIProcessGroup example.com
WSGIScriptAlias / /var/www/sites/example.com.wsgi

Alias /media /var/www/sites/example.com/media
<Directory /var/www/sites/example.com/media>
    Order Deny,Allow
    Allow from all
</Directory>
</VirtualHost>

and this is what i have in my wsgi file

        #!/usr/bin/env python

        project = "fishpond"
        sitename = "www.fishpond.ie"
        envpath = "/var/www/env/dev.fishpond.ie/lib/python2.6/site-packages"

        import os, sys, site
        sys.path.append(os.path.join(os.path.dirname(__file__), sitename))
        sys.path.append("/var/www/sites/new.fishpond.ie/")
        os.environ['DJANGO_SETTINGS_MODULE'] = ("%s.settings" % project)
        site.addsitedir(envpath)

        import django.core.handlers.wsgi

        application = django.core.handlers.wsgi.WSGIHandler()

If you need any other info let me know.

Biggest problem being I can't find any error message in log when I run 'top' for example I don't see any unusual load on the server or high mem usuage.

Any help is greatly appreciated.

Derek

share|improve this question
    
Can you post an "apache2ctl status"? –  Halfgaar Jan 27 '11 at 12:52
add comment

2 Answers

up vote 2 down vote accepted

You could use WSGI level request/response logging as described in:

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques#Tracking_Request_and_Response

to see when WSGI is entered and exited to try and validate whether issue is before WSGI application even gets invoked.

share|improve this answer
add comment

In the end I ran nginx in conjunction with apache and it seems to be working well.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.