{"id":1557,"date":"2006-11-21T10:39:00","date_gmt":"2006-11-21T10:39:00","guid":{"rendered":"http:\/\/gleamynode.net\/articles\/1557\/modifying-default-ulimit-values-for-a-normal-user-in-linux"},"modified":"2022-12-28T01:46:48","modified_gmt":"2022-12-27T16:46:48","slug":"modifying-default-ulimit-values-for-a-normal-user-in-linux","status":"publish","type":"post","link":"https:\/\/vault.motd.kr\/wordpress\/posts\/1557\/modifying-default-ulimit-values-for-a-normal-user-in-linux\/","title":{"rendered":"Modifying Default ulimit Values for a Normal User in Linux"},"content":{"rendered":"\n
Linux\uc5d0\uc11c \uc77c\ubc18 \uc0ac\uc6a9\uc790\uc758 default ulimit \uac12 \uc218\uc815<\/p>\n\n\n\n
The default value of ulimit -n<\/tt> (the maximum number of open file descriptors per process per user) is 1024 in Ubuntu Linux<\/a>. There\u2019s no problem with this default value in my daily life, but I start to get \u2018Too many open files\u2019 errors when I test the performance of server applications which accept from 1000 to tens of thousands client connections. A super user (root) can type a command like ulimit -n 10240<\/tt> to increase the default limit value, but a normal user can\u2019t. If you are at least a sudoer, you can resolve this problem by adding the following lines to \/etc\/security\/limits.conf<\/tt> file.<\/p>\n\n\n\n \uc81c\uac00 \uc0ac\uc6a9\ud558\uace0 \uc788\ub294 Ubuntu Linux<\/a>\uc758 ulimit -n<\/tt> (\ub3d9\uc2dc\uc5d0 \uc5f4 \uc218 \uc788\ub294 \ud30c\uc77c\uc758 \ucd1d \uc218)\uc758 \uae30\ubcf8\uac12\uc740 1024\uc785\ub2c8\ub2e4. \uc77c\uc0c1 \uc5c5\ubb34\ub97c \ubcf4\ub294\ub370\ub294 \uc804\ud600 \uc9c0\uc7a5\uc774 \uc5c6\uc9c0\ub9cc \uc11c\ubc84 \uc5b4\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ud14c\uc2a4\ud2b8\ud558\ub2e4 \ubcf4\uba74 \uc801\uac8c\ub294 1000\uac1c, \ub9ce\uac8c\ub294 \uc218\ub9cc \uac1c\uc758 \uc811\uc18d\uc744 \ud14c\uc2a4\ud2b8\ud574\uc57c \ud560 \uc77c\uc774 \uc0dd\uaca8 \u2018Too many open files\u2019 \uc5d0\ub7ec\ub97c \ubcfc \uc218\ubc16\uc5d0 \uc5c6\uc2b5\ub2c8\ub2e4. \uc218\ud37c \uc720\uc800 (root)\ub77c\uba74 ulimit -n 10240<\/tt>\uacfc \uac19\uc774 \uc785\ub825\ud558\uc5ec \uadf8 \uc81c\ud55c\uc744 \uc62c\ub9b4 \uc218 \uc788\uc9c0\ub9cc, \uc77c\ubc18 \uc0ac\uc6a9\uc790\ub294 \ubd88\uac00\ub2a5\ud569\ub2c8\ub2e4. \uc774\ub54c \ub9cc\uc57d \uc218\ud37c \uc720\uc800 \uad8c\ud55c\uc744 \uac16\uace0 \uc788\ub2e4\uba74 \/etc\/security\/limits.conf<\/tt> \ud30c\uc77c\uc5d0 \ub2e4\uc74c\uacfc \uac19\uc740 \ub0b4\uc6a9\uc744 \ucd94\uac00\ud558\uc5ec \uc774 \ubb38\uc81c\ub97c \ud574\uacb0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n The example above increases the maximum number of open files per process per user to 10240 for two users; trustin and www-data.<\/p>\n\n\n\n \uc704\uc758 \uc608\uc2dc\ub294 trustin\uacfc www-data\ub77c\ub294 \uc0ac\uc6a9\uc790\uc758 \ucd5c\ub300 \uc5f0 \ud30c\uc77c \uc218\ub97c 10240\uc73c\ub85c \uc62c\ub824 \uc90d\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":" Linux\uc5d0\uc11c \uc77c\ubc18 \uc0ac\uc6a9\uc790\uc758 default ulimit \uac12 \uc218\uc815 The default value of ulimit -n (the maximum number of open file descriptors per process per user) is 1024 in Ubuntu Linux. There\u2019s no problem with this default value in my daily life, but I start to get \u2018Too many open files\u2019 errors when I test the performance… Continue reading trustin soft nofile 10240\ntrustin hard nofile 10240\nwww-data soft nofile 10240\nwww-data hard nofile 10240<\/code><\/pre>\n\n\n\n