On Oct 19, 1:08 pm, Russell Keith-Magee <freakboy3...@gmail.com>
wrote:
> On Mon, Oct 19, 2009 at 6:52 PM, mt <michael.thornh...@gmail.com> wrote:
>
> > Hi All,
> > I recently upgraded a high traffic site from django 1.0 to django
> > 1.1.1 and noticed that the load on the server went through the roof,
> > so I had to revert to django 1.0.
> > I've done some testing and noticed that the caching behaviour between
> > 1. 0 and 1.1.1 has changed.
> > Basically I was caching expensive database queries using memcached, in
> > django 1.0 reading from the cache is a fast operation however in
> > django 1.1.1 reading from cache causes all fields with a callable as
> > default to be called.
> > In the case where that callable is an expensive operation the
> > performance is severely affected.
> > I've created patches showing this regression for the branches
> >http://code.djangoproject.com/svn/django/branches/releases/1.0.X
> > and
> >http://code.djangoproject.com/svn/django/branches/releases/1.1.X
> > which shows the default callable being called on cache read.
>
> > My questions are:
> > 1. Is it wrong to store querysets in the cache?
>
> Strictly, a queryset doesn't contain *any* data - it's just a
> programatic representation of a SQL query. So, putting a queryset in
> the cache doesn't inherently mean that anything is being stored.
> However, if the queryset has been evaluated, there might be something
> in the queryset's internal result cache, and *that* value will be
> returned when the value is retrieved from the cache.
>
> > 2. Should I log a bug for this in the django tracker and upload my
> > test case patches?
>
> Certainly.
Hi Russell,
I've found the cause of the performance regression and have suggested
a patch on ticket 12057 (http://code.djangoproject.com/ticket/12057)
The patch runs without causing any other tests to fail in the django
tree.
Do you think this patch could have other side effects or is it OK?
Thanks
Michael

>
> > 3. Was this change made on purpose to fulfill other features?
>
> I can't think of any obvious reason that you would see a regression of
> that sort - the core infrastructure for queries didn't change between
> v1.0 and v1.1. There were some features added (such as aggregates),
> and some cleanup of the internals of value_list() and values()
> querysets, but those changes shouldn't have affected caching
> behaviour.
>
> Yours,
> Russ Magee %-)
--~--~---------~--~----~------------~-------~--~----~
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