Our usage of this library is in an application that will maintain a few thousand active MySQL connections from a single instance and we've noticed that the application is holding a lot of memory in packet.Conn, specifically the bufio.Reader instances are holding about 500MB of the total 800MB heap.
This PR will allow our application to change the hardcoded 65536 buffer size to something more reasonable for our use case (maybe 4096), which should reduce our heap by at least 50%.
Our usage of this library is in an application that will maintain a few thousand active MySQL connections from a single instance and we've noticed that the application is holding a lot of memory in
packet.Conn
, specifically thebufio.Reader
instances are holding about 500MB of the total 800MB heap.This PR will allow our application to change the hardcoded
65536
buffer size to something more reasonable for our use case (maybe4096
), which should reduce our heap by at least 50%.