{"id":2734,"date":"2019-07-14T21:20:46","date_gmt":"2019-07-14T15:50:46","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=2734"},"modified":"2020-11-24T02:57:29","modified_gmt":"2020-11-23T21:27:29","slug":"how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/","title":{"rendered":"How to increase the ulimit and file descriptors limit in linux."},"content":{"rendered":"\n<p>If you get the error \u201ctoo many open files\u201d , please check below steps :<\/p>\n\n\n\n<p>The file-max is the maximum File Descriptors (FD). It is a kernel \nsetting enforced at the system level. The ulimit is enforced at the user\n level. It should be configured to be less than file-max.<\/p>\n\n\n\n<p>The default settings are&nbsp; very low , for high performance servers it&nbsp;\n should be increased. The default settings assume that the several user \nshare the same system and limit is&nbsp; sufficient.<\/p>\n\n\n\n<p>To change the file descriptor setting, edit the kernel parameter file <strong>\/etc\/sysctl.conf<\/strong>. Add line <strong>fs.file-max=[new value]<\/strong> to it.<\/p>\n\n\n\n<p>for eg.&nbsp;&nbsp;&nbsp;&nbsp; # vi \/etc\/sysctl.conf&nbsp;&nbsp;&nbsp; and enter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fs.file-max = 400000<\/p>\n\n\n\n<p><strong>To apply the changes :<\/strong><br>\n#sysctl -p<\/p>\n\n\n\n<p><strong>To change the ulimit setting, edit the file \/etc\/security\/limits.conf and set the hard and soft limits in it :<\/strong><br>\nfor eg.<code># vi \/etc\/security\/limits.conf<br>\n* soft nofile 40000<br>\n* hard nofile 40000<\/code><\/p>\n\n\n\n<p><strong>After changed reboot the server.<\/strong><br>\n# reboot<\/p>\n\n\n\n<p><strong>Now,test system settings using the below commands:<\/strong><\/p>\n\n\n\n<p>#ulimit -a<\/p>\n\n\n\n<p><strong>To check the current open file descriptor limit:<\/strong><br>\n# more \/proc\/sys\/fs\/file-max<\/p>\n\n\n\n<p>OR sysctl -a | grep fs.file-max<\/p>\n\n\n\n<p><strong>To find out how many file descriptors are currently being used:<\/strong><\/p>\n\n\n\n<p># more \/proc\/sys\/fs\/file-nr<\/p>\n\n\n\n<p><strong>To find out how many files are currently open:<\/strong><\/p>\n\n\n\n<p># lsof | wc -l<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you get the error \u201ctoo many open files\u201d , please check below steps : The file-max is the maximum File Descriptors (FD). It is a kernel setting enforced at the system level. The ulimit is enforced at the user level. It should be configured to be less than file-max. The default settings are&nbsp; very [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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","enabled":false}}},"categories":[34],"tags":[201,200],"class_list":["post-2734","post","type-post","status-publish","format-standard","hentry","category-linux","tag-file-limit","tag-ulimit"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog<\/title>\n<meta name=\"description\" content=\"How to increase the ulimit and file descriptors limit in linux, increase ulimit,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"How to increase the ulimit and file descriptors limit in linux, increase ulimit,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-14T15:50:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-23T21:27:29+00:00\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/\",\"name\":\"How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"datePublished\":\"2019-07-14T15:50:46+00:00\",\"dateModified\":\"2020-11-23T21:27:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"description\":\"How to increase the ulimit and file descriptors limit in linux, increase ulimit,\",\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to increase the ulimit and file descriptors limit in linux.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog","description":"How to increase the ulimit and file descriptors limit in linux, increase ulimit,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog","og_description":"How to increase the ulimit and file descriptors limit in linux, increase ulimit,","og_url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/","og_site_name":"24x7serversupport Blog","article_published_time":"2019-07-14T15:50:46+00:00","article_modified_time":"2020-11-23T21:27:29+00:00","author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/","url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/","name":"How to increase the ulimit and file descriptors limit in linux. | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"datePublished":"2019-07-14T15:50:46+00:00","dateModified":"2020-11-23T21:27:29+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"description":"How to increase the ulimit and file descriptors limit in linux, increase ulimit,","breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-increase-the-ulimit-and-file-descriptors-limit-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to increase the ulimit and file descriptors limit in linux."}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=2734"}],"version-history":[{"count":1,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2734\/revisions"}],"predecessor-version":[{"id":2735,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2734\/revisions\/2735"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=2734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=2734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=2734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}