prometheus / procfs

procfs provides functions to retrieve system, kernel and process metrics from the pseudo-filesystem proc.
Apache License 2.0
769 stars 319 forks source link

open /proc/stat: too many open files #585

Closed zkbaba closed 11 months ago

zkbaba commented 11 months ago

hello, i encountered a problem: "open /proc/stat: too many open files". How can I solve it? Thank you. code: var cpuInfo, _ = procfs.NewFS(procfs.DefaultMountPoint) stat1, err := cpuInfo.Stat() if err != nil { panic(err) }

BinSquare commented 11 months ago

your system has a limit on number of files open at the same time. For linux, you can up your ulimit https://ss64.com/bash/ulimit.html and/or identify if you have a leak via lsof https://www.redhat.com/sysadmin/analyze-processes-lsof

SuperQ commented 11 months ago

For questions/help/support please use our community channels. There are more people available to potentially respond to your request and the whole community can benefit from the answers provided.