eZ Community » Forums » Developer » eZ Publish 4 performance & Varnish

eZ Publish 4 performance & Varnish

eZ Publish 4 performance & Varnish

Monday 22 October 2007 11:02:49 pm - 25 replies


we just tested the new eZ Publish 4.0.0alpha2 performance the following environment on a blank installed eZ instance:


Single Server, Debian 4, 2 x Intel Xeon 5130 Dual Core 2,00 GHz, 4096 MB RAM, 2 x 146 GB SAS HDD RAID1

Apache/2.2.3 (Debian) PHP/5.2.4-0.dotdeb.1 with Suhosin-Patch mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.8


Version: 3.0.15 

Except the APC accelerator, there are no performance optimized settings or proxys.

ApacheBench test result:
- 1000 request
- 5 multiple requests

# ab -n 1000 -c 5 http://mobello2.all2e-dev.de/index.php

This is ApacheBench, Version 2.0.41-dev <$Revision: 1.141 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/

Benchmarking mobello2.all2e-dev.de (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests

Server Software:        Apache/2.2.3
Server Hostname:        mobello2.all2e-dev.de
Server Port:            80

Document Path:          /index.php
Document Length:        7287 bytes

Concurrency Level:      5
Time taken for tests:   12.482263 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      7852000 bytes
HTML transferred:       7287000 bytes
Requests per second:    80.11 [#/sec] (mean)
Time per request:       62.411 [ms] (mean)
Time per request:       12.482 [ms] (mean, across all concurrent requests)
Transfer rate:          614.23 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   2.0      0      29
Processing:    44   61  14.2     58     123
Waiting:       42   59  14.2     56     121
Total:         44   61  14.5     59     123

Percentage of the requests served within a certain time (ms)
  50%     59
  66%     66
  75%     71
  80%     74
  90%     82
  95%     89
  98%     99
  99%    107
 100%    123 (longest request)

As you can see the environment is able to handle about 80 requests per second which is really impressive if you compare them with between 20 and 40 on eZ 3.x.

Within the next days we will migrate a larger site on that environment and do the same tests.

Modified on Tuesday 11 January 2011 9:59:22 am by Nicolas Pastorino

Tuesday 31 March 2009 5:29:54 pm

If I put an ugly :

var_dump( $currentUser->isLoggedIn()); 

I noticed I'm first connected (return true) then I redirected to the login page.
Somewhere I lose the connected state.

I also get 2 warnings about session :

session_module_name() [<a href='function.session-module-name'>function.session-module-name</a>]: A session is active. You cannot change the session module's ini settings at this time. in /********/lib/ezutils/classes/ezsession.php on line 319

A session had already been started - ignoring session_start() in /********/lib/ezutils/classes/ezsession.php on line 372

Modified on Tuesday 31 March 2009 5:38:21 pm by Pablo Pernot

Tuesday 31 March 2009 6:39:45 pm

Gosh... I get it.

session was at auto-start in php.ini.....

Wednesday 13 May 2009 4:03:34 pm

Hello everyone,

Just want to share some things which we discovered. We have a web with nice number of visitor so we plan to use varnish for better performance. Problem is that this web has also non-anonymous users. We want to make varnish cache anonymous only. For testing purposes first we upgrade it to eZ 4.1.1 and compiled varnish 2 from source.
Then we configured everything following:

First tests showed that using varnish is much faster of course. On very old and bad PC with virtual ubuntu machine we had about 300 trans/sec (siege test).
Also we verified that 'is_logged_in' cookie introduced in eZ 4.1 functions well with varnish configuration.

Problem was that this setup was not functioning well from the client side: after user logs in client web browser starts to cache (it receives cache and max-age headers ) and then if the user logs out browser is showing that cached pages (with user details).
We considered several solutions:
- to make user details with ajax (to much work),
- to rewrite cache headers for client in varnish (to difficult, we are varnish beginners),
- to use s-maxage header (didn't find any information about how varnish support this),
but none of them was optimal.

So we finally found rather easy solution:
- on eZ side we disabled all custom headers and use default (let varnish do everything and client will receive no-cache headers)
- in varnish configuration we changed order of execution in vcl_fetch like this:

sub vcl_fetch {
        # default time to live for cache objects
        set obj.ttl = 300s;
        if (obj.http.Set-Cookie ~ "is_logged_in=deleted(.*)") {
        if (obj.http.Set-Cookie) {
        if (req.request == "GET" && req.url ~ "\.(css|js|gif|jpg|jpeg|bmp|png|ico|wmf|svg|swf|ico|mov|avi|wmv)$") {
                set obj.ttl = 600s;
        if (!obj.cacheable) {

So noncacheable objects are passed but only after we cache anonymous pages and css, js and multimedia stuff.

We will test this more, but for now it seems to work very nice.


Wednesday 13 May 2009 4:44:06 pm

You can also test using the OnlyForAnonymous setting for http headers, it was introduced in 4.0.2.


Logged in users will get default headers instead when this is enabled.

Modified on Wednesday 13 May 2009 4:44:37 pm by André R

Wednesday 13 May 2009 7:07:10 pm

Khm khm happy.gif Emoticon

Andre, thanks, I will check it out.
Could be that this is exactly what we need, didn't see that setting before.


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

36 542 Users on board!

Forums menu

Proudly Developed with from