reduce buffer pool size

This commit is contained in:
hebo 2019-12-06 16:09:36 +08:00
parent c83c5a1cc5
commit ee573a3bbc
3 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ type sliceBufferPool struct {
func NewSliceBufferPool(name string, bufferSize int) (sbp *sliceBufferPool) { func NewSliceBufferPool(name string, bufferSize int) (sbp *sliceBufferPool) {
return &sliceBufferPool{ return &sliceBufferPool{
queue: make(chan []byte, 512), queue: make(chan []byte, 256),
bufferSize: bufferSize, bufferSize: bufferSize,
name: name, name: name,
} }

View File

@ -34,7 +34,7 @@ const (
var ( var (
mqpp = NewMysqlQueryPiecePool() mqpp = NewMysqlQueryPiecePool()
localSliceBufferPool = NewSliceBufferPool("json cache", 2*1024*1024) localSliceBufferPool = NewSliceBufferPool("json cache", 1*1024*1024)
) )
var commonBaseQueryPiece = &BaseQueryPiece{} var commonBaseQueryPiece = &BaseQueryPiece{}

View File

@ -96,7 +96,7 @@ const (
// See https://dev.mysql.com/doc/refman/5.7/en/identifiers.html // See https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
const ( const (
// MaxMysqlPacketLen is the max packet payload length. // MaxMysqlPacketLen is the max packet payload length.
MaxMysqlPacketLen = 1 * 1024 * 1024 MaxMysqlPacketLen = 512 * 1024
) )
const ( const (