Skip to content

Commit

Permalink
Warn people about performance limitations of using ZODB storage for z…
Browse files Browse the repository at this point in the history
…ope.session and z3c.flashmessage
  • Loading branch information
slinkp committed Nov 17, 2008
1 parent 48cf5a3 commit 2bb0b8c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/z3c/flashmessage/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,31 @@ of a message is `message`:
[]


Performance and Scalability Issues
==================================

By default, messages are stored persistently in the ZODB using
zope.session. This can be a significant scalability problem; see
design.txt in zope.session for more information. You should think
twice before using flashmessages for unauthenticated users, as this
can easily lead to unnecessary database growth on anonymous page
views, and conflict errors under heavy load.

One solution is to configure your system to store flashmessages in
RAM. You would do this by configuring a utility providing
z3c.flashmessages.interfaces.IMessageSource with the factory set to
z3c.flashmessages.sources.RAMMessageSource, and a specific name if
your application expects one.

RAM storage is much faster and removes the persistence issues
described above, but there are two new problems. First, be aware that
if your server process restarts for any reason, all unread
flashmessages will be lost. Second, if you cluster your application
servers using e.g. ZEO, you must also ensure that your load-balancer
supports session affinity (so a specific client always hits the same
back end server). This somewhat reduces the performance benefits of
clustering.


Changes
=======
Expand Down

0 comments on commit 2bb0b8c

Please sign in to comment.