Forums / Install & configuration / Texttoimage and Cluster

Texttoimage and Cluster

Author Message

Guglielmo Celata

Wednesday 11 October 2006 8:09:43 am

Hi,
I have experienced a problem using the texttoimage operator in a clustered environment, using the dbfile filehandler.
The architecture I use is: a webstorage machine, with the database and two frontend machines, serving the pages and retrieving storage and cache from the database, with a remote connection.
eZ version is 3.8.4.

The thing is, images created with the texttoimage operator are cached under var/cache/texttoimage/images, in the frontend cache directories.
So, if someone browses a page, say, on the first frontend server, the image is cached there and it appears the <i>information that the image is cached</i> is stored in the DB, somehow.
As a matter of fact, when a connection is made on the second frontend server, the image results cached, but the path exists only on the first machine, so the image is broken.

I've fixed this, by remotely synching the var/cache/texttoimage/images directories of the two machines every two minutes, but I guess this is quite a crude patch.

Another 'fix' could be to set the UseCache setting to false in the texttoimage.ini configuration file.

I have tried to browse the source code (lib/eztemplate/classes/eztemplateimageoperator.php) but didn't find any place where the information that the image was alredy created was written in the cache, so I can't figure out how a connection on a second machine would try to load the image directly from the file system, instead of generating it.

Is there a way in order to have texttoimage images cached in the DB?

Guglielmo Celata

Claudia Kosny

Wednesday 11 October 2006 12:10:18 pm

Hi Guglielmo

As far as I can see the cache check is done by checking whether the file exists, there is nothing done in a database at all. The cache checking is done in the function modify at the lines where it checks the settings for usecache and then calls up $this->hasImage(...)
On EZ 3.8.3 the line numbers are 234 and following. If I understand you right EZ thinks that there is a cached file so it might be a good idea to check the filepath that is checked in the hasImage function.

Could you also please post both paths - the one where the file should be cached and the one where EZ thinks it is cached. You should see the path in html files that are created.

Greetings from Luxembourg

Claudia

eZ debug

Timing: Jan 18 2025 11:17:25
Script start
Timing: Jan 18 2025 11:17:25
Module start 'content'
Timing: Jan 18 2025 11:17:26
Module end 'content'
Timing: Jan 18 2025 11:17:26
Script end

Main resources:

Total runtime1.2427 sec
Peak memory usage4,096.0000 KB
Database Queries191

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 588.8438180.8359
Module start 'content' 0.00821.0860 769.6797467.9922
Module end 'content' 1.09420.1484 1,237.6719333.5078
Script end 1.2426  1,571.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.3681210.0002
Check MTime0.00200.1600210.0001
Mysql Total
Database connection0.00090.076210.0009
Mysqli_queries1.175694.60131910.0062
Looping result0.00190.15641890.0000
Template Total1.199996.620.5999
Template load0.00240.191120.0012
Template processing1.197596.363420.5987
Template load and register function0.00020.013910.0002
states
state_id_array0.00240.196910.0024
state_identifier_array0.00270.221020.0014
Override
Cache load0.00210.1670220.0001
Sytem overhead
Fetch class attribute can translate value0.00130.107530.0004
Fetch class attribute name0.00160.126620.0008
XML
Image XML parsing0.00080.064530.0003
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00240.1915210.0001
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs