You are not logged in Log in Join
You are here: Home » Members » Toby Dickenson » cache » FAQ

Log in
Name

Password

 

FAQ

1. Why is Zope using more memory than it used to?

The cache size, as specified in Zope's Control Panel, now controls the number of non-ghost objects, rather than the total number of objects in the cache. Try a number 5 or 10 times smaller if memory usage is a concern, or if you have carefully tuned than number previously.

Further, Zope traditionally took quite some time to reach its final memory size, which was perhaps 10% larger than the size immediately after starting up. The new cache should reach that final size very much faster.

2. Doesnt this change mean that objects will be deactivated more frequently than before?

No, the new cache is more strict about deactivating enough objects, but that doesnt mean that it deactivates more overall. If it did the cache would end up empty.

In fact the opposite should be true, assuming that the least-recently-used algorithm does a good job of deactivating objects that are not likely to be touched again soon. The new cache is must less likely to deactivate an object, only to have it reactivated again soon after.

3. Someone said it will also improve the performance of Zopes that are not under memory pressure. How is that?

The old persistence implementation was based on access time, therefore it called the function time() on every attribute read or write. This function is not slow, but it is called often enough to have a measureable effect on performance. The new implementation is based on access order; relinking pointers in a linked list is much quicker.

Some benchmarks show a 10% improvement with the new implementation, which may or may not be due to eliminating the call to time(). I am not aware of any benchmarks which show the new implementation to be slower than the old.

Other Articles