Blog Entry 12 years, 10 months ago

Speed up {this}

Plone 4 does a great improvement on its speed, but running one Plone site without any further settings on cache and proxies at front is still not enough (this simple site is an example). I just have known that the popular CacheFu is not longer being updated: http://plone.org/products/cachefu/. And this one seems to be the best at the moment: http://plone.org/products/plone.app.caching

Plone 4 does a great improvement on its speed, but running one Plone site without any further settings on cache and proxies at front is still not enough (this simple site is an example).

I just have known that the popular CacheFu is not longer being updated: http://plone.org/products/cachefu/. And this one seems to be the best at the moment: http://plone.org/products/plone.app.caching

After some benchmarks on the current site processing & responses, the highest request per second (with 50 concurrent users) is ~19 reqs/sec, median at ~15 reqs.sec.

Not too bad, but still not good enough.

I will continue to update this entry after adding products & tweaking some places...

{24hrs later...}

OK, now I have plone.app.caching 1.0b1 and Varnish installed, via buildout:

[buildout]
extends = http://good-py.appspot.com/release/plone.app.caching/1.0b1
eggs =
    ...
    plone.app.caching
...
[varnish-build]
recipe = zc.recipe.cmmi
url = http://sourceforge.net/projects/varnish/files/varnish/2.1.3/varnish-2.1.3.tar.gz/download

[varnish]
recipe = plone.recipe.varnish
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
bind = 127.0.0.1:8000
backends = 127.0.0.1:8080
cache-size = 256M

After running the buildout again, and firing Zope and Varnish up, I have all requests following this:

    Site request > Apache[80] > Varnish[8000] > Zope[8080]

Apache does the rewrite thing while Varnish plays role of cache proxy (I haven't load balancing here... yet) . The plone.app.caching do all the cache settings, purgings, custom rules,... at Plone layer.

I case of having issue with login, we need to recheck the configuration inside the varnish.vcl to be sure that authenticated session will have low (or not) site cache:

sub vcl_hit {
...
if (req.http.Authenticate || req.http.Authorization) {
    return(pass);
}
if (req.http.Cookie && req.http.Cookie ~ "__ac(|_(name|password|persistent))=") {
    return(pass);
}

Finally, the result (...which is beautiful) of benchmarking is ~550 reqs/sec, nearly 40 times faster than before!!!

Additionally, some changes on server resources are the increasing of RAM and decreasing of CPU usages.

Recent Reads