mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Set buf size limit to 50% of max_pending
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -614,10 +614,10 @@ func (c *client) sendRouteUnSubProtos(subs []*subscription, filter func(sub *sub
|
||||
func (c *client) sendRouteSubOrUnSubProtos(subs []*subscription, isSubProto bool, filter func(sub *subscription) bool) bool {
|
||||
const staticBufSize = maxBufSize * 2
|
||||
var (
|
||||
_buf [staticBufSize]byte // array on stack
|
||||
buf = _buf[:0] // our buffer will initially point to the stack buffer
|
||||
mbs = staticBufSize // max size of the buffer
|
||||
mpMax = int(c.out.mp * 90 / 100) // 90% of max_pending
|
||||
_buf [staticBufSize]byte // array on stack
|
||||
buf = _buf[:0] // our buffer will initially point to the stack buffer
|
||||
mbs = staticBufSize // max size of the buffer
|
||||
mpMax = int(c.out.mp / 2) // 50% of max_pending
|
||||
closed bool
|
||||
)
|
||||
// We need to make sure that we stay below the user defined max pending bytes.
|
||||
|
||||
Reference in New Issue
Block a user