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

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 18 2025 16:11:51
Script start
Timing: Jan 18 2025 16:11:51
Module start 'layout'
Timing: Jan 18 2025 16:11:51
Module start 'content'
Timing: Jan 18 2025 16:11:52
Module end 'content'
Timing: Jan 18 2025 16:11:52
Script end

Main resources:

Total runtime1.0267 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 589.0469152.6250
Module start 'layout' 0.00560.0025 741.671939.4453
Module start 'content' 0.00811.0171 781.1172462.9141
Module end 'content' 1.02510.0015 1,244.03138.1719
Script end 1.0267  1,252.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3255160.0002
Check MTime0.00140.1345160.0001
Mysql Total
Database connection0.00100.100010.0010
Mysqli_queries0.982695.7074540.0182
Looping result0.00060.0547520.0000
Template Total0.998297.220.4991
Template load0.00210.207820.0011
Template processing0.996097.014420.4980
Template load and register function0.00020.020310.0002
states
state_id_array0.00090.089310.0009
state_identifier_array0.00090.089120.0005
Override
Cache load0.00180.1735220.0001
Sytem overhead
Fetch class attribute can translate value0.00060.061420.0003
Fetch class attribute name0.00120.113920.0006
XML
Image XML parsing0.00030.030320.0002
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00060.0611100.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs