Caching, page reloads, and better ways to keep content from recompiling on less trafficed sites

Author Message

Jonathan Dillon-Hayes

Monday 28 March 2005 2:10:47 am

Hey all:

Just to repond to the question about why a site was slow for a client that appeared here some weeks back. We took a look at the issue for this client...

The problem is a common one with sites that don't get a great deal of traffic. The site's cache was expiring as it was sometimes quite a long time between page loags. Therefore when you first hit the page, it was very, very slow while it recompiled the page (2-3 second delay).

When a request comes in to eZ Publish, it compares the date on the server with the date on the document. If it's older than a few minutes it will rebuild the page for you.

This is a common problem. In order to eliminate the problem, we simply pointed a cron lynx entry to the home page so that it would stay "fresh" in the eZ Cache. This is a very easy way to get around the problem. On a busy production website, these pages would not expire.

In some cases (like for example, news sites, where the content changes only periodically), it's also possible to do a cache like squid or the like.

Another interesting thing I found while working on this problem... I was working on a site when all of the sudden the CPU usage spiked despite my doing nothing. Curious, I started watching the logs. It turned out there was some kind of spider walking the tree on some uncached (old, not very popular) content on the site I was working on, and it was causing eZ to go absolutely crazy trying to generate those requests. It was very interesting. On really broad, deep, or old sites, I wonder how much of a concern this could be. I mean, you could get really killed if this happened on a really HUGE site with a multithreaded aggressive spider.

Is there a better way to do this with internal eZ configuration?

J

---------
FireBright provides advanced eZ deployment with root access
http://www.FireBright.com/

Bård Farstad

Wednesday 20 April 2005 2:48:58 am

Jonathan,

the expiry can indeed be a problem in some configurations. I guess that the new static cache features would fit the sites you are describing perfectly. Using this technique you have a pure HTML version of the page stored on disk. This will be served directly from Apache until the page is re-published and content is changed.

The static cache does not work on personalized content though. As all users get the same page, but for many sites this is just fine.

--bård

Documentation: http://ez.no/doc

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

eZ debug

Timing: Jan 31 2025 03:44:30
Script start
Timing: Jan 31 2025 03:44:30
Module start 'layout'
Timing: Jan 31 2025 03:44:30
Module start 'content'
Timing: Jan 31 2025 03:44:30
Module end 'content'
Timing: Jan 31 2025 03:44:30
Script end

Main resources:

Total runtime0.0201 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.6328151.2734
Module start 'layout' 0.00530.0030 739.9063220.8594
Module start 'content' 0.00830.0105 960.7656997.8047
Module end 'content' 0.01880.0012 1,958.570333.9922
Script end 0.0201  1,992.5625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002311.3137140.0002
Check MTime0.00094.6810140.0001
Mysql Total
Database connection0.00073.435710.0007
Mysqli_queries0.002914.560630.0010
Looping result0.00000.049910.0000
Template Total0.00084.210.0008
Template load0.00063.167410.0006
Template processing0.00020.996010.0002
Override
Cache load0.00042.235410.0004
General
dbfile0.00126.151980.0002
String conversion0.00000.024940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs