MongDB Æô¶¯¾¯¸æ WARNING: soft rlimits too low
# mongo
MongoDB shell version: 3.0.2
connecting to: test
Server has startup warnings:
2015-05-09T12:34:19.688-0700 I CONTROL [initandlisten]
2015-05-09T12:34:19.688-0700 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.
>
mongodbµ±Ç°ÏÞÖÆ£º1024 processes, 64000 files
mongodb½¨ÒéÒªÇó£ºprocesses = 0.5*files=32000£¨ÖÁÉÙ£©
ËùÒÔÐèÒª½« processes ´Ó1024 ¸ÄΪ 32000 »ò¸ü´ó.
²é¿´µ±Ç°mongodb½ø³ÌÐÅÏ¢£º
[root@localhost ~]# ps -ef | grep mongod
- mongod 24283 1 0 12:35 ? 00:00:04 /usr/bin/mongod -f /etc/mongod.conf
- root 24240 22049 0 12:45 pts/2 00:00:00 grep mongod
[root@localhost ~]# cat /proc/24283/limits
#¿ÉÒÔ¿´µ½ÏÞÖÆ£ºMax processes£¬Max open files
- Limit Soft Limit Hard Limit Units
- Max cpu time unlimited unlimited seconds
- Max file size unlimited unlimited bytes
- Max data size unlimited unlimited bytes
- Max stack size 10485760 unlimited bytes
- Max core file size 0 unlimited bytes
- Max resident set unlimited unlimited bytes
- Max processes 1024 32000 processes
- Max open files 64000 64000 files
- Max locked memory 65536 65536 bytes
- Max address space unlimited unlimited bytes
- Max file locks unlimited unlimited locks
- Max pending signals 14833 14833 signals
- Max msgqueue size 819200 819200 bytes
- Max nice priority 0 0
- Max realtime priority 0 0
- Max realtime timeout unlimited unlimited us
ÐÞ¸Ä Max processes »òÕß files £¬Óм¸ÖÖ·½·¨£º
·½·¨Ò»£º
ÐÞ¸ÄÅäÖÃÎļþ /etc/security/limits.d/90-nproc.conf
[root@localhost ~]# vi /etc/security/limits.d/90-nproc.conf
- * soft nproc 1024
- ¸ÄΪ:
- * soft nproc 32000
ÖØÆô mongod ·þÎñ£º
[root@localhost ~]# service mongod restart
·½·¨¶þ£º
ÐÞ¸ÄÅäÖÃÎļþ /etc/security/limits.conf£¬Ìí¼ÓÅäÖÃÐÅÏ¢£º
[root@localhost ~]# vi /etc/security/limits.conf
- mongod soft nofile 64000
- mongod hard nofile 64000
- mongod soft nproc 32000
- mongod hard nproc 32000
ÖØÆô mongod ·þÎñ£º
[root@localhost ~]# service mongod restart
Ò²¿ÉÒԲ鿴 limits.conf ¸ü¶àÅäÖÃÐÅÏ¢ºÍʹÓ÷½·¨£º
[root@localhost ~]# man limits.conf
²é¿´ÏµÍ³ÏÞÖÆ£º
[root@localhost ~]# 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) 14833
- max locked memory (kbytes, -l) 64
- max memory size (kbytes, -m) unlimited
- open files (-n) 1024
- 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) 14833
- virtual memory (kbytes, -v) unlimited
- file locks (-x) unlimited
mongodbÍƼöÉèÖãº
- -f (file size): unlimited
- -t (cpu time): unlimited
- -v (virtual memory): unlimited
- -n (open files): 64000
- -m (memory size): unlimited
- -u (processes/threads): 64000
Ö±½ÓÔÚµ±Ç°shellÖÐÉèÖãºulimit -n <value>
- ulimit -f unlimited
- ulimit -t unlimited
- ulimit -v unlimited
- ulimit -n 64000
- ulimit -m unlimited
- ulimit -u 64000
ÈôҪϵͳÆô¶¯Ê±ÔÚËùÓÐÉúЧ£¬½«ÉÏÃæµÄ ulimit Ìí¼Óµ½ /etc/profile
[root@localhost ~]# vi /etc/profile
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