{"id":8393,"date":"2015-03-03T22:10:35","date_gmt":"2015-03-03T22:10:35","guid":{"rendered":"https:\/\/wp.okra.host\/article\/reclaiming-process-slots\/"},"modified":"2021-03-07T14:08:46","modified_gmt":"2021-03-07T13:08:46","slug":"reclaiming-process-slots","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/reclaiming-process-slots\/","title":{"rendered":"Reclaiming process slots"},"content":{"rendered":"<h2 id=\"overview\" >Overview<\/h2>\n<p>When trying to redeploy a Passenger process, Passenger may refuse deployment, because you have maxed out on available process slots. Terminating the process will free a connection slot and permit Passenger to launch a new process.<\/p>\n<h2 id=\"symptoms\" >Symptoms<\/h2>\n<p>Upon launching an application after <a title=\"Restarting Passenger processes\" href=\"https:\/\/kb.okra.host\/ruby\/restarting-passenger-processes\/\">restarting<\/a>, the app will hang and <a title=\"Viewing launcher errors\" href=\"https:\/\/kb.okra.host\/cgi-passenger\/viewing-launcher-errors\/\">log an error<\/a> similar to:<\/p>\n<pre>[ 2015-03-03 14:36:46.2725 11560\/7f728e250700 Pool2\/Group.h:898 ]: Unable to spawn the the sole process for group \/home\/virtual\/siteXXX\/fst\/var\/subdomain\/SUBDOMAIN\/..\/..\/www\/APPNAME#default because the max pool size has been reached. Trying to shutdown another idle process to free capacity...<\/pre>\n<h2 id=\"solution\" >Solution<\/h2>\n<p>Kill any resident processes from the <a title=\"Accessing terminal\" href=\"https:\/\/kb.okra.host\/terminal\/accessing-terminal\/\">terminal<\/a>. You can\u00a0accomplish this in one of two ways:<\/p>\n<h3 id=\"easy-way\" >Easy way<\/h3>\n<p>Know the process name?\u00a0<code>kill -9 $(ps -o pid= -C PROCNAME) -\u00a0<\/code>substitute <em>PROCNAME<\/em> for the process name<\/p>\n<p><span style=\"color: #0000ff\">Example:<\/span> to kill all Python processes running with the binary, <em>python<\/em>:\u00a0<code>kill -9 $(ps -o pid= -C python)<\/code><\/p>\n<p>In certain situations, a kill may be issued to other processes. This won&#8217;t affect neighboring processes, but will elicit a warning that may be safely ignored:<\/p>\n<pre>bash: kill: (17267) - Operation not permitted\r\nbash: kill: (17413) - Operation not permitted<\/pre>\n<h3 id=\"hard-way\" >Hard way<\/h3>\n<p>Don&#8217;t know the process name? Use <a href=\"http:\/\/apnscp.com\/linux-man\/man1\/ps.1.html\">ps<\/a> to pull up processes:<\/p>\n<p><span style=\"color: #0000ff\">Example:<\/span><\/p>\n<pre data-language=\"shell\"><code>[sand@sol www]$ ps x\r\n PID TTY STAT TIME COMMAND\r\n 1898 ? Sl 0:02 Passenger AppPreloader: \/home\/virtual\/site137\/fst\/var\/www\/rails4\r\n 3512 ? Sl 0:00 Passenger MeteorApp (3519)\r\n 3827 ? S 0:00 python \/.socket\/passenger\/helper-scripts\/wsgi-loader.py<\/code><\/pre>\n<p style=\"text-align: center\"><em>This is an abridged\u00a0process list<\/em><\/p>\n<p>Inspect the value under the <em>PID<\/em> column. PIDs are process identifiers and are a globally unique\u00a0way to identify a process running. Take the PID for the respective Passenger application, then <a href=\"http:\/\/apnscp.com\/linux-man\/man1\/kill.1.html\">kill<\/a> it.<\/p>\n<pre style=\"padding-left: 30px\">kill -9 1898<\/pre>\n<p>This will kill the application running under <code>\/var\/www\/rails4<\/code>\u00a0allowing Passenger to spawn a new instance.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview When trying to redeploy a Passenger process, Passenger may refuse deployment, because you have maxed out on available process slots. Terminating the process will free a connection slot and permit Passenger to launch a new process. Symptoms Upon launching an application after restarting, the app will hang and log&#8230;<\/p>","protected":false},"author":1,"comment_status":"close","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[55],"ht-kb-tag":[],"class_list":["post-8393","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cgi-passenger"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8393"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8393\/revisions"}],"predecessor-version":[{"id":8394,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8393\/revisions\/8394"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8393"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8393"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}