backport of commit 5bd8b89c19c71e19ad0a1abc9b35de9abb4d2cc3 (#18525)
Co-authored-by: Tim Gross <tgross@hashicorp.com>
This commit is contained in:
parent
27f53350ff
commit
5a0a54a715
|
@ -0,0 +1,3 @@
|
|||
```release-note:improvement
|
||||
template: reduce memory usage associated with communicating with the Nomad API
|
||||
```
|
|
@ -24,7 +24,10 @@ type BufConnWrapper struct {
|
|||
// New returns a new BufConnWrapper with a new bufconn.Listener. The wrapper
|
||||
// provides a dialer for creating connections to the listener.
|
||||
func New() (net.Listener, *BufConnWrapper) {
|
||||
ln := bufconn.Listen(1024 * 1024)
|
||||
// this buffer is sized to accept a maximum-sized Nomad Variable payload
|
||||
// (64k) with plenty of room to spare for the metadata and envelope, in a
|
||||
// single read
|
||||
ln := bufconn.Listen(1024 * 100)
|
||||
return ln, &BufConnWrapper{listener: ln}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue