# 看目前系統設定的限制 (ulimit -a # 可查看全部參數)
- z$ t( i# |% `ulimit -n % l! ^, N9 a0 W8 [
1024
$ g/ ~2 l% x5 r, z$ |( R8 f- y- Z( L s% s4 Z
0 m9 d5 P' h% u& z/ j# 由 limits.conf 設定 nofile (nofile - max number of open files) 的大小
6 R" d3 @1 s% r8 Gvim /etc/security/limits.conf 2 b3 g7 ^7 A8 S4 V& j; q
& x7 u' Q- m i0 |; a$ ?
- L. A2 k, V( _( L9 S# 增加/修改 下述兩行 ( 2^20 = 1048576 )9 l2 O7 N0 e3 G( s
* soft nofile 1048576, q& s2 |+ ?/ p) B" Y
* hard nofile 1048576
4 ?$ ~* Z# ]8 B7 T ]- r+ Z, I( s. i0 D/ L, a
& Y) i% f5 G; ~7 J" I V& X2 g/ ?# 登出後, 再登入, 執行就會出現此值
- K9 A [$ U# T% f& B- vulimit -n 5 P3 g! Y z4 V
1048576 d# H' U9 p( M" Z
若 ulimit -n 沒出現 1048576 的話, 可使用強制設定6 p, y$ d* Z4 B; ]
( i, W H" T5 Q1 D
7 @$ _$ {' |1 p. mulimit -n 1048576
+ i I1 a% d/ p* Y! n5 }/ H0 M" B0 o% V
) s8 z/ d8 a* s" u. \+ K
# 再檢查設定
" ?4 S( E& [1 Q, sulimit -n7 a5 Y' C9 J3 @: j/ O- G6 U7 N
1048576
. X3 g; |9 H0 k& k2 \. w9 R |
|