Bug #119715 Connection compression for MySQL Classic should include reference to net_buffer_length
Submitted: 18 Jan 13:14
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:8.4, 9.5 OS:Any
Assigned to: CPU Architecture:Any
Tags: compression, net_buffer_length, zlib, zstd

[18 Jan 13:14] Daniël van Eeden
Description:
The compressed version of the classic MySQL protocol uses `net_buffer_length`.

This is by default set to 16384.

The result is that a large result set with the compressed protocol results in:
- Compressed Packet 1 of size 16384
- Compressed Packet 2 of size 33679 (varies on the actual resultset)
- Compressed Packet 3 of size 11 (varies)

With a larger `net_buffer_length` the resultset is send in a single packet.

How to repeat:
1. Use MySQL Client with the classic protocol and zlib or zstd enabled.
2. Run something with a large resultset: `SELECT * FROM very_large_table`
3. Observe the number of compressed packets in Wireshark. Especially the size of the first packet.

And then run the same but with a larger `net_buffer_length`.

Suggested fix:
- Add information to the description of `net_buffer_length` on how it affects compression
- Add information to the pages describing compression on how `net_buffer_length` affects this.
- Update the protocol docs to include info about `net_buffer_length`.
- Consider changing how `net_buffer_length` works with compression to avoid sending multiple packets.