Share » Forums » General » eZ publish performance optimisation FAQ

eZ publish performance optimisation FAQ

eZ publish performance optimisation FAQ

Friday 16 December 2005 10:05:01 am - 44 replies

Modified on Friday 21 April 2006 6:57:02 am by Denis Igin

Author Message

Gabriel Ambuehl

Friday 16 December 2005 10:22:49 am

First and foremost, use a PHPAccelerator with plenty (128MB+ recommended) of RAM cache. And activate ViewCache (if you find pages getting cached incorrectly, tune their cache-blocks), TemplatCache, TemplatCompile.

I get cached page load times of below 0.15s with those settings on a 3GHz P4 (Linux or FreeBSD).

Visit http://triligon.org

Denis Igin

Saturday 17 December 2005 9:14:09 am

Great start Gabriel, thank you! Anyone else? What's the second most important issue? I can keep track of this thread as an actual document with all the techniques.

NXC - OPEN RELIABLE

Łukasz Serwatka

Saturday 17 December 2005 10:58:35 am

Hi Denis,

This is good topic ;)

If possible use $node.children array if you need access to children or $node.parent if you need access to parent object. If you will reduce count of fetches this can give you some additional performance gain. Write proper code without notices, warnings, use deboug output for development. If you can do something on 2 same ways, check which one is faster.

For better performance, you can replace complex template code with custom operators that do the same in PHP code. For example instead of fetching whole objects for creating dropdown list use custom tpl operator which returns SQL array. Much faster ...

Use {cache-block} for optimization your pagelayout. If possible, use static cache, this will give you really good performance.

For the best performance, use Linux and MySQL.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Bård Farstad

Saturday 17 December 2005 11:16:57 am

Gabriel, just a note on our experience with FreeBSD. PHP uses one stat call for every element in the path of an included file. This is done to check permissions and safemode settings in PHP. On FreeBSD these stat calls are very expensive. eZ publish is very modular and has several included files needed for rendering a page. For this reason you will not get the same speed out of eZ publish running on FreeBSD as on Linux.

For some machines we have noticed quite much faster load times on Linux compared to FreeBSD. So it might be work looking into Linux as the performance is noticeably better there.

As a note I usually see 0.05 seconds of load time of a fully cached page in standard eZ publish on my laptop (1.8 GHz Pentium M, 1GB RAM).

--bård

Documentation: http://ez.no/doc

Gabriel Ambuehl

Saturday 17 December 2005 3:00:33 pm

While for political reasons I'm currently developping againt Linux (both 2.4 and 2.6), on similar spec'ed hardware I've noticed little difference between FreeBSD 4.11 and Linux 2.6 (Linux 2.4 isn't quite as good). However, I don't use safemode (it's an ugly, misguided hack with little security value when you come down to it). I also think that FreeBSD DOES cache the stat results if it got enough RAM to do so, so it shouldn't be that expensive (writes on UFS1 can be expensive because of the drives usually being synced instantly). Furthermore, claiming Linux is invariably faster isn't of much use without stating the filesystem in question (I've found JFS to be dog slow, for one and I wouldnt touch reiser, ever).

I don't manage getting much below 0.1s (nowhere close to 0.05s, anyway) on 3GHz P4/Athlon64 on either though. FWIW, there's a lot of variables involved. If you don't get below 0.5s something's likely wrong and might be tunable with proper cache settings/PHP setups, but if you dont get 0.1s over 0.2s it could mean your setup still is near it's peak.

I would love to see some formal benchmarks (especially once you get into big to huge sites with hundreds of thousand of nodes [1]) on different OSs

[1] Below that, throwing more hardware at it will let it scale pretty well to handle more users, but I'm not too sure what would happen with millions of nodes.

Visit http://triligon.org

Denis Igin

Tuesday 20 December 2005 1:42:11 am

How about system software environment configuration tips aside accelrators - PHP/DB/etc.? Does it have any significant influence on overall performance?

NXC - OPEN RELIABLE

Paul Forsyth

Tuesday 20 December 2005 2:15:53 am

We need to agree on the variables involved with optimisation. I've knocked up a small list
which should be expanded.

Hardware
--------

CPU         : 
Memory      :
Disk space  :

Sofware
-------
OS               :
SQL             :
WebServer    :
PHP             :
Accelerator   :
eZ Version    :

eZ
--

Site.ini

[ContentSettings]
ViewCaching=enabled
PreViewCache=enabled

[TemplateSettings]
NodeTreeCaching=enabled
TemplateCache=enabled
TemplateCompile=enabled
TemplateCompression=enabled
TemplateOptimization=enabled

[SearchSettings]
DelayedIndexing=enabled

We also need to have several aims. Most of the site.ini settings here will boost speed *after* cache has been created. But, for example, DelayedIndexing helps to speed up the publishing process.

So, some priorities:

1. Browsing site.
2. Publishing.
3. Building cache after clearing.

Please add to this.

Paul

Denis Igin

Monday 09 January 2006 3:34:35 am

Stolen here http://ez.no/community/forum/general/what_s_the_concurrent_number_of_ez_no_at_peak_time from Kåre:

It's extremly important you optimize the pagelayout when dealing with high traffic sites. You can check/controll this by counting the number of SQL queries for a cached page in the debug output. There should not have more than 3 SQLs for a cached page.

Sorry for being stubborn, just keep my eyes open for hints on the matter :)

