We use django for a project in my company, and by using memcached and a few
db_index on the correct fields of my models, I was able to go from 3 request
per second, to approximatelly 300 request per second, mainly doing views
cache. I didnt resort to
per-model caching, or even NGINX and it solved my purpose well... ( A side
note on cache_page(), you should be careful if you have logged in sessions
or the famouse "Welcome <user>" phrase on the top of your website. You would
have to get around that
in order to have an effective cache system if thats the case on your
website, there are ways. )

The final word is that you should be familiar with django's cache systems,
so that you can take advantages of them. In fact, you cant go into
production without setting something like that up, my opinion.

 Consider buying more RAM ( which is cheap nowadays), then go with
memcached, and as a plus use reverse-proxy if needed.

my 0.02 cents,
Victor Lima



2009/12/22 omat <o...@gezgin.com>

> Thank you both very much for the comments.
>
> I just setup ngnix in front of apache yesterday and it really helped
> getting out of this mess. I didn't know about its advanced features
> you mentioned and I will experiment with them soon.
>
> I am caching the context of a page, but when new content arrives, it
> changes context of around 10 pages.
>
> I want to have control of the cache and expire pages programmatically
> when new content arrives, not after a pre-defined time period. For
> this, I can use Etag, modified-since, etc. to set a relatively short
> time for crawlers, such as 1 hour, but cache the actual content for
> much longer, e.g. 1 month. Then, if something related to its context
> is submitted, I remove those pages from the cache.
>
> Maybe I am thinking this in a wrong way from the start.
>
>
> Thanks,
> omat
>
>
>
>
>
> On Dec 22, 3:50 pm, Javier Guerra <jav...@guerrag.com> wrote:
> > On Tue, Dec 22, 2009 at 8:44 AM, Michael <newmani...@gmail.com> wrote:
> > > Nginx can also create static files from dynamically served pages, so
> you
> > > could serve pages directly from disk.
> >
> > this is one of the best ways to do it.  you could setup a
> > mostly-complete static copy of your site, and make nginx call the
> > dynamic one in it's 404 handler to 'fill the voids'.  some benchmarks
> > show nginx static file handling roughly as fast as going to memcached.
> >
> > another point, maybe your current solution isn't helping with the
> > appropriate Etag, if-modified-since, and similar headers.  these are
> > very important to let other machines in the way cache your content,
> > and the spiders _should_ use them to know when not to re-read and
> > re-index it.
> >
> > of course, if you set the static copy as a 'front layer', you should
> > get those for free.
> >
> > --
> > Javier
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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