Skip to content

Commit 1f8a725

Browse files
committed
Show number of goroutines if reaches max clients
Need it to reveal info about the workload.
1 parent d7ca4c9 commit 1f8a725

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dnscrypt-proxy/proxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ func (proxy *Proxy) udpListener(clientPc *net.UDPConn) {
442442
packet := buffer[:length]
443443
if !proxy.clientsCountInc() {
444444
dlog.Warnf("Too many incoming connections (max=%d)", proxy.maxClients)
445+
dlog.Debugf("Number of goroutines: %d", runtime.NumGoroutine())
445446
proxy.processIncomingQuery(
446447
"udp",
447448
proxy.mainProto,
@@ -469,6 +470,7 @@ func (proxy *Proxy) tcpListener(acceptPc *net.TCPListener) {
469470
}
470471
if !proxy.clientsCountInc() {
471472
dlog.Warnf("Too many incoming connections (max=%d)", proxy.maxClients)
473+
dlog.Debugf("Number of goroutines: %d", runtime.NumGoroutine())
472474
clientPc.Close()
473475
continue
474476
}

0 commit comments

Comments
 (0)