Using Message Compression

The Solace Message Platform allows client applications connected to a Solace router to send and receive compressed message data. When the use of channel compression is enabled on the router and for the session that the client application has established to the router, messages sent from both the router and the client application are compressed before transmission, and they are decompressed when received by the client application or the router.\

Note:  Message compression is only available on plain-text over SMF client connections to a router (the default); message compression is not available on Transport Layer Security (TLS)/ Secure Sockets Layer (SSL) client connections (that is secure/encrypted client connections) to a router. For information on TLS/SSL service, refer to Managing TLS/SSL Service.

Configuring Message Compression for Data Connections

To use the message compression facility, you must perform the following steps:

  1. Configure a TCP listen port for clients to connect to for sending and receiving compressed message data.

    By default, the router listens for non-compressed connections on TCP port 55555 and for compressed connections on TCP port 55003. The listen ports are fully configurable, but the non-compressed and compressed ports must be different because the router cannot listen for both compressed and non‑compressed connections on the same TCP port. For information, refer to Managing Services.

  2. Configure whether you want the Solace router to compress the data to optimize the size of transmitted messages or to optimize the speed at which messages are delivered.

    Refer to Configuring the Data Compression Optimization Mode.

  3. On the client side, enable channel compression for the sessions that clients use to establish connections to the router.

    For information on how to enable message compression for a client session, refer to Enabling Channel Compression for a Session for Solace enterprise messaging APIs. For the Solace JMS API, the compression level is set through a JNDI or Data Connection property (refer to JMS Properties Reference).

Configuring the Data Compression Optimization Mode

When a TCP listen port is configured to use compression, you can configure whether you want the Solace router to compress the data in egress messages so that it is optimized for size or for transmission speed. In general, the optimized‑for-size mode yields a higher compression ratio with lower throughput, while optimized-for-speed mode yields a higher throughput with lower compression ratio.

To configure the compression facility to compress the data to optimize the size of transmitted messages or to optimize the speed at which messages are delivered, enter the following Global CONFIG command:

solace(configure)# compression [mode]

Where:

mode is the compression mode to use. The two possible values are optimize‑for‑size (the default value) or optimize-for-speed.

Note:  While the compression level setting in the Solace messaging APIs can have a dramatic effect on the speed and level of compression achieved for published messages sent to the router, message data sent from the router is compressed in hardware that provides compression comparable to the most aggressive level offered by the APIs without sacrificing speed. Thus, the effect of the compression mode setting on the router is minimal for most situations.

Monitoring Message Compression on Routers

You can use several show commands to validate and monitor message compression configuration and status on Solace routers:

Show Client Connections

To view whether a particular client is compressed or not, enter the following User EXEC command:

solace> show client <name> connections

Where:

<name> is the full name of the client, or part of the client name with the wildcard character ? used to represent one character of the name, or the wildcard character * used to represent zero or more characters of the name, where entering only the wildcard character * for the name displays all clients.

Show Client Stats Detail

To view the compression statistics for a particular clients, enter the following User EXEC command:

solace> show client <name> stats detail

Where:

<name> is the full name of the client, or part of the client name with the wildcard character ? used to represent one character of the name, or the wildcard character * used to represent zero or more characters of the name, where entering only the wildcard character * for the name displays all clients.

Example:

solace> show client #00010001 stats detail

The output then includes (among other statistics):

 

******************** Compression/Decompression Statistics ******************

 

                                              Received                   Sent

                                  --------------------   --------------------

Compressed Bytes                               1265052                    221

Uncompressed Bytes                             4012610                    292

Compression Ratio                                 3.17                   1.32

 

                                    Ingress (bytes/sec)    Egress (bytes/sec)

                                   -------------------- --------------------

Compressed Rate (1 sec)                            1050                     0

Uncompressed Rate (1 sec)                        100506                     0

Compressed Rate (60 sec)                           6292                     0

Uncompressed Rate (60 sec)                        15401                     0

 

The following table describes the compression statistics.

Compression Statistics

Statistic

Description

Compressed Bytes

The amount of compressed data (measured in bytes) received and sent by the router.

Uncompressed Bytes

The amount of uncompressed data (measured in bytes) handled by the router.

The statistic encompasses both uncompressed and compressed data, however the compressed data is measured after it is uncompressed.

Compression Ratio

The ratio of uncompressed bytes/compressed bytes for data that is handled by the router.

Compressed Rate (1 sec sample)

The calculated byte rate based on “Compressed Bytes” at a one second sample interval.

Uncompressed Rate (1 sec sample)

The calculated byte rate based on “Uncompressed Bytes” at a one second sample interval.

Compressed Rate (60 sec sample)

The calculated byte rate based on “Compressed Bytes” at a 60 second sample interval.

Uncompressed Rate (60 sec sample)

The calculated byte rate based on “Unshow compressed Bytes” at a 60 second sample interval.

Show Compression

To view the compression configuration and statistics on a Solace router, enter the following User EXEC command:

solace(configure)# show compression

Example:

solace(configure)# show compression

 

Compression Mode: optimize-for-size

 

Work queue depth

    Current:         0

    High Water Mark: 2

 

Error count

    Compression:     0

    Decompression:   0

Note:   

  • The “Work queue depth” reflects outstanding compression/decompression requests. The “Current” reflects the number of requests currently held in the queue. The “High Water Mark” reflects the highest number of requests held in the queue since the last clearing of statistics through the clear compression stats Privileged EXEC command.
  • The number of bytes to be compressed/decompressed in a compression/decompression request varies on a per request basis.

Clear Compression Stats

To clear the current compression statistics, enter the following Privileged EXEC command:

solace# clear compression stats

When this command is entered, all of the compression statistic counters are reset to 0, and compression statistics begin to be recorded again from this point.

Show Service

To view the TCP listen ports for used by the router, enter the following User EXEC command:

solace(configure)# show service