NXC - OPEN RELIABLE

Denis Igin

Thursday 12 January 2006 9:19:01 am

Some basic performance notes from the requirements page at http://ez.no/products/ez_publish_cms/info/requirements_for_ez_publish :

- For the best performance, we recommend using Linux and Mysql. Some other factors that may influence the performance of your site are:
- The number of page views per unit time.
- The number of concurrent users.
- The number of nodes. This can affect search and navigation speed when you have several hundred thousand nodes.
- Update frequency, e.g. how often your content is changed.
- The complexity of your templates. (For better performance, you could replace complex pieces of template code with custom operators that do the same in PHP code.)

I still do not loose hope this thread will revive and eventually form a doc :)

NXC - OPEN RELIABLE

Tore Skobba

Friday 13 January 2006 2:22:29 am

Hi all

Nice thread, let me just add this link.

http://ez.no/community/contribs/hacks/ez_sitecopier

It is an contribution on how to use the HTTrack website copier to make an copy of your eZ website and then use Apache (or anyother webserver) to serve your HTML files (copied form our eZ installation). This will however leave the user login and search unusable.

Or you could use the staticcache functionality of eZ as described in:

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/contentsettings/staticcache
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/staticcache_ini/cachesettings/staticstoragedir

Cheers
Tore

Christian Johansen

Thursday 19 January 2006 4:20:09 am

Paul Forsyths suggestion to do:

Site.ini

[ContentSettings]
ViewCaching=enabled
PreViewCache=enabled

[TemplateSettings]
TemplateCache=enabled
TemplateCompile=enabled
TemplateCompression=enabled
TemplateOptimization=enabled

[SearchSettings]
DelayedIndexing=enabled

Unfortunately these settings messed up my whole site. Images and text disappeared and now, after removing those settings I cannot get the images back...

Edit: After manually handling the cache I now have everything back :) But why did stuff disappear from those settings?

Edit 2: It seems caching removes $node from my pagelayout.tpl. So in order to make use of caching I need to find a way to access these values in the pagelayout without touching $node:

$node.path_identification_string
$node.name
$node.url_alias

Paul Forsyth

Thursday 19 January 2006 5:20:44 am

It can be a shock when this happens.

Have a read of this doc:

http://ez.no/doc/ez_publish/technical_manual/3_6/templates/the_pagelayout/variables_in_pagelayout

to explain where variables change ;)

paul

Vjeran Vlahovic

Thursday 19 January 2006 6:04:30 am

Hi all,
Would UsePersistentConnection=enabled gain some more speed? Documentation says something about unwanted effects in the past. Is that information still relevant?

http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/site_ini/databasesettings/usepersistentconnection

http://www.netgen.hr/eng

Paul Forsyth

Thursday 19 January 2006 6:44:19 am

I dont think you would see much speed here except if your use of MySQL was exceptionally high. MySQL use is fast. The use of PHP is the biggest speed drawback.

paul

Denis Igin

Thursday 19 January 2006 9:58:11 am

Some performance metrix definitions can be found in this whitepaper http://ez.no/content/download/95639/383244/file/Whitepaper+Scalability+and+Performance.pdf with a reference to http://ez.no/community/articles/clustering_ez_publish where cluster environment is described as yet another option to speed up your system.

NXC - OPEN RELIABLE

Denis Igin

Thursday 02 February 2006 2:26:59 am

