sexta-feira, 14 de janeiro de 2022

net/http: Golang socket: too many open files

socket: too many open
filesulimit -a | grep open
ulimit -n 614400

/etc/security/limits.con/

        * soft nofile 614400
        * hard nofile 614400

    gouser soft nofile 614400
    gouser hard nofile 614400

/etc/sysctl.conf

    fs.file-max = 716800

And execute this command:

    /sbin/sysctl -p

Add to the end of the file /etc/profile:

    if [ $USER = "gouser" ]; then
        if [ $SHELL = "/bin/ksh" ]; then
            ulimit -p 16384
            ulimit -n 65536
        else
            ulimit -u 16384 -n 65536
        fi
    fi

Open a new terminal and execute:

    ulimit -n 614400

stop and start the golang process

Nenhum comentário:

Postar um comentário