[initandlisten] connection refused because too many open connections: 819 of 819

默北 mongodb 运维案例1 16,7242字数 856阅读2分51秒阅读模式

早上收到mongodb报警,无法连接。遂爬上服务器查看相关日志信息:

1.现象:文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

overcommit_memory文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

连接数达到819后无法再增加,mongodb无法正常提供服务。文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

2. 分析文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 257321
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 257321
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

显然不是系统限制的,mongodb最大连接数是20000,查看history信息,发现前次启动没有添加numactl --interleave=all参数。故而重新启动:文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

# numactl --interleave=all mongod --config /data/mongodb/mongodb.conf
顺道把下面参数也加上了
# echo 0 > /proc/sys/vm/zone_reclaim_mode
# echo 2 > /proc/sys/vm/overcommit_memory

mongodb的NUMA问题参加:https://www.ttlsa.com/html/1211.html文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

如需转载请注明出处: connection refused because too many open connections: 819 of 819 文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/ 文章源自运维生存时间-https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/

weinxin
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
默北
  • 本文由 发表于 05/08/2013 10:33:42
  • 转载请务必保留本文链接:https://www.ttlsa.com/mongodb/initandlisten-connection-refused-because-too-many-open-connections-819-of-819/
  • overcommit_memory
  • zone_reclaim_mode
评论  1  访客  0

    来自外部的引用

评论已关闭!