Powerful Server Advice

Powerful Server Advice

Tuesday 07 December 2010 2:58:36 am - 12 replies

Modified on Tuesday 07 December 2010 4:18:07 am by John Smith

Author Message

Gaetano Giunta

Tuesday 07 December 2010 3:32:15 am

Basic tuning advice:

1. tune your Apache server: disable all unused apache modules & php extensions, enable expiry headers for all static content, test is using gzip helps

2. set up a static cache: eZ static cache, varnish, squid, whatever

3. check proper use of cache-blocks and view-caching: how many sql requests per page are being generated by eZP?

Principal Consultant International Business
Member of the Community Project Board

John Smith

Tuesday 07 December 2010 4:17:17 am

Cheers, So this means the server which I mentioned in my last post is quite powerful and capable of handling the load and around 10 websites.

>> 1. tune your Apache server: disable all unused apache modules & php extensions, enable expiry headers for all static content, test is using gzip helps

How to know what to keep and what to leave. Do not want to mess the server settings as live sites on it. Need bit more help please. Is there any set checklist or idiot guide where I can check it.

>> 2. set up a static cache: eZ static cache, varnish, squid, whatever

Will look it into.

>>

>> 3. check proper use of cache-blocks and view-caching: how many sql requests per page are being generated by eZP?

I am properly using cache-blocks, not generating more than 5 SQL requests per pages. Normally it is around 3 requests.

Any more ideas please. Everybody say it is very heavy system and uses more resources over other CMS available in the market. Need to defend the eZ publish. Performance has improved after moving from 3.x to 4.x. Just need some help in tuning the server and system.

Gaetano Giunta

Tuesday 07 December 2010 6:01:24 am

Sorry, no time for a proper tutorial on server tuning, but I am sure you can dig a lot of info both on this forum and on google.

3 requests per page is quite good, congrats!

One tip: update to ezp4.4 and save on sessions, as sessions are not created by default for anon users.