Some excerpts from the old documentation on the topic. Hope most of them are still valid for 3.6+, caching issues omitted due to significant improvement in newer versions:

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/installation/virtual_host_setup
In Virtual Host setup the following Apache httpd.conf directives can influence performance:

php_value magic_quotes_gpc 0
php_value magic_quotes_runtime 0

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/customization/access_control/access_control_management
One of the instruments to control the availability of system resources is Policy Omit Statements designed to speed up the system in service requests available for the world, e.g. PolicyOmitList[]=content/read. Use them to grant unlimited access to the following system functions, even if you are going to setup a rather paranoic authorization regime later on:

PolicyOmitList[]=user/login
PolicyOmitList[]=user/logout
PolicyOmitList[]=user/success
PolicyOmitList[]=layout
PolicyOmitList[]=ezinfo

Place these statements in your - global - site.ini.append file (settings/override - directory), if you don't have good reasons to make more sophisticated use of Policy Omit Statements in different Site Access - definitions.

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/configuration/configuration/ez_publish_running_on_a_cgi_version_of_php
Because of performance reasons it's still advised to use the Apache module version of PHP if you have the possibility to do so, not CGI version of PHP.

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/configuration/optimization/configuration_tuning
If you need to have charset conversion for some reason you should compile PHP with the mbstring extension, this will go alot faster than the built in conversion done in eZ publish. If you don't need to do charset conversion you should make sure that eZ publish uses the same charset all over. The following settings/files should be the same.

site.ini:
[DatabaseSettings] Charset=iso-8859-15
i18n.ini:
[CharacterSettings] Charset=iso-8859-15
template.ini:
[CharsetSettings] DefaultTemplateCharset=iso-8859-15

You can remove the content_read workflow from OperationSettings to get a performance improvement. Recommended setting, if you don't need content read workflows.

[OperationSettings] AvailableOperations=content_publish;shop_confirmorder;shop_checkout

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/configuration/optimization/php_acceleration
PHP Accelerators configuration tips.

http://ez.no/products/ez_publish_open_source_enterprise_cms/documentation/incoming/session
Make sure PHP stores sessions operate correctly because it's used to speed up access to the site by storing often used information.

NXC - OPEN RELIABLE

Denis Igin

Thursday 02 February 2006 2:31:59 am

Comments for an speed boost and lowering number of fetches / sql quries from http://ez.no/doc/ez_publish/technical_manual/3_6/templates/information_extraction/outputting_node_and_object_data#comment2472

If you need to display some information about the children or grand children in the node template this is possible with $node.children and $node.children.0.children (if any children exist this will loop thru any children of your first child)
To loop thru children:

{foreach $node.children as $nodechild}
  {$nodechild.url_alias|ezurl}
  {$nodechild.name}
  {$nodechild.node_id}
{/foreach}

The same thing can be done with parents: $node.parent

Remember to only use $node in node templates and not in your pagelayout file.
Because it's not available on cached pages (ViewCaching).

NXC - OPEN RELIABLE

Denis Igin

Tuesday 14 February 2006 5:23:11 am

Some hardware impact on perfromance (hard drive speed and balancing, raid, file system and allocation) are discussed in this thread: http://ez.no/community/forum/developer/performance_tuning_do_multiple_hard_disks_have_an_impact

Major conclusions include:

- Lukasz: I don't think so that splitting content between two disks will give you additional performance ... Just choose the fastest disk and keep data on it.
- Gabriel: I'd venture to guess that ezpublish will likely NOT be disk speed limited very highly as you will usually be able to fit quite a lot of stuff into disk cache if you have any sane amount of RAM in a box

NXC - OPEN RELIABLE

Betsy Gamrat

Monday 06 March 2006 7:51:09 am

If eZ is used as the home page, you can preprocess it - which just converts it into an HTML image.

That will allow you to have a faster home page.

There is an article at Dr. Dobb's Journal http://www.ddj.com/documents/s=9938/ddj0601g/0601g.html, and supporting code at http://wirehopper.com/php/preprocess.php.

I have used this general approach on some very high traffic homepages, with great success.

In addition, I used cache-blocks, and for very high speed content delivery, created specialized templates that had only enough code to deliver the content (single streamlined CSS, very limited HTML).

Another approach is to use eZ to create PHP that can deliver the content dynamically (this works well when the content is a component of another page).

Alexandre Abric

Tuesday 07 March 2006 7:12:15 am

@Betsy Gamrat > Sorry but I don't see any benefit in this approach compared to the natively supported static cache in eZ.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu