Eren,

I don't have big experience but I think
there is no way that you can use frameworks and have small amount of
memory and slow processor, especially if your application is big.

One of my colleagues spend about 4 months writing quite big project in
django.
It was installed on a small box with 512 MB of RAM and Celeron 2.0 and
we asked 40 people to just browse the new intranet website - after few
seconds the server went down.
So we have moved everything to HP Proliant - RAID5, 4GB of RAM, 2x
dual core 3.00GHz and MySQL db also to new machie with the same spec
as web server.
Unfortunately, even on new machine our server was not able to do more
then 5 requests per sec without caching!
What really surprises me is that big django app can use even 90% of
CPUs!

My advice is to us ab (Apache HTTP server benchmarking tool) to see
how many requests per second your site can do.
but the first thing is to buy your servers more RAM and use cache.

Just to see how fast caching can be, add the following into your
settings.py:
CACHE_BACKEND = 'locmem:///'
and   'django.middleware.cache.CacheMiddleware' as a first line to
your MIDDLEWARE_CLASSES

Second thing is to profile your code.
Django by default comes with django.core.handlers.profiler-hotshot

To see where is the bottle neck of you app
mkdir /var/log/cmsprofile
chown www:www /var/log/cmsprofile
add django.core.handlers.profiler-hotshot
#PythonHandler django.core.handlers.modpython
PythonHandler django.core.handlers.profiler-hotshot
How to read the prof files from hotshot see
http://www.rkblog.rk.edu.pl/w/p/django-profiling-hotshot-and-kcachegrind/

You can also use Profiling Middlware from 
http://www.djangosnippets.org/snippets/186/

Processing requests can be very expensive.
so users_list = get_users(request)
where get_users is large def, will almost always take huge amount of
resources.

Also, especially if your app is big, lines like:
    houses = House.objects.all()
    groups = Group.objects.all()
is more then likely about 15 req per sec less, even if these are very
small tables.

kind regards,
Paul
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to