Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-15 Thread Benji York
On Wed, Jul 14, 2010 at 6:59 PM, Leonardo Rochael Almeida
leoroch...@gmail.com wrote:
 On Wed, Jul 14, 2010 at 19:22, Benji York be...@benjiyork.com wrote:
 [...]
 Not surprising really.

 What could be surprising is that, since the objects are not in the
 object cache or the ZEO cache, how can the clients 'know' about them
 to request them?

 And the answer is probably that there are other objects which ARE in
 the object cache, or the ZEO cache and that hold references (ghost
 objects in the case of the object-cache) to the objects in the
 zeo-distributed temporary storage.

Indeed.  My jet lag ate that part of the story.  Thanks.

 So, perhaps, Sebastian can avoid a Zope restart if he finds a way to
 flush all caches. Flushing the object caches is easy, it's in the
 Control_Panel. Flushing the ZEO cache is something else. Perhaps he
 can run with a 0-sized ZEO cache for the TempStorages?

If this were me, I'd use a non-temporary storage and implement an expiry
policy for the results cache.  The bforest package would be a good start
(http://pypi.python.org/pypi/zope.bforest).

In fact, I would expect they already have an expiry policy in place, so
they might be able to just start using a non-temporary storage right
away.
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-15 Thread Dragos Chirila
Hi Sebastian,



Why don’t you consider to use memcached for caching the results instead of
using sessions? By using this, Zeo server/Zeo clients restart wont affect
cached data.



HTH,
Dragos


On Sun, Jul 11, 2010 at 8:41 AM, Sebastian Tiedtke s...@mdvtts.com wrote:

 Hi all,

 We're working on a large scale Plone deployment and recently came across
 some odd behavior with tempstorage at our ZEO server. A limited number, yet
 highly frequented, of pages on our Plone site query backend web services
 that provide location based services such as geocoding and routing (a to b).
 Since those calls to the services are rather computation intense we decided
 to store intermediate and resulting data in sessions vs. re-querying the
 service for no reason.

 The system setup consists of a central ZEO server that provides the storage
 for content as well as a temp storage for sessioning. There are multiple
 other servers that run multiple Plone instances with ZEO clients. The ZEO
 server setup is straight forward but I'm happy to provide the configuration
 files. Generally the concept works great.

 However, whenever we restart the ZEO server and keep the client instances
 running we get odd behavior with the client instances' sessioning. Every
 client appears to reconnect and, if required, revalidates its cache.

 2010-07-11T14:46:03 INFO ZEO.ClientStorage (6132) Disconnected from
 storage: ('ITIS.mentzdv.de', 8100)
 2010-07-11T14:46:03 INFO ZEO.ClientStorage (6132) Disconnected from
 storage: ('ITIS.mentzdv.de', 8100)
 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Testing connection
 ManagedClientConnection ('127.0.0.1', 8100)
 2010-07-11T14:46:09 INFO ZEO.zrpc.Connection(C) (127.0.0.1:8100) received
 handshake 'Z303'
 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Server authentication
 protocol None
 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Connected to storage: ('
 ITIS.mentzdv.de', 8100)
 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Testing connection
 ManagedClientConnection ('127.0.0.1', 8100)
 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) last inval tid:
 '\x03\x87n\x9d|\x1a\xc2\xaa' 2010-07-11 04:45:29.087000

 2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) last transaction:
 '\x00\x00\x00\x00\x00\x00\x00\x00' 1900-01-01 00:00:00.00
 2010-07-11T14:46:09 INFO ZEO.zrpc.Connection(C) (127.0.0.1:8100) received
 handshake 'Z303'
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Verifying cache
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Server authentication
 protocol None
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Connected to storage: ('
 ITIS.mentzdv.de', 8100)
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) No verification necessary
 (last_inval_tid up-to-date)
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) endVerify finishing
 2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) endVerify finished


 The problem is that whenever we hit a session bound page we get following
 error and stack trace:

 2010-07-11T14:58:12 ERROR ZODB.Connection Couldn't load state for 0x82
 Traceback (most recent call last):
   File
 g:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZODB\Connection.py, line
 761, in setstate
 self._setstate(obj)
   File
 g:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZODB\Connection.py, line
 801, in _setstate
 p, serial = self._storage.load(obj._p_oid, self._version)
   File
 G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ClientStorage.py,
 line 727, in load
 return self.loadEx(oid, version)[:2]
   File
 G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ClientStorage.py,
 line 750, in loadEx
 data, tid, ver = self._server.loadEx(oid, version)
   File
 G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ServerStub.py, line
 196, in loadEx
 return self.rpc.call(loadEx, oid, version)
   File
 G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\zrpc\connection.py,
 line 650, in call
 raise inst # error raised by server
 KeyError: '\x00\x00\x00\x00\x00\x00\x00\x82'


 In the ZMI under the Control-Panel/Database Tab the temporary database
 seems to be fine. The /temp_folder returns a similar stack trace though:
 Site Error

 An error was encountered while publishing this resource.

 *KeyError*
 Sorry, a site error occurred.

 Traceback (innermost last):

- Module ZPublisher.Publish, line 202, in publish_module_standard
- Module ZPublisher.Publish, line 150, in publish
- Module plone.app.linkintegrity.monkey, line 21, in
zpublisher_exception_hook_wrapper
- Module Zope2.App.startup, line 221, in zpublisher_exception_hook
- Module ZPublisher.Publish, line 119, in publish
- Module ZPublisher.mapply, line 88, in mapply
- Module ZPublisher.Publish, line 42, in call_object
- Module App.special_dtml, line 65, in __call__
- Module DocumentTemplate.DT_String, line 476, in __call__
- Module Products.Transience.Transience, line 926, in housekeep
- Module 

Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-15 Thread Wichert Akkerman
On 7/15/10 17:03 , Dragos Chirila wrote:
 Hi Sebastian,

 Why don’t you consider to use memcached for caching the results instead
 of using sessions? By using this, Zeo server/Zeo clients restart wont
 affect cached data.

or plone.memoize, using either a RAMCache or memcached as backend.

Wichert.
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-14 Thread Benji York
On Sun, Jul 11, 2010 at 1:41 AM, Sebastian Tiedtke s...@mdvtts.com wrote:
 We're working on a large scale Plone deployment and recently came across
 some odd behavior with tempstorage at our ZEO server.

 The system setup consists of a central ZEO server that provides the
 storage for content as well as a temp storage for sessioning. There
 are multiple other servers that run multiple Plone instances with ZEO
 clients.

Let me make sure I understand your setup: you have a TemporaryStorage
running on a central server that is exposed via ZEO to clients.  Right?

