mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
feature: log queue and buffer memory size configuration (#6591)
* feature: log queue and buffer memory size configuration Signed-off-by: chenyuliang5 <chenyuliang@jd.com>
This commit is contained in:
@@ -26,27 +26,29 @@ type tapper interface {
|
||||
|
||||
// dio implements the Tapper interface.
|
||||
type dio struct {
|
||||
endpoint string
|
||||
proto string
|
||||
enc *encoder
|
||||
queue chan *tap.Dnstap
|
||||
dropped uint32
|
||||
quit chan struct{}
|
||||
flushTimeout time.Duration
|
||||
tcpTimeout time.Duration
|
||||
skipVerify bool
|
||||
endpoint string
|
||||
proto string
|
||||
enc *encoder
|
||||
queue chan *tap.Dnstap
|
||||
dropped uint32
|
||||
quit chan struct{}
|
||||
flushTimeout time.Duration
|
||||
tcpTimeout time.Duration
|
||||
skipVerify bool
|
||||
tcpWriteBufSize int
|
||||
}
|
||||
|
||||
// newIO returns a new and initialized pointer to a dio.
|
||||
func newIO(proto, endpoint string) *dio {
|
||||
func newIO(proto, endpoint string, multipleQueue int, multipleTcpWriteBuf int) *dio {
|
||||
return &dio{
|
||||
endpoint: endpoint,
|
||||
proto: proto,
|
||||
queue: make(chan *tap.Dnstap, queueSize),
|
||||
quit: make(chan struct{}),
|
||||
flushTimeout: flushTimeout,
|
||||
tcpTimeout: tcpTimeout,
|
||||
skipVerify: skipVerify,
|
||||
endpoint: endpoint,
|
||||
proto: proto,
|
||||
queue: make(chan *tap.Dnstap, multipleQueue*queueSize),
|
||||
quit: make(chan struct{}),
|
||||
flushTimeout: flushTimeout,
|
||||
tcpTimeout: tcpTimeout,
|
||||
skipVerify: skipVerify,
|
||||
tcpWriteBufSize: multipleTcpWriteBuf * tcpWriteBufSize,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +75,7 @@ func (d *dio) dial() error {
|
||||
}
|
||||
|
||||
if tcpConn, ok := conn.(*net.TCPConn); ok {
|
||||
tcpConn.SetWriteBuffer(tcpWriteBufSize)
|
||||
tcpConn.SetWriteBuffer(d.tcpWriteBufSize)
|
||||
tcpConn.SetNoDelay(false)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user