A well configured website being very slow?

Author Message

Clemens T

Thursday 20 August 2009 11:37:58 am

Hello all,

I just moved a website from server A to server B. Server B is faster than A, but it seems as though eZ Publish is running faster on A.

The old server was:
Intel Celeron 2.66 GHz | 1GB mem
Apache 1.3.34
PHP 4.4.2
Local mysql server

The new one is:
Apache 2.0
PHP 4.3.9
Mysql Storage @ a SAN

Here's some configuration:

[TemplateSettings]
TemplateCache=enabled
TemplateCompile=enabled
TemplateOptimization=disabled
Debug=disabled
ShowXHTMLCode=disabled
ShowUsedTemplates=disabled
DevelopmentMode=disabled
[ContentSettings]
ViewCaching=enabled
PreViewCache=disabled
[ViewCacheSettings]
SmartCacheClear=enabled

[A]
DependentClassIdentifier[]
DependentClassIdentifier[]=B
DependentClassIdentifier[]=C
ClearCacheMethod[]
ClearCacheMethod[]=parent
ClearCacheMethod[]=siblings
#1552 is the home object ID
AdditionalObjectIDs[]
AdditionalObjectIDs[]=1552

[B]
DependentClassIdentifier[]
DependentClassIdentifier[]=B
ClearCacheMethod[]
ClearCacheMethod[]=object
ClearCacheMethod[]=parent

[C]
DependentClassIdentifier[]
DependentClassIdentifier[]=C
ClearCacheMethod[]
ClearCacheMethod[]=object
ClearCacheMethod[]=parent
ClearCacheMethod[]=relating

<b>pagelayout.tpl</b>

{def $current_node=fetch('content','node',hash('node_id',$module_result.content_info.node_id))}
{cache-block keys=array($uri_string)}
...
			{include uri='design:menu.tpl'}
...
{/cache-block}
		{$module_result.content}
{cache-block keys=array($uri_string)}
...footer...
</body>
</html>
{/cache-block}

All viewcaches are being generated, and a lot of other cache as well, but the result still is a very slow website (takes ~3 seconds to load, where 0.5 was normal @ the old server).

Any ideas, does it have anything to do with the database maybe, or the cache files that are not being loaded properly? Or is it my pagelayout, or something completely different?

Thanks in advance,

Clemens

Heath

Thursday 20 August 2009 3:32:22 pm

Oh no!

Are you certain the details you shared are accurate.

It would be a very bad idea to move an eZ publish 3.x site from a PHP 4.4.x server to PHP 4.3.9 and almost certainly point to serious runtime errors being possible in such a case.

What kind of SAN are you using. Which one/type could be important. I could also expect to see performance decrease in moving from a local db server to a remote one depending on it's performance optimization state.

Check file/folder user(owner) / group permissions are correct. This could prevent cache files from being written/read and affect performance.

Check your httpd vhost configuration is performance optimized (not just the same) as different php.ini httpd.conf and my.conf configurations (outside of ezpublish) also play critical roles in runtime performance of a site ... and almost always certainly forgotten by the casual professional.

These things come to mind reading your post.

I took a moment to write about some performance improvements I made to a customer site recently feel free to add your own by editing this article at anytime ...

http://ezpedia.org/en/solution/performance_tuning_ez_publish_4

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Clemens T

Friday 28 August 2009 5:59:41 am

Heath,