So, when the ZEO server restarts the temp storage is reset (it's
contents don't survive a restart by design), but the clients don't know
all the objects they know about in the temp storage just disappeared.
Therefore when they go to load one (because it wasn't in their object or
ZEO caches), the load fails.

Not surprising really.
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-14 Thread Leonardo Rochael Almeida
On Wed, Jul 14, 2010 at 19:22, Benji York be...@benjiyork.com wrote:
 [...]

 Let me make sure I understand your setup: you have a TemporaryStorage
 running on a central server that is exposed via ZEO to clients.  Right?

 So, when the ZEO server restarts the temp storage is reset (it's
 contents don't survive a restart by design), but the clients don't know
 all the objects they know about in the temp storage just disappeared.
 Therefore when they go to load one (because it wasn't in their object or
 ZEO caches), the load fails.

 Not surprising really.

What could be surprising is that, since the objects are not in the
object cache or the ZEO cache, how can the clients 'know' about them
to request them?

And the answer is probably that there are other objects which ARE in
the object cache, or the ZEO cache and that hold references (ghost
objects in the case of the object-cache) to the objects in the
zeo-distributed temporary storage.

So, perhaps, Sebastian can avoid a Zope restart if he finds a way to
flush all caches. Flushing the object caches is easy, it's in the
Control_Panel. Flushing the ZEO cache is something else. Perhaps he
can run with a 0-sized ZEO cache for the TempStorages?

Cheers,

Leo
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-10 Thread Sebastian Tiedtke
Hi all,

We're working on a large scale Plone deployment and recently came across
some odd behavior with tempstorage at our ZEO server. A limited number, yet
highly frequented, of pages on our Plone site query backend web services
that provide location based services such as geocoding and routing (a to b).
Since those calls to the services are rather computation intense we decided
to store intermediate and resulting data in sessions vs. re-querying the
service for no reason.

The system setup consists of a central ZEO server that provides the storage
for content as well as a temp storage for sessioning. There are multiple
other servers that run multiple Plone instances with ZEO clients. The ZEO
server setup is straight forward but I'm happy to provide the configuration
files. Generally the concept works great.

However, whenever we restart the ZEO server and keep the client instances
running we get odd behavior with the client instances' sessioning. Every
client appears to reconnect and, if required, revalidates its cache.

2010-07-11T14:46:03 INFO ZEO.ClientStorage (6132) Disconnected from storage:
('ITIS.mentzdv.de', 8100)
2010-07-11T14:46:03 INFO ZEO.ClientStorage (6132) Disconnected from storage:
('ITIS.mentzdv.de', 8100)
2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Testing connection
ManagedClientConnection ('127.0.0.1', 8100)
2010-07-11T14:46:09 INFO ZEO.zrpc.Connection(C) (127.0.0.1:8100) received
handshake 'Z303'
2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Server authentication
protocol None
2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Connected to storage: ('
ITIS.mentzdv.de', 8100)
2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) Testing connection
ManagedClientConnection ('127.0.0.1', 8100)
2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) last inval tid:
'\x03\x87n\x9d|\x1a\xc2\xaa' 2010-07-11 04:45:29.087000

2010-07-11T14:46:09 INFO ZEO.ClientStorage (6132) last transaction:
'\x00\x00\x00\x00\x00\x00\x00\x00' 1900-01-01 00:00:00.00
2010-07-11T14:46:09 INFO ZEO.zrpc.Connection(C) (127.0.0.1:8100) received
handshake 'Z303'
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Verifying cache
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Server authentication
protocol None
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) Connected to storage: ('
ITIS.mentzdv.de', 8100)
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) No verification necessary
(last_inval_tid up-to-date)
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) endVerify finishing
2010-07-11T14:46:10 INFO ZEO.ClientStorage (6132) endVerify finished


The problem is that whenever we hit a session bound page we get following
error and stack trace:

2010-07-11T14:58:12 ERROR ZODB.Connection Couldn't load state for 0x82
Traceback (most recent call last):
  File
g:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZODB\Connection.py, line
761, in setstate
self._setstate(obj)
  File
g:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZODB\Connection.py, line
801, in _setstate
p, serial = self._storage.load(obj._p_oid, self._version)
  File
G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ClientStorage.py,
line 727, in load
return self.loadEx(oid, version)[:2]
  File
G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ClientStorage.py,
line 750, in loadEx
data, tid, ver = self._server.loadEx(oid, version)
  File
G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\ServerStub.py, line
196, in loadEx
return self.rpc.call(loadEx, oid, version)
  File
G:\mentzdv\plone\instances\zeo04\zope2\lib\python\ZEO\zrpc\connection.py,
line 650, in call
raise inst # error raised by server
KeyError: '\x00\x00\x00\x00\x00\x00\x00\x82'


In the ZMI under the Control-Panel/Database Tab the temporary database seems
to be fine. The /temp_folder returns a similar stack trace though:
Site Error

An error was encountered while publishing this resource.

*KeyError*
Sorry, a site error occurred.

Traceback (innermost last):

   - Module ZPublisher.Publish, line 202, in publish_module_standard
   - Module ZPublisher.Publish, line 150, in publish
   - Module plone.app.linkintegrity.monkey, line 21, in
   zpublisher_exception_hook_wrapper
   - Module Zope2.App.startup, line 221, in zpublisher_exception_hook
   - Module ZPublisher.Publish, line 119, in publish
   - Module ZPublisher.mapply, line 88, in mapply
   - Module ZPublisher.Publish, line 42, in call_object
   - Module App.special_dtml, line 65, in __call__
   - Module DocumentTemplate.DT_String, line 476, in __call__
   - Module Products.Transience.Transience, line 926, in housekeep
   - Module Products.Transience.Transience, line 929, in _housekeep
   - Module Products.Transience.Transience, line 569, in _finalize
   - Module Products.Transience.Transience, line 593, in _do_finalize_work
   - Module ZODB.Connection, line 761, in setstate
   - Module ZODB.Connection, line 801, in _setstate
   - Module ZEO.ClientStorage, line 727, in load
   - Module