too many open files error

Hello ,

I am currently working for a company and one of our site is having little trouble. It is built in golang . I am facing this particular issue for over 3 months now. No matter what solution i’ve tried so far , it ends up failing. So the site is working fine , but somewhere due to the code there is some kind of leak which is causing open files not being closed and due to that server crashes and the site goes down until IT restarts. So i’ve so far tried to deal with “defer” and removed all the defer in code without return type. There is nothing we have not closed. Also increased server ulimit for soft and hard files . Still randomly site breaks down with “too many open file” error or “broken pipe” .

Here is the go env :

GO111MODULE=""

GOARCH=“amd64”

GOBIN=""

GOCACHE="/Users/juhi/Library/Caches/go-build"

GOENV="/Users/juhi/Library/Application Support/go/env"

GOEXE=""

GOFLAGS=""

GOHOSTARCH=“amd64”

GOHOSTOS=“darwin”

GONOPROXY=""

GONOSUMDB=""

GOOS=“darwin”

GOPATH="/Users/juhi/go/"

GOPRIVATE=""

GOPROXY=“https://proxy.golang.org,direct”

GOROOT="/usr/local/go"

GOSUMDB=“sum.golang.org

GOTMPDIR=""

GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"

GCCGO=“gccgo”

AR=“ar”

CC=“clang”

CXX=“clang++”

CGO_ENABLED=“1”

GOMOD=""

CGO_CFLAGS="-g -O2"

CGO_CPPFLAGS=""

CGO_CXXFLAGS="-g -O2"

CGO_FFLAGS="-g -O2"

CGO_LDFLAGS="-g -O2"

PKG_CONFIG=“pkg-config”

GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/z9/hr670btx0_gdq81bgc3q42w40000gn/T/go-build387581625=/tmp/go-build -gno-record-gcc-switches -fno-common"

P.S have also attached screenshot of the logs and the go version is : go version go1.13.4 darwin/amd64

and I have also tried putting “time-stamps” but that generated more error so we removed that.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.