{"id":3098,"date":"2019-06-12T00:11:36","date_gmt":"2019-06-11T16:11:36","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=3098"},"modified":"2019-06-12T13:48:38","modified_gmt":"2019-06-12T05:48:38","slug":"ulimit","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ulimit","title":{"rendered":"ulimit\u547d\u4ee4 – \u63a7\u5236shell\u7a0b\u5e8f\u7684\u8d44\u6e90"},"content":{"rendered":"\n

Linux\u5bf9\u4e8e\u6bcf\u4e2a\u7528\u6237\uff0c\u7cfb\u7edf\u9650\u5236\u5176\u6700\u5927\u8fdb\u7a0b\u6570\u3002\u4e3a\u63d0\u9ad8\u6027\u80fd\uff0c\u53ef\u4ee5\u6839\u636e\u8bbe\u5907\u8d44\u6e90\u60c5\u51b5\uff0c\u8bbe\u7f6e\u5404linux\u7528\u6237\u7684\u6700\u5927\u8fdb\u7a0b\u6570\uff0c\u6211\u4eec\u53ef\u4ee5\u7528ulimit\u6765\u663e\u793a\u5f53\u524d\u7684\u5404\u79cd\u7528\u6237\u8fdb\u7a0b\u9650\u5236\u3002 <\/p>\n\n\n\n

ulimit\u4e3ashell\u5185\u5efa\u547d\u4ee4\uff0c\u53ef\u7528\u6765\u63a7\u5236shell\u6267\u884c\u7a0b\u5e8f\u7684\u8d44\u6e90\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>ulimit [\u53c2\u6570] <\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
-a<\/td>\u663e\u793a\u76ee\u524d\u8d44\u6e90\u9650\u5236\u7684\u8bbe\u5b9a <\/td><\/tr>
-d<\/td>\u7a0b\u5e8f\u6570\u636e\u8282\u533a\u7684\u6700\u5927\u503c\uff0c\u5355\u4f4d\u4e3aKB <\/td><\/tr>
-t<\/td>\u6307\u5b9aCPU\u4f7f\u7528\u65f6\u95f4\u7684\u4e0a\u9650\uff0c\u5355\u4f4d\u4e3a\u79d2 <\/td><\/tr>
-u<\/td>\u7528\u6237\u6700\u591a\u53ef\u5f00\u542f\u7684\u7a0b\u5e8f\u6570\u76ee <\/td><\/tr>
-v<\/td>\u6307\u5b9a\u53ef\u4f7f\u7528\u7684\u865a\u62df\u5185\u5b58\u4e0a\u9650,\u5355\u4f4d\u4e3aKB <\/td><\/tr><\/tbody><\/table>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u7cfb\u7edf\u8d44\u6e90\u7684\u8bbe\u7f6e\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ulimit -a <\/pre>\n\n\n\n

\u8bbe\u7f6e\u5355\u4e00\u7528\u6237\u7a0b\u5e8f\u6570\u76ee\u4e0a\u9650 \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# ulimit -u 500<\/pre>\n\n\n\n

\u5c06\u6bcf\u4e2a\u8fdb\u7a0b\u53ef\u4ee5\u6253\u5f00\u7684\u6587\u4ef6\u6570\u76ee\u52a0\u5927\u52304096 \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# ulimit -n 4096 <\/pre>\n\n\n\n

\u6307\u5b9a\u53ef\u4f7f\u7528\u7684\u865a\u62df\u5185\u5b58\u4e0a\u9650\u4e3a12800KB \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# ulimit -v 12800 <\/pre>\n\n\n\n

\u6307\u5b9aCPU\u4f7f\u7528\u65f6\u95f4\u7684\u4e0a\u9650\u4e3a2s \uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# ulimit -t 2<\/pre>\n","protected":false},"excerpt":{"rendered":"

Linux\u5bf9\u4e8e\u6bcf\u4e2a\u7528\u6237\uff0c\u7cfb\u7edf\u9650\u5236\u5176\u6700\u5927\u8fdb\u7a0b\u6570\u3002\u4e3a\u63d0\u9ad8\u6027\u80fd\uff0c\u53ef\u4ee5\u6839\u636e\u8bbe\u5907\u8d44\u6e90\u60c5\u51b5\uff0c\u8bbe\u7f6e\u5404linux\u7528\u6237\u7684\u6700\u5927\u8fdb\u7a0b […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3098"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=3098"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3098\/revisions"}],"predecessor-version":[{"id":3109,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3098\/revisions\/3109"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=3098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=3098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=3098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}