Thanks for your comments. I'm running eZ Publish 3.9.1 at this point. I've tried to enable as much of the performance improvements as possible via a htaccess file (i'm on a shared hosting platform unfortunately):

php_value allow_call_time_pass_reference 0
php_value max_execution_time 100
php_value memory_limit 300m
php_value upload_max_filesize 40M
php_value mysql.connect_timeout 60
php_value mysql.max_links 400
php_value mysql.max_persistent 0
php_value mysql.query_cache_type 1
php_value mysql.query_cache_limit 2M
php_value mysql.query_cache_size 100M
php_value mysql.net_read_timeout 120
php_value mysql.key_buffer_size 500M
php_value mysql.tmp_table_size 16M
php_value mysql.table_cache 4000

Now, I've also removed all the contents from the pagelayout.tpl, and did a remove-template-cache action, here's the result:

Checkpoint	Elapsed	Rel. Elapsed	Memory	Rel. Memory
Module start 'content'	0.0000 sec	4.8246 sec	7,238.6953KB	2,408.4141KB
Module end 'content'	4.8246 sec	0.8122 sec	9,647.1094KB	364.1172KB
End	5.6368 sec	 	10,011.2266KB	0.3556KB
Total runtime:	6.3292 sec	
Time accumulators:
 Accumulator	 Elapsed	 Percent	 Count	 Average
ini_load				
Load cache	0.8624 sec	7.0261%	10	0.0862 sec
FindInputFiles	0.2088 sec	1.7010%	10	0.0209 sec
Mysql Total				
Mysql_queries	0.1715 sec	1.3971%	14	0.0122 sec
Looping result	0.0004 sec	0.0035%	13	0.0000 sec
Template Total	1.2490 sec	10.2%	2	0.6245 sec
Template load	0.5968 sec	4.8623%	2	0.2984 sec
Template processing	0.6498 sec	5.2941%	2	0.3249 sec
override				
Cache load	0.4253 sec	3.4650%	2	0.2126 sec
General				
dbfile	0.4443 sec	3.6195%	7	0.0635 sec
Total script time:	12.2740 sec	

Next, I removed template cache again and put back my original pagelayout:

Timing points:
Checkpoint	Elapsed	Rel. Elapsed	Memory	Rel. Memory
Module start 'content'	0.0000 sec	1.9291 sec	7,238.6797KB	2,404.3281KB
Module end 'content'	1.9291 sec	5.7389 sec	9,643.0078KB	3,610.2422KB
End	7.6680 sec	 	13,253.2500KB	0.0029KB
Total runtime:	10.4704 sec	
Time accumulators:
 Accumulator	 Elapsed	 Percent	 Count	 Average
ini_load				
Load cache	0.3033 sec	2.3567%	10	0.0303 sec
FindInputFiles	0.0959 sec	0.7453%	10	0.0096 sec
Mysql Total				
Mysql_queries	0.1500 sec	1.1659%	17	0.0088 sec
Looping result	0.0049 sec	0.0377%	16	0.0003 sec
Template Total	8.5030 sec	66.1%	2	4.2515 sec
Template load	6.0705 sec	47.1707%	2	3.0352 sec
Template processing	2.4277 sec	18.8641%	2	1.2138 sec
Template parser: create text elements	0.0148 sec	0.1153%	4	0.0037 sec
Template parser: remove whitespace	0.0073 sec	0.0568%	4	0.0018 sec
Template parser: construct tree	0.2161 sec	1.6789%	4	0.0540 sec
Template load and register function	0.0475 sec	0.3690%	6	0.0079 sec
override				
Cache load	4.1310 sec	32.1003%	2	2.0655 sec
General				
dbfile	0.6811 sec	5.2924%	19	0.0358 sec
Total script time:	12.8692 sec	

After this, I refreshed the page (so the cache has been generated):

Timing points:
Checkpoint	Elapsed	Rel. Elapsed	Memory	Rel. Memory
Module start 'content'	0.0000 sec	0.5939 sec	7,238.6797KB	2,404.3281KB
Module end 'content'	0.5939 sec	0.2179 sec	9,643.0078KB	380.9453KB
End	0.8119 sec	 	10,023.9531KB	0.3720KB
Total runtime:	1.2698 sec	
Time accumulators:
 Accumulator	 Elapsed	 Percent	 Count	 Average
ini_load				
Load cache	0.1600 sec	8.6581%	10	0.0160 sec
FindInputFiles	0.0280 sec	1.5150%	10	0.0028 sec
Mysql Total				
Mysql_queries	0.0326 sec	1.7655%	14	0.0023 sec
Looping result	0.0020 sec	0.1081%	13	0.0002 sec
Template Total	0.6458 sec	35.0%	2	0.3229 sec
Template load	0.1690 sec	9.1450%	2	0.0845 sec
Template processing	0.4769 sec	25.8116%	2	0.2384 sec
override				
Cache load	0.1030 sec	5.5734%	2	0.0515 sec
General				
dbfile	0.0949 sec	5.1371%	13	0.0073 sec
Total script time:	1.8476 sec	

How should I interpret these numbers? And their differences? Is this a memory/CPU/database/harddrive performance-related issue?

Also, if I do multiple requests at around the same time (10 or so), the page gets much slower (like 3.8 secs or so per page). How is this possible?

Thanks again!!
Clemens

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