ASA Database Administration Guide
Client/Server Communications
Enabling compression for one or all connections, as well as setting the minimum size at which packets are compressed can significantly improve Adaptive Server Anywhere performance in some circumstances.
To determine if enabling compression will help in your particular situation, we recommend that you conduct a performance analysis on your particular network and using your particular application before using communication compression in a production environment. Performance results will vary according to the type of network you are using, your applications, and the data you transfer.
The most basic way of tuning compression is as simple as enabling or disabling the Compression (COMP) connection parameter on either a connection or server level. More advanced methods of fine tuning compression performance include adjusting the CommBufferSize (CBSIZE) and/or the CompressionThreshold (COMPT) connection parameters.
Enabling compression increases the quantity of information stored in data packets, thereby reducing the number of packets required to transmit a particular set of data. By reducing the number of packets, the data can be transmitted more quickly.
For more information about performance analysis, see Performance Monitor statistics, or sa_conn_compression_info system procedure.
Enabling compression for a connection (or all connections) can significantly improve Adaptive Server Anywhere performance under some circumstances, including:
when used over slow networks such as some wireless networks, some modems, serial links and some WANs.
when used in conjunction with Adaptive Server Anywhere encryption over a slow network with built-in compression, since packets are compressed before they are encrypted.
Enabling compression, however, can sometimes also cause slower performance. For instance,
communication compression uses more memory and more CPU. It may cause slower performance, especially for LANs and other fast networks.
most modems and some slow networks already have built-in compression. In these cases, Adaptive Server Anywhere communication compression will not likely provide additional performance benefits unless you are also encrypting the data.
For more information about compression, see Compress connection parameter [COMP], -pc server option.
While CommBufferSize (CBSIZE) is not a compression parameter in itself, adjusting this parameter can benefit compression, especially if you are transferring a large amount of data between a client and server. A larger packet size can improve performance for multi-row fetches and fetches of larger rows, as well as inserting or retrieving BLOBs.
As always, however, there are tradeoffs with performance improvements. Since each connection has its own pool of buffers, a large buffer size also increases the memory usage. Be sure to analyze your particular situation to make sure that the benefits of increasing the CommBufferSize outweigh the costs.
For more information see Tuning TCP/IP performance, the CommBufferSize connection parameter [CBSIZE], or the -p server option.
You can also adjust the compression threshold to improve Adaptive Server Anywhere performance. For most networks, the compression threshold does not need to be changed.
When compression is enabled, individual packets may or may not be compressed, depending on their size. For example, Adaptive Server Anywhere does not compress packets smaller than the compression threshold, even if communication compression is enabled. As well, small packets (less than about 100 bytes) usually do not compress at all. Since CPU time is required to compress packets, attempting to compress small packets could actually decrease performance.
Generally speaking, lowering the compression threshold value may improve performance on very slow networks, while raising the compression threshold may improve performance by reducing CPU usage. However, since lowering the compression threshold value will increase CPU usage on both the client and server, a performance analysis should be done to determine whether or not changing the compression threshold is beneficial.
For more information see CompressionThreshold connection parameter [COMPTH] and -pt server option.
To adjust Adaptive Server Anywhere compression settings
Enable communication compression.
Large data transfers with highly compressible data and larger packet sizes tend to get the best compression rates.
For more information about enabling compression, see Compress connection parameter [COMP] and -pc server option.
Adjust the CommBufferSize setting.
Increasing Adaptive Server Anywhere's packet size can improve compression performance.
For more information about adjusting the CommBufferSize setting, see CommBufferSize connection parameter [CBSIZE] or -p server option.
Adjust the CompressionThreshold setting.
Lowering the compression threshold value may improve performance on very slow networks, while raising the compression threshold may improve performance by reducing CPU usage.
For more information about adjusting the CompressionThreshold (COMPT) connection parameter, see CompressionThreshold connection parameter [COMPTH] and -pt server option.