{"id":674,"date":"2012-04-13T20:43:41","date_gmt":"2012-04-13T12:43:41","guid":{"rendered":"http:\/\/www.yaoge123.com\/blog\/?p=674"},"modified":"2012-04-13T20:43:41","modified_gmt":"2012-04-13T12:43:41","slug":"freebsd-%e6%89%93%e5%bc%80%e6%96%87%e4%bb%b6%e6%95%b0%e9%99%90%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.yaoge123.com\/blog\/archives\/674","title":{"rendered":"FreeBSD \u6253\u5f00\u6587\u4ef6\u6570\u9650\u5236"},"content":{"rendered":"<p>samba\u62a5\u9519smbd&#8217;s max open files = 16384<br \/>\n\u4e00\u822c\u662f\u7cfb\u7edf\u7684open flies\u9650\u5236<\/p>\n<p>\u67e5\u770b\u7cfb\u7edf\u9650\u5236\uff1a<br \/>\n[root@storage ~]# sysctl -a | grep maxfiles<br \/>\nkern.maxfiles: 12328<br \/>\nkern.maxfilesperproc: 11095<br \/>\nkern.openfiles: 8760<br \/>\nFreeBSD 8.2\uff0c\u9ed8\u8ba4\u7cfb\u7edf\u6253\u5f00\u6587\u4ef6\u657012328\uff0c\u6bcf\u8fdb\u7a0b\u6253\u5f00\u6587\u4ef6\u657011095\uff0ckern.openfiles\u662f\u7cfb\u7edf\u5f53\u524d\u6253\u5f00\u6587\u4ef6\u6570\u3002<\/p>\n<p>\u8bbe\u7f6e\u65b0\u7684\u7cfb\u7edf\u9650\u5236\uff1a<br \/>\n[root@storage ~]# sysctl kern.maxfiles=65536<br \/>\n[root@storage ~]# sysctl kern.maxfilesperproc=32768<\/p>\n<p>\u67e5\u770b\u67d0\u4e2a\u8fdb\u7a0b\u7684\u7cfb\u7edf\u9650\u5236\uff0cnofile\u5c31\u662f\u8fd9\u4e2a\u8fdb\u7a0b\u6253\u5f00\u6587\u4ef6\u6570\u7684\u9650\u5236<br \/>\n24443\u662f\u67d0\u4e2asmbd\u7684pid<br \/>\n[root@storage ~]# mount -t procfs proc \/proc<br \/>\n[root@storage ~]# cd \/proc\/24443<br \/>\n[root@storage \/proc\/24443]# ls -l<br \/>\ntotal 0<br \/>\n-r&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 cmdline<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 ctl<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 dbregs<br \/>\n-r&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 etype<br \/>\nlr&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 file -&gt; \/usr\/local\/sbin\/smbd<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 fpregs<br \/>\n-r&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 map<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 mem<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 note<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 notepg<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 osrel<br \/>\n&#8212;&#8212;&#8212;-\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 regs<br \/>\n-r&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 rlimit<br \/>\n-r&#8211;r&#8211;r&#8211;\u00a0 1 root\u00a0 wheel\u00a0 0 Nov\u00a0 7 20:15 status<br \/>\n[root@storage \/proc\/24443]# cat rlimit<br \/>\ncpu -1 -1<br \/>\nfsize -1 -1<br \/>\ndata 34359738368 34359738368<br \/>\nstack 536870912 536870912<br \/>\ncore -1 -1<br \/>\nrss -1 -1<br \/>\nmemlock -1 -1<br \/>\nnproc 5547 5547<br \/>\nnofile 32768 32768<br \/>\nsbsize -1 -1<br \/>\nvmem -1 -1<br \/>\nnpts -1 -1<br \/>\nswap -1 -1<\/p>\n<p>\/etc\/login.conf\u53ef\u4ee5\u914d\u7f6e\u67d0\u4e2a\u7528\u6237\u7684\u7cfb\u7edf\u8d44\u6e90\u9650\u5236\uff0c\u9ed8\u8ba4\u662f\u65e0\u9650\u5236\u7684\uff0c\u5c31\u662f\u53d7\u9650\u4e8e\u7cfb\u7edf\u5185\u6838\u9650\u5236<\/p>\n<p>\/etc\/sysctl.conf\u91cc\u9762\u914d\u7f6e\u5bf9\u5f00\u673a\u542f\u52a8\u7684\u670d\u52a1\u65e0\u6548<\/p>\n<p>\/boot\/loader.conf\u91cc\u9762\u914d\u7f6e\u5bf9\u5f00\u673a\u542f\u52a8\u7684\u670d\u52a1\u6709\u6548<\/p>\n","protected":false},"excerpt":{"rendered":"<p>samba\u62a5\u9519smbd&#8217;s max open files = 16384 \u4e00\u822c\u662f\u7cfb\u7edf\u7684open f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15],"tags":[210],"class_list":["post-674","post","type-post","status-publish","format-standard","hentry","category-freebsd","tag-freebsd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paOwEq-aS","_links":{"self":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/674","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/comments?post=674"}],"version-history":[{"count":1,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/674\/revisions"}],"predecessor-version":[{"id":675,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/posts\/674\/revisions\/675"}],"wp:attachment":[{"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/media?parent=674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/categories?post=674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yaoge123.com\/blog\/wp-json\/wp\/v2\/tags?post=674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}