[initandListen] pthread_create Failed: errno:11 Resource temporarily unavailable[initandListen] can't create new thread,closing connection
我得出的结论是,我需要提高1024的“ulimit -u”或“Max processes”设置,并且在使用web前端时(不确定如何检查),用量可能超过了.
我编辑了/etc/security/limits.conf来添加最后两行(前两行已经存在):
* soft nofile 350000* hard nofile 350000* soft nproc 30000* hard nproc 30000
然后我重新启动了系统(BTW我应该这样做,还是应该重启mongod服务?)
重启后,查看mongod进程的进程限制,似乎忽略了软限制:
$cat /proc/2207/limitslimit Soft limit Hard limit UnitsMax cpu time unlimited unlimited secondsMax file size unlimited unlimited bytesMax data size unlimited unlimited bytesMax stack size 8388608 unlimited bytesMax core file size 0 unlimited bytesMax resIDent set unlimited unlimited bytesMax processes 1024 30000 processesMax open files 350000 350000 filesMax locked memory 65536 65536 bytesMax address space unlimited unlimited bytesMax file locks unlimited unlimited locksMax pending signals 273757 273757 signalsMax msgqueue size 819200 819200 bytesMax nice priority 0 0Max realtime priority 0 0Max realtime timeout unlimited unlimited us$whoamimongod$ulimit -acore file size (blocks,-c) 0data seg size (kbytes,-d) unlimitedscheduling priority (-e) 0file size (blocks,-f) unlimitedpending signals (-i) 273757max locked memory (kbytes,-l) 64max memory size (kbytes,-m) unlimitedopen files (-n) 350000pipe size (512 bytes,-p) 8POSIX message queues (bytes,-q) 819200real-time priority (-r) 0stack size (kbytes,-s) 8192cpu time (seconds,-t) unlimitedmax user processes (-u) 1024virtual memory (kbytes,-v) unlimitedfile locks (-x) unlimited
根据/etc/security/limits.conf文件,我预计“最大处理”硬限制和软限制将在30000,但只有硬盘限制.
我究竟做错了什么?
我在AWS EC2上运行Amazon linux.
bash-4.1$cat /etc/*-releaseAmazon linux AMI release 2012.09解决方法 检查文件/etc/security/limits.d/90-nproc.conf,因为这可能会覆盖您的设置.去年 http://scott.cm/max-processes-1024-limits-conf/我写过这个完全相同的问题 总结
以上是内存溢出为你收集整理的linux – /etc/security/limits.conf软nproc限制似乎被忽略全部内容,希望文章能够帮你解决linux – /etc/security/limits.conf软nproc限制似乎被忽略所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)