authentication switching mid-session

11 views
Skip to first unread message

Chris Curvey

unread,
Mar 30, 2011, 7:07:19 AM3/30/11
to Django users
When my Django system is under heavy load (system CPU > 90%), I start
getting complaints from users that their authentication changes in the
middle of a session. For example:

1) Bob logs in to the site. The site says "Hello Bob" at the top of
each page.
2) Bob uses the site for a while without incident
3) Bob notices that the top of the page now says "Hello Steve".

The problem is intermittent, and I can't duplicate it (but I have seen
it with my own eyes). I'm running Django 1.2.5 on Windows, with
SessionMiddleware installed. I have django.contrib.sessions in my
INSTALLED_APPS, and I believe that I'm using database-backed sessions,
with a MySQL database.

The only "odd" thing that I'm doing is that I have four instances of
Apache running, with my Django app running via mod_wsgi in each of
them. There is another apache server in front that does load-
balancing, so multiple requests from a single user may get routed to
different apache instances (which is what I want, to get maximum
throughput on Ajax calls). But I thought that having the sessions be
database-backed would deal with this (multiple session requests can
hit the database at the same time).

Any thoughts? I'm sorry this is such a lousy, unrepeatable case.

P.S. I have looked at http://code.djangoproject.com/ticket/1180,
which says that this issue has been fixed, but I can't tell if this is
the same issue or not.

Bill Freeman

unread,
Mar 30, 2011, 10:21:48 AM3/30/11
to django...@googlegroups.com
Do you have any caching in front of things?

> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
>
>

Chris Curvey

unread,
Mar 31, 2011, 12:55:24 PM3/31/11
to django...@googlegroups.com
there's no cacheing in front of the application server, if that's what you're asking.  The app server does do some cacheing on its own, but not related to sessions or users.

Rick Macurak

unread,
Jun 13, 2011, 3:56:18 PM6/13/11
to django...@googlegroups.com
Chris, did you ever arrive at a solution to this problem? I believe I'm experiencing something similar, if not exactly the same.
Reply all
Reply to author
Forward
0 new messages