On 3/1/11 10:00 AM, Giovanni Toffoli wrote:
Hi all,
I don't know how common are my requirements, but I hope that somebody
will lend an ear anyway.
Briefly: I need advice on putting together:
- multiple Plone sites per Zope instance (ZODB mount points)
- moderately complex proxy configuration (virtual sites, caching,
possibly balancing).
PUTTING IN CONTEXT
In the past years my little company developed several sites/applications
on Plone 2, 2.5 and 3. We spent time and effort on quite complex
application requirements, but didn't address system/performance issues,
since most projects were dealing with research prototypes or web sites
for small non-critical businesses. Thus, we never used Zeo and proxies
other than Apache. On the other hand, we always created multiple Plone
sites per Zope instance for sake of flexibility in maintenance and in
development: sharing skills and components among low-budget projects.
Recently we resolved to try AWS to get rid of the troubles involved in
in-house hosting or in relying on costly and/or unflexible housing. We
installed with success the "Plone Quick Start for EC2" provided by
Jazkarta (many thanks!).
Thus, starting from the example provided by its "Plone Quick Start AMI",
we came upon Nginx, Varnish, HAProxy, and so on. And read a lot; among
others:
http://blog.jazkarta.com/2011/01/20/plone-quick-start-for-ec2-now-available-in-all-regions
http://www.martinaspeli.net/articles/an-uber-buildout-for-a-production-plone-server
http://plone.293351.n2.nabble.com/Nginx-or-Apache-td5826797.html
http://redomino.com/it/labs/documentazione/tutorial/nginx-come-reverse-proxy-di-plone/tutorial-all-pages
https://nathanvangheem.com/news/nginx-with-built-in-load-balancing-and-caching
It seems to me that the Plone Quick Start AMI by Jazkarta follows a
trend on which several active members of the Plone community agree (e.g.
Martin Aspeli, Andreas Jung). Schematically, the solution includes Nginx
-> Varnish (caching) -> HAProxy (balancing). Probably HAProxy can be
considered an option in sites without extreme requirements.
OUR USE CASE
In future we will avoid to keep too many Plone sites on the same
instance, since EC2 will favour giving each customer exactly what he
needs and pays for. However, having each Plone site configured on a ZODB
mount point would make easier to pass from development to production and
to maintain/upgrade separately each site.
My reference scenario:
- 1 EC2 instance with 1 ZeoServer and a few Zeo Clients
- from 1 to 3 Plone sites, each on a ZODB mount point
- medium level of traffic, without notable peaks
- most users are anonymous
- autenticated access only for admin. and content management
- optional requirement: HTTPS.
My questions:
- is Nginx + Varnish ok?
- how to allocate Zeo clients? per site, class of user, both?
- how to implement the allocation of the Zeo clients?
Perhaps others will have different advice/comments, but as far as I am
concerned:
Nginx + Varnish
---------------
- Yes, NGINX & Varnish are perfectly fine, and capable pieces of
software. Personally though, I like to do the absolute bare minimum to
get apps out the door. As of late, that has meant for me, and my hosting
clients:
- Debian 5 on Rackspace cloud with vendor Apache (i.e. aptitude
install apache2 [1]).
- Plone 4.
In other words, I don't bother with caching at all and with the speed
improvements provided by Plone 4 (via Python2.6) this works fine for
most sites (especially small ones with anon only visitors like you
describe.)
At a minimum, I deploy a single Zope2 client and ZEO instance per site.
No multiple Plone sites per Zope2 instance. ZEO makes automated "backups
and packups"™ possible [2].
Zeo client allocation and implementation
----------------------------------------
Re: allocation, I don't think there is any good rule of thumb (or if
there is I can never remember what it is.) Typically, I add ZEO clients,
watch performance via top, then adjust as necessary.
This addition necessitates a "jump" to using a load balancer, at which
point Pound or HAProxy are both reasonable choices. I've also heard tell
that Nginx and/or Varnish can do load balancing too, but I've not tried.
At the same time you make this "jump", you are probably going to want to
add a caching agent. Otherwise, you wouldn't be adjusting your stack (if
you didn't care about performance.) Both Squid and Varnish are
reasonable choices here.
Lastly, I'm not sure what you mean by implementation other than perhaps
you are wondering how to use Buildout? Or are you asking which load
balancer is best?
Hope this helps,
Alex
[1] Here is a list of all the packages I deploy, via
https://github.com/collective/Debian-Deploy-Plone/blob/master/fabfile.py#L12:
apache2 apache2-dev build-essential less libbz2-dev libjpeg62
libjpeg62-dev libpng libpng-dev libreadline-dev libssl-dev rsync
subversion unzip zlib1g-dev.
[2] This is what I deploy now in production:
http://dist.aclark.net/build/plone/4.0.x/zeo.cfg
Thank you very much in advance, Giovanni
--
Alex Clark · http://aclark.net/help-me-help-plone
_______________________________________________
Setup mailing list
Setup@lists.plone.org
https://lists.plone.org/mailman/listinfo/setup