---
title: "Reclaiming process slots"
date: "2015-03-03"
category: "cgi-passenger"
slug: "reclaiming-process-slots"
---

## Overview

Passenger may refuse to deploy a new process when all available process slots are in use. You need to terminate an existing process to free a slot before Passenger can launch a new one.

## Symptoms

After [[restarting-passenger-processes]], the application hangs and [[viewing-launcher-errors]] shows an error similar to:

[ 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...

## Solution

Kill existing processes from the [[accessing-terminal]] using one of the methods below.

### By Process Name

If you know the process name, kill it directly. Replace `PROCNAME` with the actual process name:

`kill -9 $(ps -o pid= -C PROCNAME)`

For example, to kill all Python processes: `kill -9 $(ps -o pid= -C python)`

You may see "Operation not permitted" warnings for processes owned by other users. These can be safely ignored:

bash: kill: (17267) - Operation not permitted
bash: kill: (17413) - Operation not permitted

### By Process ID (PID)

If you don't know the process name, list your running processes with [ps](http://apnscp.com/linux-man/man1/ps.1.html):

[sand@sol www]$ ps x
 PID TTY STAT TIME COMMAND
 1898 ? Sl 0:02 Passenger AppPreloader: /home/virtual/site137/fst/var/www/rails4
 3512 ? Sl 0:00 Passenger MeteorApp (3519)
 3827 ? S 0:00 python /.socket/passenger/helper-scripts/wsgi-loader.py

_This is an abridged process list._

Find the PID for the Passenger application you want to stop, then [kill](http://apnscp.com/linux-man/man1/kill.1.html) it:

kill -9 1898

This terminates the application at `/var/www/rails4` and frees the slot for Passenger to spawn a new instance.
