CME Performance guide

Page 27

10 Web Server Performance Issues Alterian recommend that a most web site performance issues will probably relates in some way to the issues discussed previously in this document. This is because the process that takes most time in rendering a web page is the dynamic element of redrawing that page using the database, ACM and Web application processes described above. However there are also aspects of the configuration of the web server that can also impact upon the performance of a site, particularly when observed from a distance. By default there is no compression of content within the Alterian and J2EE container configuration. Most modern browsers are capable of accepting compressed versions of HTTP objects and we can often reduce the network traffic by up to 70% by using this method, with the result that web pages are delivered more quickly to the browser, particularly if the browser is connecting over a slow or distant network connection. It is possible to compress content within Tomcat but this can be a rather costly process in terms of CPU. For this reason that best place to add HTTP compression is on the web server. Many clients will have a separate Linux server or servers that sit in a DMZ that is close to the internet but separated from the rest of the delivery architecture by a firewall. These web servers are generally underutilized in terms of the CPU power. This is because Apache is capable of delivering very high volumes of traffic from a relatively low powered server. And so it makes sense to utilize some of this spare CPU for compressing web content.

10.1

HTTP Compression with Apache

In order to add HTTP compression into an existing Apache configuration firstly add the following Output Filter to the bottom of the Apache https.conf file: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript

Secondly you should add the following directives, either below the line you have just added to httpd.conf, in which case all content matching this output filter will be compressed, or alternatively if you only wish to add compression for a particular web site then add the following lines to the virtual host configuration for that one web site. SetOutputFilter DEFLATE # Cater for issues with older browser types.. BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html # Don't compress images SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary # Make sure proxies don't deliver the wrong content Header append Vary User-Agent env=!dont-vary

Once you have restarted Apache then all content of the types matching the output filter will be compressed.

ACM Performance Guide

22 of 28


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.