Ez 3.8.X doesn't work with big database

Author Message

luis muñoz

Thursday 28 September 2006 9:41:42 am

Hi all,

I've tryed installing all 3.8 ez from 3.8.0 to 3.8.4 but i alwais get the same result:
Everything works without errors but page load time ridiculous, sometimes even timeout. I found the cause is a mysql query:

SELECT ezcontentobject.*,
ezcontentobject_tree.*,
ezcontentclass.name as class_name,
ezcontentclass.identifier as class_identifier,
ezcontentobject_name.name as name,  ezcontentobject_name.real_translation
FROM
ezcontentobject_tree,
ezcontentobject,ezcontentclass, 
ezcontentobject_name
WHERE
path_string like '/1/2/10570/%' and  depth = 3  and
ezcontentclass.version=0 AND
ezcontentobject_tree.contentobject_id = ezcontentobject.id  AND
ezcontentclass.id = ezcontentobject.contentclass_id AND
ezcontentobject_tree.contentobject_id = ezcontentobject_name.contentobject_id and
ezcontentobject_tree.contentobject_version = ezcontentobject_name.content_version and
( ezcontentobject_name.language_id & ezcontentobject.language_mask > 0 AND
 ( (   ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 16 ) >> 3 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 8 ) >> 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 256 ) >> 5 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 128 ) >> 3 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 64 ) >> 1 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 4 ) << 4 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 2 ) << 6 )
+ ( ( ( ezcontentobject.language_mask - ( ezcontentobject.language_mask & ezcontentobject_name.language_id ) ) & 32 ) << 3 )
<
( ezcontentobject_name.language_id & 1 )
+ ( ( ezcontentobject_name.language_id & 16 ) >> 3 )
+ ( ( ezcontentobject_name.language_id & 8 ) >> 1 )
+ ( ( ezcontentobject_name.language_id & 256 ) >> 5 )
+ ( ( ezcontentobject_name.language_id & 128 ) >> 3 )
+ ( ( ezcontentobject_name.language_id & 64 ) >> 1 )
+ ( ( ezcontentobject_name.language_id & 4 ) << 4 )
+ ( ( ezcontentobject_name.language_id & 2 ) << 6 )
+ ( ( ezcontentobject_name.language_id & 32 ) << 3 )
)
AND ezcontentobject_tree.is_invisible = 0
AND ((ezcontentobject.contentclass_id in (1, 11, 12, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 48, 49, 5, 50) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 3, 7, 8, 9)) OR (ezcontentobject.contentclass_id in (1, 11, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 4, 40, 41, 42, 43, 44, 46, 48, 49, 5, 50) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 3, 7, 9)) OR (ezcontentobject.contentclass_id in (1, 16, 19, 2, 20, 21, 32, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44) AND ezcontentobject.section_id in (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 7, 9)))
AND
ezcontentobject.language_mask & 511 > 0
ORDER BY  path_string ASC

Is it possible to make a less heavy query or any other thing? With a big database the site becomes unusable.

Thanks

Björn Dieding@xrow.de

Thursday 28 September 2006 10:58:45 am

About how many content objects are you talking about? How big is big?

Is this some query from the backend? It seems somehow that this one is triggered through a custom fetch( content, tree )

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

luis muñoz

Friday 29 September 2006 4:28:00 am

Thanks for the answer,

It happends on my code and also on admin code. I have about 200k objects.

With sql debug on i found that all the slow queries (the ones witch takes more than 1 sec to execute) has a where like

path_string like '/1/2/1297/%' and  depth = 3  and 

Not always '=' , also '>=', '<=' and not the same depth but always the same where.

Not all the queries with this where go to "Copying to tmp table" status, probably because of the query cache or any other mysql cache.

Any help would be apreciated

Luis

Björn Dieding@xrow.de

Friday 29 September 2006 4:46:28 am

Doh this is big...

I think you should inform eZ about your troubles... 1 sec is just too long

Have you yet looked into fine tuning your db/mysql? There was an article released lately.

maybe you can make the query cache really high....

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

luis muñoz

Friday 29 September 2006 5:03:17 am

Hi,

I tuned database yesterday following the indications on http://ez.no/community/articles/tuning_mysql_for_ez_publish but that didn't fix the problem.
I think the problem comes from using the operator like with a string with wildcards, i'll check with mysql forums. I'm also looking if it performs better changing the order of the where.
Should i post it as a bug? sugestion?

Thanks

Björn Dieding@xrow.de

Friday 29 September 2006 5:15:17 am

Yes i would post a bug, if it doesn't exsit yet.

Also I am pretty sure eZ is aware about this... expressing the need of solving this doesn't hurt.

No further suggestions... sorry...

We can only hope telemark can scale to any limit of objects

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Kåre Køhler Høvik

Friday 29 September 2006 5:49:19 am

Hi

I've added a bug report about this. Please see: http://ez.no/bugs/view/9091
You can try the index I've listed there, and see if they improve the performance.

Best regards
Kåre

Kåre Høvik

luis muñoz

Friday 29 September 2006 7:23:20 am

Indexes really worked. There are two sqls wich throw errors:

mysql> create index ezurlalias_is_wildcard on ezurlalias( is_wildcard );
ERROR 1061 (42000): Duplicate key name 'ezurlalias_is_wildcard'

mysql> create index eznode_assignment_is_main on eznode_assignment( is_main );
ERROR 1061 (42000): Duplicate key name 'eznode_assignment_is_main'

Thanks,
Luis

Marco Zinn

Saturday 30 September 2006 2:17:48 am

Kore, thanks for posting the new indexes. We applied them as well ;)
Just a note: Can you have a look at the ezcontentobject.language_mask comparisons in the WHEREs, so this could be optimized for single lingual sites?

Marco
http://www.hyperroad-design.com

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 04:27:02
Script start
Timing: Jan 31 2025 04:27:02
Module start 'layout'
Timing: Jan 31 2025 04:27:02
Module start 'content'
Timing: Jan 31 2025 04:27:03
Module end 'content'
Timing: Jan 31 2025 04:27:03
Script end

Main resources:

Total runtime1.2924 sec
Peak memory usage4,096.0000 KB
Database Queries79

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2500151.2266
Module start 'layout' 0.00450.0026 739.476636.6797
Module start 'content' 0.00721.2844 776.15631,104.2969
Module end 'content' 1.29150.0009 1,880.453123.8281
Script end 1.2924  1,904.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2393160.0002
Check MTime0.00130.1008160.0001
Mysql Total
Database connection0.00060.047310.0006
Mysqli_queries1.211693.7421790.0153
Looping result0.00080.0607770.0000
Template Total1.255097.120.6275
Template load0.00180.137520.0009
Template processing1.253296.966620.6266
Template load and register function0.00180.140810.0018
states
state_id_array0.00220.169310.0022
state_identifier_array0.00090.066820.0004
Override
Cache load0.00160.1273560.0000
Sytem overhead
Fetch class attribute can translate value0.00050.042040.0001
Fetch class attribute name0.00370.2860120.0003
XML
Image XML parsing0.00180.137340.0004
class_abstraction
Instantiating content class attribute0.00000.0027140.0000
General
dbfile0.00210.1630270.0001
String conversion0.00000.000540.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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 41
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs