When should I use MySQL compressed protocol?

前端 未结 4 1310
花落未央
花落未央 2020-12-10 10:39

I\'ve learned that MySQL can compress communication between servers and clients.

Compression is used if both client and server support zlib compress

4条回答
  •  半阙折子戏
    2020-12-10 11:32

    I know it's late, but I though I might share this:

    • Large result sets vs compression

    It turns out that 100 Mbit link (with 1.4 ms round-trip time) is not fast enough... With compression, total indexing time reduced to 87 sec from 127 sec. That’s almost 1.5x improvement in total run time. MySQL query time improvement is even greater. On the other hand 1 Gbit link was fast enough; and total run time was 1.2x times worse with compression.

    Unless your database and client are on the same machine, on 100 Mbits network and slower, enable the compression!

    However, your final decision might also to depend on the balance between the cost of CPU cycles (compress/decompress) and Bandwith usage (more data on the wire).

提交回复
热议问题