{"id":648,"date":"2020-09-16T21:52:07","date_gmt":"2020-09-16T15:52:07","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=648"},"modified":"2020-09-16T21:52:07","modified_gmt":"2020-09-16T15:52:07","slug":"dial-unix-tmp-padapter-usk-socket-too-many-open-files","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/dial-unix-tmp-padapter-usk-socket-too-many-open-files.html","title":{"rendered":"dial unix \/tmp\/padapter.usk: socket: too many open files"},"content":{"rendered":"\n<p><strong>Error Definition<\/strong><\/p>\n\n\n\n<p>There are times, when your application may throw error like the following in Linux:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dial unix \/tmp\/padapter.usk: socket: too many open files<\/pre>\n\n\n\n<p>It could only contain the following, without relating the fast message:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">socket: too many open files<\/pre>\n\n\n\n<p><strong>How to Fix<\/strong><\/p>\n\n\n\n<p>This error appears because Linux file system puts a limit of amount of open files you may use at a time. It is calculated based on a variable system set is called &#8216;file-max&#8217;. File System also keeps a variable called &#8216;file-nr&#8217; to count the number of file you have in usage. To quickly look at your usage, you may run the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@server-sg ~]# cat \/proc\/sys\/fs\/file-nr\n4512    0       265535<\/pre>\n\n\n\n<p>The first number is the amount of file descriptions in use in your linux system. Here the last number is your hard limit and the second number is your soft limit. The hard limit is your file-max. To know your file-max value, you may run the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@server-sg ~]# cat \/proc\/sys\/fs\/file-max\n265535<\/pre>\n\n\n\n<p>As we see, the limit is set to 265535 and the usage is 4512. If the usage goes up for some reason, for example an infinite loop on the cache creation, you may run out of file system open limit and hit the error. To set the value fir file-max, we will take sysctl.conf in consideration.<\/p>\n\n\n\n<p>First open sysctl.conf file with the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">nano \/etc\/sysctl.conf<\/pre>\n\n\n\n<p>Add the following line and save:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fs.file-max = 524280<\/pre>\n\n\n\n<p>This will increase your open file limit to 524280. Now to reflect the change immediately, you need to run the following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">sysctl -p<\/pre>\n\n\n\n<p>You should be done now.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Error Definition There are times, when your application may throw error like the following in Linux: It could only contain the following, without relating the fast message: How to Fix This error appears because Linux file system puts a limit of amount of open files you may use at a time. It is calculated based &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/dial-unix-tmp-padapter-usk-socket-too-many-open-files.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;dial unix \/tmp\/padapter.usk: socket: too many open files&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[169,12,26],"tags":[486,484,485],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/648"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=648"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/648\/revisions"}],"predecessor-version":[{"id":649,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/648\/revisions\/649"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}