::: Zany's Homepage ::: Zany Wiki | »çÀÌÆ® ÅëÇÕ °Ë»ö
 
 
 

[CentOS] max file descriptor ¼öÁ¤ (open files, max user processes)

°Ô½ÃÆÇ
Unix/Linux
ÀÛ¼ºÀÚ
helix
ÀÛ¼ºÀÏ
2017-08-29 17:12:04
ÀÐÀº¼ö
7317
ÆòÁ¡
   
Ç¥½Ã¿É¼Ç
HTML»ç¿ë | ÀÚµ¿BRűנ| °ø¹é¹®ÀÚÇã¿ë | °¡¿îµ¥Á¤·Ä | °íÁ¤Æø±Û²Ã | ÀÚµ¿URL¸µÅ© | ¸¶¿ì½º¼±ÅÃ
°ü·Ã¸µÅ©01
http://pro.benjaminste.in/post/318453669/increase-the-number-of-file-descriptors-on-centos 
¡Ü Centos ³ª Fedora °è¿­ ¸®´ª½º¿¡¼­ file descriptor ¼öÄ¡ ´Ã¸®±â

1. ulimit ¸í·ÉÀ¸·Î ÇöÀç ¼³Á¤Ä¡¸¦ È®ÀÎÇÑ´Ù.
[root@gold ~]# ulimit
unlimited

[root@gold ~]# 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) 11380
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) 11380       ¢¸¢¸¢¸¢¸
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
ÇöÀç root °èÁ¤ÀÌ ¿­ ¼ö ÀÖ´Â ÆÄÀÏÀÇ °³¼ö´Â 1024 °³·Î Á¦ÇѵǾî ÀÖ°í,
»ç¿ëÀÚ ÃÖ´ë ÇÁ·Î¼¼½º °³¼ö´Â 11,380 °³·Î Á¦ÇѵǾî ÀÖ´Ù.
linux lsof (list open files) ¸í·ÉÀ¸·Î
¾î¶² »ç¿ëÀÚ°¡ ÆÄÀÏÀ» ¾ó¸¶³ª ¿­¾ú´ÂÁö, ¾î¶² ÇÁ·Î¼¼½º°¡ ÆÄÀÏÀ» ¾ó¸¶³ª ¿­¾ú´ÂÁö È®ÀÎ °¡´ÉÇÏ´Ù.


2. /etc/sysctl.conf ÆÄÀÏ¿¡ fs.file-max ȯ°æ°ª Ãß°¡
[root@gold ~]# cat /proc/sys/fs/file-max
ÇöÀç file-max ¼öÄ¡ Ç¥½ÃµÊ.
[root@gold ~]# vi /etc/sysctl.conf

¾Æ·¡ ³»¿ë Ãß°¡.

# forces the limit to 512000 files.
fs.file-max = 512000


3. /etc/sysctl.conf ÆÄÀÏ ´Ù½Ã ·Îµå
[root@gold ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
fs.file-max = 512000
¡Ü sysctl : -p ¿É¼Ç
-p   Load in sysctl settings from the file(s) specified or /etc/sysctl.conf if none given.
     Specifying - as filename means reading data from standard input.
[root@gold ~]# cat /proc/sys/fs/file-max
512000


4. /etc/security/limits.conf ÆÄÀÏ ÆíÁý
[root@gold ~]# vi /etc/security/limits.conf

¾Æ·¡ ³»¿ë Ãß°¡

# for any account
*                soft    nproc           8192
*                hard    nproc           8192
*                soft    nofile          8192
*                hard    nofile          8192

# for 'zany' account
zany             soft    nproc           65535
zany             hard    nproc           65535
zany             soft    nofile          65535
zany             hard    nofile          65535


5. /etc/security/limits.d/90-nproc.conf ÆÄÀÏ ÆíÁý
[root@gold ~]# vi /etc/security/limits.d/90-nproc.conf

¾Æ·¡ ³»¿ë Ãß°¡

# for 'zany' account
zany       soft    nproc     65535
zany       hard    nproc     65535

zany       soft    nofile    65535
zany       hard    nofile    65535


6. sshd Àç±âµ¿ ÈÄ ÀçÁ¢¼Ó Çϰųª ½Ã½ºÅÛ ¸®ºÎÆ®
[root@gold ~]# service sshd restart
sshd ¸¦ Á¤Áö Áß:                                           [  OK  ]
sshd (À»)¸¦ ½ÃÀÛ Áß:                                       [  OK  ]

SSH ÀçÁ¢¼Ó...
¶Ç´Â ½Ã½ºÅÛ Àç±âµ¿...
ÀÌÈÄ..


7. È®ÀÎ
zany °èÁ¤Àº /etc/security/limits.conf ÆÄÀÏ¿¡ º°µµ·Î 65536 À» ÁöÁ¤ÇØ ÁÖ¾úÀ¸¹Ç·Î
open files Ç׸ñ°ªÀÌ 65536 ÀÎ °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
[zany@gold ~]$ 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) 11380
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65535        ¢¸¢¸¢¸¢¸
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) 65535        ¢¸¢¸¢¸¢¸
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
root °èÁ¤Àº /etc/security/limits.conf ÆÄÀÏÀÇ * ¿¡ ÇØ´çµÇ¹Ç·Î
open files Ç׸ñ°ªÀÌ 8192 ÀÎ °ÍÀ» È®ÀÎÇÒ ¼ö ÀÖ´Ù.
[root@gold ~]# 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) 11380
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 8192        ¢¸¢¸¢¸¢¸
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) 8192        ¢¸¢¸¢¸¢¸
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

 °Ô½ÃÆÇ ±Û ¸ñ·Ï
No Subject Poster Hits Posted
14217 helix 1607 2017-11-01 10:53:10
14216 helix 1220 2017-10-31 09:47:35
14214 helix 1590 2017-10-27 14:51:25
14213 helix 2312 2017-10-27 14:42:21
14201 helix 7432 2017-08-29 18:06:12
helix 7317 2017-08-29 17:12:04
14199 helix 1397 2017-08-28 14:24:01
14198 helix 2847 2017-08-28 13:01:58
14194 helix 5531 2017-08-21 15:25:16
14167 helix 3816 2017-07-31 15:04:22
14150 helix 1827 2017-07-07 11:18:02
ÄÚ¸àÆ®
ÀÛ¼ºÀÚ
                       
 
zany.kr
  Copyright ¨Ï 2002-2010 Zany's Programming Lab. All Rights Not Reserved.
temporary This Page loads on 0.031 Secs