And another one: make sure innodb buffer_pool, thread_cache and query_cache are fine (use mysqltuner.pl if you're no DBA).

Principal Consultant International Business
Member of the Community Project Board

Jani Tarvainen

Tuesday 07 December 2010 8:27:45 pm

The server you currently should be able to handle quite a bit of load.

A few quick boosters are:

  • Make sure you are running a PHP accelerator, my recommendation is http://php.net/manual/en/book.apc.php
  • Make sure MySQL query caches are on
  • To ensure performance for peaks look into Varnish (purging extension: http://projects.ez.no/all2evcc )

--
http://ezpublish.fi/

André R.

Wednesday 08 December 2010 5:43:46 am

I'll second Varnish + eZ Publish 4.4 or higher (because of the session change, makes it a lot easier to setup Varnish et al.).

This is the best way to cope with traffic spikes, far cheaper then buying an big iron just to maybe cope with traffic during next peak*.

* Varnish can handle 5000++** rec/sec on a server where eZ Publish can handle 140 req/sec, so you have far better protection against peak traffic then you'll ever have by buying a faster server..

** Also seen blog post testing Varnish on big iron and getting it to (theoretically) handle 250k+ req/sec.. yes, it's fast :)

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

John Smith

Friday 10 December 2010 8:20:36 am

Whole day wasted on STATIC CACHE without any luck. I thought it would save my life but ..... There is a suggestion to upgrade the system to 4.4 because of session, but it is not possible straight way, so I have to stick with 4.0.1 and see if I can tune few other things as per suggestions.

settings/override/staticcache.ini.append.php

<?php /* #?ini charset="utf-8"?
[CacheSettings]
HostName=xxx.com
StaticStorageDir=static
MaxCacheDepth=4
CachedURLArray[]
CachedURLArray[]=/home*
AlwaysUpdateArray[]
AlwaysUpdateArray[]=/home
CachedSiteAccesses[]
CachedSiteAccesses[]=ab
*/ ?>

Actually followed the article on the following URL:

http://share.ez.no/learn/ez-publish/ez-publish-performance-optimization-part-3-of-3-practical-cache-and-template-solutions/%28page%29/3

Static page is generating fine from command line by running "makestaticcache.ini.append.php" but nothing is happening automatically when you edit and publish the page itself from admin. Wired sort of behaviour, from timestamp I can see the html page is generated exactly after when you hit "Send for Publishing" button but content is not being updated.

Any body successfully running static cache on 4.0.1 please.

John Smith

Friday 17 December 2010 12:49:58 am

Anybody ????

Yannick Komotir

Friday 17 December 2010 2:35:53 am

Hello,

Static files are not generated automatically you must set up a cronjob task for this.

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

John Smith

Friday 17 December 2010 3:58:03 am

So this means everytime you update anything, you wait for the cronjob to run and regenerate the static page.

Do not think so?

Publish action should automatically trigger the static regeneration process.

Gaetano Giunta

Friday 17 December 2010 7:01:34 am

The static regeneration of the pages does not need a cronjob, afair. As soon as you publish an object, eZP does an http request to itself and saves the html received on the filesystem.

In fact, via the setting Alwaysupdatearry you can set up pages whose html is always updated, regardless of what content you edit (eg. useful for always regenerating the homepage if it shows content coming from many places in the database).

When you say "Wired sort of behaviour, from timestamp I can see the html page is generated exactly after when you hit "Send for Publishing" button but content is not being updated." what do you mean exactly?

If you mean that:

- when you click on 'publish', the timestamp of the html file on the disk changes

- but users do not see the updated page

If is most likely related to rewrite rules on the apache server

Principal Consultant International Business
Member of the Community Project Board

John Smith

Friday 17 December 2010 7:56:13 am

When you say "Wired sort of behaviour, from timestamp I can see the html page is generated exactly after when you hit "Send for Publishing" button but content is not being updated." what do you mean exactly?

 

If you mean that:

 

- when you click on 'publish', the timestamp of the html file on the disk changes

 

- but users do not see the updated page

 

If is most likely related to rewrite rules on the apache server

You are quite.... When I click "Publish" button, the timestamp of the html file on the disk changes, but system does not update the page.

Static page is generating fine from command line by running makestaticcache.php.....

Apache config:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond /var/www/<websiteURL>/web/static/<siteaccess>/index.html -f 
    RewriteRule ^/$ /static/<siteaccess>/index.html [L] 
    RewriteCond /var/www/<websiteURL>/web/static/<siteaccess>/index.html -f 
    RewriteRule ^$ /static/<siteaccess>/index.html [L]   
    RewriteCond %{REQUEST_METHOD} !^POST$ 
    RewriteCond /var/www/<websiteURL>/web/static$1/index.html -f 
    RewriteRule ^(.*)$ /static$1/index.html [L]   
    
    RewriteRule !\.(gif|css|jpg|png|jar|ico|js)$ /index.php
        RewriteRule content/treemenu/? /index_treemenu.php [L]
        Rewriterule ^/var/storage/.* - [L]
        Rewriterule ^/var/[^/]+/storage/.* - [L]
        RewriteRule ^/var/cache/texttoimage/.* - [L]
        # STAR RATING + JSCORE EXTENSIONS
        Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|flash|images|lib|javascripts?)/.* - [L]
        RewriteRule ^/var/([^/]+/)?cache/public/.* - [L]
        RewriteRule ezjscore/call/ /index_ajax.php [L]
        RewriteRule ^/var/[^/]+/cache/(texttoimage|public)/.* - [L]
        Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
        Rewriterule ^/share/icons/.* - [L]
        Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|javascript|flash|lib?)/.* - [L]
        Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
        RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
        RewriteRule ^/favicon\.ico - [L]
        RewriteRule ^/robots\.txt - [L]
        Rewriterule ^/usage/.* - [L]
    # Uncomment the following lines when using popup style debug.
        # RewriteRule ^/var/cache/debug\.html.* - [L]
        # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]
        
        RewriteRule .* /index.php
</IfModule>

Gaetano Giunta

Friday 17 December 2010 9:31:21 am

Just to be 100% clear:

- the timestamp of the html file on disk changes

- but the contents of the very same file are not updated

If this is so, it can be considered for sure a bug.

Do you have any workflow events set up in your pre-publish or post-publish triggers.

What I think could be happening is that eZP is somehow mixing up a little bit the order of operations, and generating the new version of the html file before it has effectively cleared the caches of the old version.

Either that, or this: when eZP is recovering the new version of the file via an http request, it does not recover the dynamic version but the static one, so in the end it just copies the old static version with itself again and again.

You might want to test this by looking at your apache logs (if you have no other traffic on the site) at the moment you publish an object

A couple of notes about your rewrite rules:

- you should add a rwritecond checking for the is_logged_in cookie, and never send logged-in users to static pages

- same for finding a '(' char in the query strings: it means it is a page with view parameters and as such should always be routed to eZP, never to static

I think you will find some posts here in the forum explaining the 'improved' rewrite rules

Principal Consultant International Business
Member of the Community Project Board

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

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