On Tue, Jan 15, 2013 at 2:40 PM, Jim Fulton <span dir="ltr"><<a href="mailto:jim@zope.com" target="_blank">jim@zope.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, first, a concise partial answer to a previous question:<br>
<br>
ZODB provides an in-memory object cache. This is non-persistent.<br>
If you restart, it is lost. There is a cache per connection and the<br>
cache size is limited by both object count and total object size (as<br>
estimated by database record size).<br>
<br>
ZEO also provides a disk-based cache of database records read<br>
from the server. This is normally much larger than the in-memory cache.<br>
It can be configured to be persistent. If you're using blobs, then there<br>
is a separate blob cache.<br>
<div><div class="h5"><br>
On Tue, Jan 15, 2013 at 2:15 PM, Claudiu Saftoiu <<a href="mailto:csaftoiu@gmail.com">csaftoiu@gmail.com</a>> wrote:<br>
>> You can't cause a specific object (or collection of objects) to stay<br>
>> ion the cache, but if you're working set is small enough to fit in<br>
>> the memory or client cache, you can get the same effect.<br>
><br>
><br>
> That makes sense. So, is there any way to give ZODB a Persistent and tell it<br>
> "load everything about the object now for this transaction" so that the<br>
> cache mechanism then gets triggered, or do I have to do a custom search<br>
> through every aspect of the object, touching all Persistents it touches,<br>
> etc, in order to get everything loaded? Essentially, when the server<br>
> restarts, I'd like to pre-load all these objects (my cache is indeed big<br>
> enough), so that if a few hours later someone makes a request that uses it,<br>
> the objects will already be cached instead of starting to be cached right<br>
> then.<br>
<br>
</div></div>ZODB doesn't provide any pre-warming facility. This would be<br>
application dependent.<br>
<br>
You're probably better off using a persistent ZEO cache<br>
and letting the cache fill with objects you actually use.<br></blockquote><div><br></div><div>Okay, that makes sense. Would that be a server-side cache, or a client-side cache? I believe I've already succeeded in getting a client-side persistent disk-based cache to work (my zodb_indexdb_uri is "zeo://%(here)s/zeo_indexdb.sock?cache_size=2000MB&connection_cache_size=500000&connection_pool_size=5&var=zeocache&client=index"), but this doesn't seem to be what you're referring to as that is exactly the same size as the in-memory cache. Could you provide some pointers as to how to get a persistent disk-based cache on the ZEO server, if that is what you meant? It seems ZODB/ZEO really lacks for centralized documentation.</div>
<div><br></div><div>Thanks,</div><div>- Claudiu</div></div>