Bug #42949 slave_compressed_protocol should have a compression level option
Submitted: 17 Feb 2009 23:28
Reporter: Gary Pendergast Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:6.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Tags: compression, replication

[17 Feb 2009 23:28] Gary Pendergast
Description:
slave_compressed_protocol should have a corresponding slave_compression_level option, to set how much the user wants the connection to be compressed. ie, a trade off between bandwidth and CPU overhead.

How to repeat:
NA
[18 Feb 2009 2:16] Mark Callaghan
I hardwired my builds to use level 1 rather than level 6 but making this configurable would be much nicer. The code is here. Change 'compress' to 'compress2' and you can pass the compression level as an argument.

byte *my_compress_alloc(const byte *packet, ulong *len, ulong *complen)
{
  byte *compbuf;
  *complen=  *len * 120 / 100 + 12;
  if (!(compbuf= (byte *) my_malloc(*complen,MYF(MY_WME))))
    return 0;                                   /* Not enough memory */
  if (compress((Bytef*) compbuf,(ulong *) complen, (Bytef*) packet,
               (uLong) *len ) != Z_OK)