On Thu, 2009-09-24 at 16:06 +0800, Anrs wrote:
> hi everybody, We want to develop a Bussiness web site with Django
> framework, but we can't decide django's performance. So, would you
> list some large-scale web sites that used django for us?

You're not going to get any meaningful feedback by looking at high
profile sites, because you don't know if the backend is similar to yours
or what they did for scaling.

I'm currently developing a custom-CMS for a local organization, and I've
optimized the shit out of it ... because we are expecting for the
website's link to be placed on a couple of popular sites.

What I did ...

The url-dispatcher and the templating system are fast, you won't have
any problems with them.

The main problem is the DB access, but Django has a good caching API ...
the cache entry is usually generated depending on the parameters the
object you're trying to cache depends on.

For example, to cache the HTML of the menu (which is dynamic), in my
project I'm doing ...

   {% cache primary_menu 600 request.path request.CURRENT_LANGUAGE
request.user.id %}
     {% for item in primary_menu %}
       <li><a href="{{ item.href_url }}">{{ item.href_text }}</a></li>
     {% endfor %}
   {% endcache %}

"primary_menu" is a resultset. The query doesn't get executed until it
is iterated. The cache entry "primary_menu" also depends on the current
URL, the current language and the current user, generating different
cache entries for each combination.

For caching I'm using MySql instead of Memcached, at least for now (it's
more economic, more flexible, and I'm not doing sharding yet).

When I'm making modifications to the menu, from the ArticleAdmin I'm
invalidating the cache entries that are LIKE "template.primary_menu.%"

Basically I'm caching everything, making sure I'm invalidating the
cache-keys once I make modifications, and although I'm still using MySql
as a caching mechanism, practically I've reduced ~ 30 complicated
queries to 5 or 6 simple and very efficient queries.

I'm also serving static files with Varnish. It can easily handle
thousands of requests per second.

Overall my website's frontend can serve on average 200+ requests per
second with only one machine.



--~--~---------~--~----~------------~-------~--~----~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to