documentation:performance
This is an old revision of the document!
Optimizing the performance of your Evergreen server
Apache server optimization
There are a number of steps you can follow to optimize your Apache server.
- Enable mod_deflate to send compressible content over the network in gzipped format:
a2enmod deflate # on Debian or Ubuntu
- Edit /etc/apache2/mods-enabled/deflate.conf to add CSS and JavaScript to the set of file types that will be compressed:
<IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript </IfModule>
- Cache content that does not change often using the mod_expires Apache module. You can set some simple caching rules in /etc/apache2/sites-enabled/eg.conf:
ExpiresActive On # Set default expiry time to one month - we could probably make this 6 months ExpiresDefault "access plus 1 month" ExpiresByType text/html "access plus 25 hours" ExpiresByType application/xhtml+xml "access plus 25 hours"
- Requires Evergreen 1.6 or higher: Parallelize the requests to your server using multiple hosts. Most browsers will send a maximum of 2 to 4 concurrent requests to the same hostname, and as Evergreen pages pull in a lot of CSS, JavaScript, and image files, this can result in some unpleasant loading delays. A simple workaround is to set up CNAME entries to point multiple hostnames at the same IP address, but be warned that unless you have a valid wildcard SSL certificate, your users may have an unpleasant experience if they try to log in to their account.
- Set up hostnames to serve your JavaScript, CSS, and image files separately from your core content. If "library.example.org" is your primary hostname, you could set up "js.example.org", "css.example.org", and "images.example.org" as hostnames that point to the same IP address as "library.example.org". Then, edit /etc/apache2/eg_vhost.conf to set the environment variables for the various included files as follows:
<LocationMatch /opac/> ... other stuff, snipped SetEnvIf Request_URI ".*" OILS_OPAC_BASE=/opac/ # This gives you the option to configure a different host to serve OPAC images from # Specify the hostname (withouth protocol) and path to the images. Protocol will # be determined at runtime SetEnvIf Request_URI ".*" OILS_OPAC_IMAGES_HOST=images.example.org/opac/ SetEnvIf Request_URI ".*" OILS_OPAC_CSS_HOST=css.example.org/opac/ SetEnvIf Request_URI ".*" OILS_OPAC_JS_HOST=js.example.org/opac/ </LocationMatch>
documentation/performance.1255843081.txt.gz · Last modified: 2022/02/10 13:33 (external edit)