Enabling GZIP compression in Tomcat

We advise using a NGINX proxy instead - it’s easier to configure and maintain. See Serving QueueMetrics through a NGINX proxy

You can speed up the serving of QueueMetrics pages over a WAN by transparently compressing the page before being sent; it will be transparently decompressed by your browser. As QueueMetrics pages (especially large tables) are highly redundant, this technique can buy large improvements in the user experience at a cost of some CPU time on the server.

Prerequisites

  • A working QueueMetrics instance

Changes to Tomcat

Edit the 'server.xml' file under 'tomcat/config'; locate the HTTP connector instance (the one that shows port 8080) and change it as follows:

<Connector port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true"

    compression="on"
    compressionMinSize="2048"
    noCompressionUserAgents="gozilla, traviata"
    compressableMimeType="text/html,text/xml"
/>

Restart QueueMetrics.

Changes to QueueMetrics

None required.