Skip to content

Commit

Permalink
etcdserver:FDUsage set ticker to 10 minute from 5 seconds. This ticke…
Browse files Browse the repository at this point in the history
…r 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 #11969 for more detail.
  • Loading branch information
cfc4n committed Jun 24, 2020
1 parent 37ac222 commit ee96347
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion etcdserver/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,13 @@ func init() {
}

func monitorFileDescriptor(lg *zap.Logger, 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()
Expand Down

0 comments on commit ee96347

Please sign in to comment.