From 10402459d8de6cb01989bc3df0acd4eabab7572a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 12 Aug 2022 09:12:03 +0300 Subject: [PATCH] lib/vmselectapi: do not log connection accept/close from vmselect These log messages became too spammy in production clusters after the commit 190c8b463c206d04d731c1317ca25a833ae2482d , which closes idle connections from vmselect to vmstorage. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2508 --- lib/vmselectapi/server.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/vmselectapi/server.go b/lib/vmselectapi/server.go index e26c46811..6f851f009 100644 --- a/lib/vmselectapi/server.go +++ b/lib/vmselectapi/server.go @@ -129,7 +129,8 @@ func (s *Server) run() { } logger.Panicf("FATAL: cannot process vmselect conns at %s: %s", s.ln.Addr(), err) } - logger.Infof("accepted vmselect conn from %s", c.RemoteAddr()) + // Do not log connection accept from vmselect, since this can generate too many lines + // in the log because vmselect tends to re-establish idle connections. if !s.connsMap.Add(c) { // The server is closed. @@ -166,13 +167,8 @@ func (s *Server) run() { } defer func() { - if !s.isStopping() { - logger.Infof("closing vmselect conn from %s", c.RemoteAddr()) - } _ = bc.Close() }() - - logger.Infof("processing vmselect conn from %s", c.RemoteAddr()) if err := s.processConn(bc); err != nil { if s.isStopping() { return