系统环境: CentOS release 6.8 8核16G
使用的服务:nginx+uwsgi+celery+redis+mysql+mongo
由于业务的需要,升级到16核32G, 升级后启动服务报错:can't start new thread。开始一直以为是程序的问题, 经过各种搜索,修改,问题依旧。 后来发现原来是系统设置的问题, 我们是在非root用户下启动的服务。root用户下的max user processes参数的值为10240, 而我们运行程序的用户下max user processes参数的值为1024。 具体设置参考:https://blog.csdn.net/mensuo1111/article/details/40187745。 调大max user processes值后问题解决。