Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23023 closed Cleanup/optimization (fixed)

Update warning about local-memory cache for sessions

Reported by: django@… Owned by: Tim Graham
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

I am suggesting an addition of a sentence to the warning about using the local-memory cache for caching sessions due to a tricky to replicate problem that I stumbled on. I started using cached_db ages ago but didn't configure the cache settings, leaving it as the default local-memory cache (In 1.2 it says that "This cache is multi-process and thread-safe", but that's not the case now. Oh wait, in 1.2, the next paragraph contradicts it's multi-process safeness - that's fixed now).

Mostly I'd sometimes notice that messages didn't appear until one or two pages after it should, but recently, I actually started using the session for more stuff and stuff was breaking sometimes and other times not - session looked good in the database, but my views weren't always seeing the same values. And everything was fine with runserver...

Doh! Multiple processes in WSGI/Apache2...

https://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
So, just because the local-memory cache is the default if not otherwise configured, add an extra line to the existing warning:

Additionally, the local-memory cache backend is NOT multi-process safe, therefore probably not a good choice for production environments.

Change History (4)

comment:1 by Tim Graham, 10 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned
Triage Stage: UnreviewedReady for checkin

comment:2 by Tim Graham <timograham@…>, 10 years ago

Resolution: fixed
Status: assignedclosed

In 7d0519c725f25cb0b52e42c60f2505e21d2ab4b3:

Fixed #23023 -- Added warning against local-memory cache.

Thanks django at kerz.id.au.

comment:3 by Tim Graham <timograham@…>, 10 years ago

In 8e34bcdfba16cb1dc3096da57d1e82d3839472a8:

[1.7.x] Fixed #23023 -- Added warning against local-memory cache.

Thanks django at kerz.id.au.

Backport of 7d0519c725 from master

comment:4 by Tim Graham <timograham@…>, 10 years ago

In 21853c1b908f777de354b1371c17422f10032c70:

[1.6.x] Fixed #23023 -- Added warning against local-memory cache.

Thanks django at kerz.id.au.

Backport of 7d0519c725 from master

Note: See TracTickets for help on using tickets.
Back to Top