I'd like to change my setup and at last switch to RelStorage (currently FileStorage) and use Varnish for caching and load balancing.
Currently I have an Apache 2.4 server and two macros (for http and https) which create a VirtualHost including the usual RewriteRule for the VirtualHostMonster; it as well uses files in a per-instance directory to load additional redirections from files, which makes my Apache vhosts configuration file look like this:
Include conf/snippets/vhost-macros.inc
# 3rd argument is a fs subdirectory name
# 4th argument is the Zope port (of course)
# 5th argument is the ZODB-internal path of the Plone instance
Use PloneHost80 123.234.56.78 www.my-domain.com my-domain 8080 Plone
Use PloneHost80 123.234.56.78 www.my-domain.de my-domain 8080 Plone
Use PloneHost443 123.234.56.78 www.my-domain.com my-domain 8080 Plone
Use PloneHost443 123.234.56.78 www.my-domain.de my-domain 8080 Plone
# (other macro uses for other virtual hosts, e.g. for development or testing)
Include conf/snippets/vhost-macros-undef.inc
My current idea is
- to let Apache handle the TLS issue, so it would remain in front
- instead of talking to Zope directly, Apache would talk to Varnish
- Varnish would talk to two (or more, perhaps) Zope instances and handle the load balancing.
- The Zope instances would talk to the local PostgreSQL server to access the ZODB (RelStorage)
Does this sound reasonable?
More considerations:
- The Apache configuration can be reloaded safely and extremely quickly (e.g. when a new file is needed to add a redirection), so I'd like to keep the rewriting there
- Currently I still have PostgreSQL 9.3. and some sort of Plone 4.3 (ZODB 3.10.5, psycopg2 2.5.5). I couldn't find any hint for the RelStorage version in the KGS for any Plone 4.3 version. Should I stick with RelStorage 1.6.3, or is it safe to use 2.0.0 in production?
- My sites are multilingual and language-switchable (with some paths valid for both languages and providing different contents), so this would need to be supported.