HTTP data compression setup

Notes before installation

Oplon HTTP Data Compression compress data traffic to optimize bandwidth occupancy.

With Oplon Application Delivery Controller you can selectively compress individual contextualized data streams even for mime-types.

This document is for configuring the compression service only and using the filter rules of the balancing and routing component. For the installation of components Oplon S.A.A.I. reference the installation documents of the individual products.

Introduction

HTTP data compression is achieved through rewrite rules to have maximum expressiveness and flexibility of application.

Oplon Application Delivery Controller uses refined data compression parallelization core technology. Compression is then done by making the most of the parallelism of modern multicore and multithreaded CPUs by eliminating each synchronization point due to additional hardware outside the CPU.

Setup compression

Setting up compression in balancing and routing processes can be achieved by applying simple rewrite rules that affect and modify content.

The steps to follow are:

a) setting up the header rule

b) setting the body rule

c) activation on the desired flow of rules

The system already contains the rules to be able to compress the http/s bodies and simply pick them up from the templates and use them where necessary.

Setup compression - Header

ADC Settings > Rewrite management > Rewrite header rules > [search] compression

image1

In the example below, we're going to set the necessary rewrite rules first, and then apply them to data streams.

Data compression will occur in two times, verifying the ability to compress data, and then compressing body data.

This double step is necessary because Oplon Application Delivery Controller must first determine whether the client and server can perform compressed data processing, or whether the data is already compressed originally and therefore should not be compressed.

To perform body compression, simply copy the rule from the template to the ADC module where it will be used e.g.:

image2

Choosing the form to copy the rule to:

image3

Copy result:

image4

Save the change:

image5

To analyze the rule, simply go to edit and expand the panels:

image6

Let's save the change:

image7

image8

An important parameter is the compression threshold. It is important to compress only if the result is considerably improved. An improvement is defined as compression from 80% to 90%. These results can only be achieved with an object that is large enough and still larger than 2048 bytes. We recommend that you do not fall below the 2KB threshold.

Setup compression - Body

After you set up the rewrite rule, to determine whether you want to compress, you must set the rewrite rule to the Body that will induce compression while streaming the BODY.

ADC Settings > Rewrite management > Rewrite body rules > [search] compression

image9

To use the rule, simply copy it from the template into the form on which it should be applied:

image10

image11

The result will be as follows:

image12

To analyze the rule, simply enter Edit:

image13

image14

The rule below lists the application conditions such as the "RESPONSE" direction and the "200 ok" response code, and then the mime-types on which the compression will be performed. The rule also has two other parameters: CACHE_REDIM_FACTOR And CACHE_DIM_MAX.

These parameters are used by Oplon Application Delivery Controller to allocate memory spaces (COW copy on write) to perform compression. The parameter CACHE_REDIM_FACTOR is the widening factor of the buffer initially allocated for compression. CACHE_DIM_MAX is the maximum size in memory of the compressed object. After this size, a maximum compression size exceed error is reported.

Setup compression - Apply rules on streams

As with other rewrite rules once defined to be applied, you must associate them with the affected streams. The association is done by selecting the stream on which to apply the rules:

Example of application on all streams of the selected ADC form:

ADC Settings > Default rewrite rules > [rewriteHeaderRules] press Select Item

image15

Select the compressionHEADER rule

image16

Also, select ALWAYS as the operator so that this rule can run independently of other rules.

image17

Do the same for BODY rules

image18

The result should be similar to the following:

image19

You can also apply rules to collection-specific streams, such as on all resources in a group:

ADC Settings > ADCs > Edit > Endpoints grouping > See details

image20

Rewriting rules panel

image21

Or on all resources in a single domain:

image22

Rewriting rules domain panel:

image23

Or on the individual endpoint groups by going further into See details

image24

Endpoint rewrite rules panel:

image25

You can also apply the rule at a general level and disable it in some streams. For example, if we had set the rules on the general panel of the ADC module and wanted to disable them only for certain endpoints, this is possible with Operation (NOP).

image26

It is possible to have evidence of compression by analyzing traffic statistics. Database statistics report the in-bound and out-bound data of the two streams, highlighting the differences between what is received and what is transferred.