I have a small number of Plone sites running in virtual hosts of an Apache 2.4 server. I have the strong feeling that the performance could be much better.
Let's assume a pretty basic setup for a Plone site:
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName www.example.com
CustomLog /var/log/httpd/vhost-example.log combined
ErrorLog /var/log/httpd/vhost-example.error.log
RewriteEngine on
DocumentRoot /opt/zope/instances/example/htdocs
ErrorDocument 502 /error-500.html
ErrorDocument 503 /error-500.html
RewriteEngine On
RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/%{HTTP_HOST}:80/example/VirtualHostRoot/$1 [L,P]
</VirtualHost>
In this setup, almost everything is done by the Zope server, listening to port 8080
, which runs the Plone site in the virtual folder /example
(which lives in the object database).
Now this server provides some static resources, e.g. images and stylesheets (which live in the filesystem), and some pseudo-static resources, like compilations of scripts or stylesheets with a timestamped name (which don't have a filesystem location).
Some static resources have paths which give hints where the physical resource is located (e.g. /++resource++browsername/name-of-script.js
, where browsername
is the hint); others are taken from so-called skins (i.e. from the first skin which contains them), with no easy way to tell the filesystem location from the skin name (which would not be known from the response anyway).
Such requests would not need to be handled by the underlying Zope server, using one of its threads. What are the recommended strategies to keep away from Zope what Apache could do itself (more efficiently, and without blocking Zope's threads), and to cache contents?
So, a complete solution might include
- mapping of distinct paths of static resources to known file system location, where possible
- trying several locations for static resources which are taken from skins
- caching of generated resources (e.g. HTML pages, or compilations of CSS or Javascript)
and, with ZEO setup,
- load balancing (distribution of requests to a number of ZEO clients which in turn talk to the ZEO server)
Any configuration guides anywhere?