From c4db372810431e6fedd26075d8fd61346528ebe2 Mon Sep 17 00:00:00 2001 From: cfc4n Date: Tue, 16 Jun 2020 12:44:33 +0800 Subject: [PATCH] etcdserver:FDUsage set ticker to 10 minute from 5 seconds. This ticker will check File Descriptor Requirements ,and count all fds in used. And recorded some logs when in used >= limit/5*4. Just recorded message. If fds was more than 10K,It's low performance due to FDUsage() works. So need to increase it. see https://github.com/etcd-io/etcd/issues/11969 for more detail. --- etcdserver/metrics.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/etcdserver/metrics.go b/etcdserver/metrics.go index 2fb07a55436..b3311a462e9 100644 --- a/etcdserver/metrics.go +++ b/etcdserver/metrics.go @@ -159,7 +159,13 @@ func init() { } func monitorFileDescriptor(done <-chan struct{}) { - ticker := time.NewTicker(5 * time.Second) + + // This ticker will check File Descriptor Requirements ,and count all fds in used. + // And recorded some logs when in used >= limit/5*4. Just recorded message. + // If fds was more than 10K,It's low performance due to FDUsage() works. + // So need to increase it. + // See https://github.com/etcd-io/etcd/issues/11969 for more detail. + ticker := time.NewTicker(10 * time.Minute) defer ticker.Stop() for { used, err := runtime.FDUsage()