Opened 5 years ago

Closed 5 years ago

#12179 closed task (fixed)

Please configure sewerzowi's Tomcat or Apache to compress Onionoo's responses

Reported by: karsten Owned by:
Priority: Medium Milestone:
Component: Internal Services/Tor Sysadmin Team Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The following untested change to /etc/tomcat6/server.xml should turn on compression for JSON responses starting at 2KiB. (I took the opportunity to also changes "metrics" to "onionoo" in two places.)

                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false" redirectPort="8443" acceptCount="100"
                connectionTimeout="20000" disableUploadTimeout="true"
-               compression="off" compressionMinSize="2048"
+               compression="on" compressionMinSize="2048"
                noCompressionUserAgents="gozilla, traviata"
-               compressableMimeType="text/html,text/xml,text/plain" />
+               compressableMimeType="application/json" />
     <Engine name="Catalina" defaultHost="sewerzowi.torproject.org">
-      <Host name="metrics.torproject.org" appBase="webapps"
+      <Host name="onionoo.torproject.org" appBase="webapps"
             unpackWARs="true" autoDeploy="true"
             xmlValidation="false" xmlNamespaceAware="false">
         <Alias>sewerzowi.torproject.org</Alias>
         <Valve className="org.apache.catalina.valves.AccessLogValve"
-               directory="logs" prefix="metrics_access_log." suffix=".txt"
+               directory="logs" prefix="onionoo_access_log." suffix=".txt"
                pattern="%l %u %t %r %s %b" resolveHosts="false"/>
       </Host>
     </Engine>

If It's easier to compress responses in Apache, not in Tomcat, that's fine by me, too.

Child Tickets

Change History (1)

comment:1 Changed 5 years ago by weasel

Resolution: fixed
Status: newclosed

I appended to, rather than replaced, the existing compressableMimeType setting.

Note: See TracTickets for help on using tickets.