Data compression within EntireX Broker allows you to exchange smaller packet sizes between clients and servers. This helps to reduce response time during transmissions as well as improve the overall network throughput, especially with low-bandwidth connections.
This document gives an overview of data compression in EntireX Broker. It includes the following topics:
See also: COMPRESSLEVEL
under Broker ACI Fields | Data Compression for client and server | publish and subscribe.
Compression is performed only on the
SEND
and RECEIVE
buffers. The client or server application has the option of setting the level
of compression/decompression for data transmission. The compression level can
be set to achieve either no compression or a range of
compression/decompression. If during a data transmission the data buffer does
not compress, a logged warning message 00200450 indicates that the data has not been compressed during
transmission.
Note:
The compression level is used to control compression only between the
application and the Broker kernel.
zlib is a general-purpose software implementing data compression across a variety of platforms. Version 1.1.4 of zlib is implemented starting with EntireX Broker version 7. The functions used within EntireX Broker represent a subset of those available within the zlib software.
The compression algorithms are implemented through the open source software zlib.
Compression of the data is implemented by the following components of EntireX:
Components | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Broker control block |
|
||||||||||
Stubs: Broker stub and Java stub | The behavior of the Broker stub and Java stub is identical with
respect to compression.
The logic of a client or server application sets the compress level
of the Broker control block when it issues the Note: |
||||||||||
Broker kernel | When a client or server application
SEND s the data to the Broker kernel, the application
specifies the level at which the kernel is to decompress the data.
When the client or server application issues the
|
The following graphic shows the sequencing of data compression within EntireX Broker:
Sample programs convClt
and convSrv
in directory examples/ACI/conversational/C can be used as an example of performing
compression/decompression. Using the -rn
option will
cause compression to be used at level <n>.
convSrv
can be instructed to use compression/decompression by
specifying, for example:
convSrv -7 -r4
-r4
: This will cause a
compression/decompression level of 4 to be used on all transmissions between
the server and the Broker.
-7
: The -7 that is needed as
compression/decompression is only supported at Version 7 or above.
convClt
can be instructed to use compression/decompression by
specifying, for example:
convClt -7 -r2
-r2
: This will cause a
compression/decompression level of 2 to be used on all transmissions between
the client and the Broker.
-7
: The -7 that is needed as
compression/decompression is only supported at Version 7 or above.
To test how well various types of data will compress, you can use the
option -g<filename>
.
You can use, for example, the following syntax to specify that input is to be
extracted from a pre-existing file, using the two arguments from above.
convClt -7 -r2 -gmyfile1.txt
This will read in myfile1.txt and send it to a
registered server. If convSrv
is the server, convSrv
will reverse the data sequence
and return the data.
convSrv -7 -r4 -gmyfile2.txt
This will write in myfile2.txt the data sent from the client.