-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
etcdserver: runtime.FDUsage() function high CPU usage, create large numbers of objects #11969
Comments
I think that FDUsage ticker set to 1 hour is enough. and I send a PR for it #11986 |
@cfc4n Just for my understanding, can you please clarify why do we say 1 hour is enough? |
Closer look at FDUsage() reveals that it sorts the os.FileInfo's before returning.
Note: -1 is passed to f.Readdir
so that runtime.FDUsage() can specify upper bound to the number of entries retrieved. |
If |
Lines 200 to 202 in 49f91d6
It just a lg.Warn notice. It will not affect the execution of the program.It can give a notic by ticker of 1 hour. |
I don't think so about So, I think |
tailscale folks had the same issue, please see how they fixed it here: tailscale/tailscale#2785 |
version
etcd Version: 3.3.17
Git SHA: 6d80523
Go Version: go1.12.9
Go OS/Arch: linux/amd64
issue
/proc/self/fd
in the etcd process.monitorFileDescriptor
function will execute theruntime.FDUsage()
function per 5 seconds.runtime.FDUsage
function scans all directories and files under/proc/self/fd
and returns[]os.FileInfo
.result:
solution:
FDUsage
and cancel the comparison with thesyscall.Rlimit
. Error message that depends on fd operation failure.@gyuho @xiang90 @jpbetz @jingyih @spzala
The text was updated successfully, but these errors were encountered: