error: can't start new thread

前端 未结 8 1411
天涯浪人
天涯浪人 2020-12-01 12:31

I have a site that runs with follow configuration:

Django + mod-wsgi + apache

In one of user\'s request, I send another HTTP request to another service, and

8条回答
  •  醉酒成梦
    2020-12-01 12:37

    I was running on a similar situation, but my process needed a lot of threads running to take care of a lot of connections.

    I counted the number of threads with the command:

    ps -fLu user | wc -l

    It displayed 4098.

    I switched to the user and looked to system limits:

    sudo -u myuser -s /bin/bash

    ulimit -u

    Got 4096 as response.

    So, I edited /etc/security/limits.d/30-myuser.conf and added the lines:

    myuser hard nproc 16384

    myuser soft nproc 16384

    Restarted the service and now it's running with 7017 threads.

    Ps. I have a 32 cores server and I'm handling 18k simultaneous connections with this configuration.

提交回复
热议问题