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

I have two server with two version of django 0.9.6 and 1.0.2.

both are used, for some older sites(where migration is still pending) and now ppl have started using 1.0.2.

I have apache 2.2.9 and mod_python 3.3.1 on a RHEL 4 32 bit server.

In one server all sites irespective of django version works pretty fast.

but in the second server site with django 1.0.2 takes a initial loading time of 4-5 sec(waiting for site....in status bar).

All caching/compreesion etc. are perfectly done.

I suspect some mod_python/django isolation issue, where my apache Keep-Alive is on.

BUt again these two server has simillar apache settings, so its a crazy moment for me now. I even compared all file permission/library installed etc.

Kindly advice how do i proceed.

Best Regards Debajit

share|improve this question

3 Answers 3

Firstly do follow the mod_wsgi recommendation.

You should also ensure that you aren't serving media through mod_python. Apache is good at serving static files but your parser will do an awful job. There is some information in the Django docs here.

You may get more detailed help by including sanitised copies of your configs.

share|improve this answer

Apache/mod_python lazily loads Django application on first request for it so your first request will see that delay in loading all the code and initialising your application data.

This problem can seem really bad if using prefork MPM in Apache because more processes into which that loading of the application has to be done and so more initial requests affected.

Apache/mod_wsgi has same issue. If this is a problem you need to configure preloading of your application.

For other problems with using Apache/mod_python see:

http://blog.dscpl.com.au/2009/03/load-spikes-and-excessive-memory-usage.html

share|improve this answer

Django recommends mod_wsgi for productive installations. See http://docs.djangoproject.com/en/dev/topics/install/#install-apache-and-mod-wsgi for more informations. Maybe you give this Apache module a try and see if the issue remains.

share|improve this answer

Your Answer

 
discard

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