Using Streaming Compressed Connections
SolacePubSub+ allows client applications connected to an event broker to send and receive compressed message data. When the use of channel compression is enabled on the event broker and for the session that the client application has established to the event broker, messages sent from both the event broker and the client application are compressed before transmission, and they are decompressed when received by the client application or the event broker.
Configuring Streaming Compressed Connections for Data Connections
To use the streaming compressed connection facility, you must perform the following steps:
- Configure a TCP listen port for clients to connect to for sending and receiving compressed message data.
By default, the event broker listens for non-compressed connections on TCP port 55555, compressed connections on TCP port 55003, and compressed and encrypted connections on TCP port 55443. The listen ports are fully configurable, and for more information on configuration, see Services.
- Configure whether you want the event broker 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.
- On the client side, enable channel compression for the sessions that clients use to establish connections to the event broker.
For information on how to enable message compression for a client session, see Enabling Channel Compression for a Session for Solace messaging APIs. For the Solace JMS API, the compression level is set through a JNDI or Data Connection property (see 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 event broker to compress the data in egress messages so that it is optimized for size or for transmission speed. In general, the optimize-for-size mode yields a higher compression ratio with lower throughput, while optimize-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 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.
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 event broker, message data sent from the event broker 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 event broker is minimal for most situations.
Monitoring Streaming Compressed Connections
You can use several show commands to validate and monitor streaming compressed connection configuration and status on event brokers:
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.
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.
Statistic | Description |
---|---|
Compressed Bytes |
The amount of compressed data (measured in bytes) received and sent by the event broker. |
Uncompressed Bytes |
The amount of uncompressed data (measured in bytes) handled by the event broker. 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 event broker. |
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 an event broker, enter the following User EXEC command:
solace(configure)# show compression
solace(configure)# show compression Compression Mode: optimize-for-size Work queue depth Current: 0 High Water Mark: 2 Error count Compression: 0 Decompression: 0
- 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 event broker, enter the following User EXEC command:
solace(configure)# show service