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

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

eZ debug

Timing: Jan 19 2025 09:13:19
Script start
Timing: Jan 19 2025 09:13:19
Module start 'content'
Timing: Jan 19 2025 09:13:19
Module end 'content'
Timing: Jan 19 2025 09:13:19
Script end

Main resources:

Total runtime0.1591 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 589.5625180.7734
Module start 'content' 0.00630.0053 770.335993.9609
Module end 'content' 0.01150.1475 864.2969524.0469
Script end 0.1590  1,388.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00412.5514200.0002
Check MTime0.00171.0388200.0001
Mysql Total
Database connection0.00090.562610.0009
Mysqli_queries0.111470.05641410.0008
Looping result0.00120.73421390.0000
Template Total0.147192.510.1471
Template load0.00110.699610.0011
Template processing0.146091.777910.1460
Override
Cache load0.00080.516610.0008
Sytem overhead
Fetch class attribute can translate value0.00100.656310.0010
XML
Image XML parsing0.00030.169810.0003
General
dbfile0.00392.4282200.0002
String conversion0.00000.003730.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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