View cache size for large site = 2.5 TB

Author Message

Andrey Astakhov

Sunday 25 November 2007 5:58:02 am

I've switched on viewcaching.
One cache file takes about 50 KB.
I'll have 10 000 nodes and 5 000 users in 2008.

 

So cache size is 50 * 10 000 * 5 000 / 1000 =  2 500 000 MB.
 

2.5 terabyte - is it correct? Is viewcaching a good solution for large websites?

Damien Pobel

Sunday 25 November 2007 9:14:01 am

Hi Andrey,

I think there's one cache file for each role not for each user so you won't get 2.5 Tb of cache unless you have one role per user but it doesn't make sense.

I've got a site with about 65000 nodes with only anymous visitor :

~/web/pwet.fr/www$ du -sh var/plain/cache/content/plain_site_user/
154M    var/plain/cache/content/plain_site_user/

Moreover, ViewCaching is almost mandatory if you want good performance on your site.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Andrey Astakhov

Sunday 25 November 2007 9:48:40 am

Hi, Damien,
thank you for reply.

<i>
I think there's one cache file for each role not for each ...
</i>

I have such line in my template:

{def $user=fetch( 'user', 'current_user' )}{$user.contentobject.name}

and i've checked it: there is a separate cache file for each user visited this node.

Probably it is not a good practice to show user name in a template for a node, but anyway: my calculations are correct so i can expect such cache size in the future.

Damien Pobel

Sunday 25 November 2007 11:25:55 am

if this template is or is used in a view template with ViewCaching enabled it should not work as expected unless each user has different roles assignments. That's why showing user information is generally made in the pagelayout template.

If you look at the generateViewCacheFile method in kernel/classes/eznodeviewfunctions.php you will see that the cache file name depends on :
- node id
- view mode
- language
- offset and other view parameters
- layout
- user's roles and limitation
- preferences if configured for that

so basically, for a given page two users will "share" a cache file if they have the same role assignments.

Damien
Planet eZ Publish.fr : http://www.planet-ezpublish.fr
Certification : http://auth.ez.no/certification/verify/372448
Publications about eZ Publish : http://pwet.fr/tags/keywords/weblog/ez_publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.