When should I use MySQL compressed protocol?

前端 未结 4 1311
花落未央
花落未央 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:25

    From my experience it's especially useful if you're connecting to an external MySQL server that resides in completely another network (or even country). The benefit you get from enabling compression in such cases depends on the size of the data you're transferring, and the distance between the client and the server. As always, you should test your application with and without compression, and then make a decision which is most beneficial for your situation. There's no absolute answer for this question.

    I don't see much point enabling compression if you query a MySQL server on same machine, or even on same network.

提交回复
热议问题