Changeset 1890 for siteapp

Show
Ignore:
Timestamp:
11/17/08 16:38:59 (7 weeks ago)
Author:
slinkp
Message:

FIXED remaining write-on-read problems, by storing flash messages in RAM instead of persistent sessions. Long comment about implications re. load balancing.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • siteapp/trunk/opengeo/almanac/configure.zcml

    r1474 r1890  
    6060     /> 
    6161 
     62 
     63  <!-- Flash message configuration 
     64 
     65       Storing flash messages in RAM avoids conflict errors and ZODB 
     66       bloat on anonymous reads, and gives a substantial performance 
     67       boost (eg. the front page is 2.6 times faster, a story page is 
     68       1.8x faster). 
     69 
     70       Disadvantage: We'd have to provide session affinity in the load-balancer. 
     71       For nginx config, see http://wiki.codemongers.com/NginxHttpUpstreamModule 
     72       And doing that substantially reduces the benefits of load-balancing. 
     73       See design.txt in zope.session for more discussion. 
     74 
     75       Alternative: This would be slower than RAM but would not 
     76       require any load-balancer config: We could maybe go back to 
     77       using z3c.flashmessage.sources.SessionMessageSource as the 
     78       factory, but instead configure a persistent 
     79       ISessionDataContainer named 'z3c.flashmessage' like so: 
     80 
     81        <utility 
     82          name="z3c.flashmessage" 
     83          provides="zope.session.interfaces.ISessionDataContainer" 
     84          factory="zope.session.session.SessionDataContainer" 
     85         />  
     86       ... and then (how?) configure that container to live inside a 
     87       TemporaryStorage mounted over ZEO. 
     88 
     89       We could then also do the same for name="almanac" for the rest 
     90       of our session data. 
     91   --> 
    6292  <utility 
    6393     provides="z3c.flashmessage.interfaces.IMessageSource" 
    64      factory="z3c.flashmessage.sources.SessionMessageSource" 
     94     factory="z3c.flashmessage.sources.RAMMessageSource" 
     95     name="session" 
    6596     /> 
    6697