Drush stuck in "Killed" loop I recently installed Drush 8.1.2 from the tarball distribution available on Github and composer install-ed it (this is after trying to use the .phar to very similar ends).

Oddly, whenever I try to run drush from my shell (with or without subcommands), I get no output for a while, then drush just keeps printing Killed over and over, every few seconds.

Running ps aux | grep drush reveals dozens of spawned drush processes; simply sending an interrupt via ^C doesn't make the Killed stop. Because the processes spawn about as quickly as I can kill them, don't respond to killall, and cause surprisingly large amounts of when inputting commands, I have to reboot the system to kill the processes.

The same thing happens with the .phar version. This is not an issue with drush available via apt, but that's drush 5, which is horribly outdated. The same thing happens with drush-8.1.1, the previous release. This also occurs when installing globally via:

$ composer global require drush/drush:dev-master


According to my host's monitoring tools, this also sends my CPU usage skyrocketing up to about 70% until reboot, as well.

I'm on an otherwise brand-new Ubuntu 16.04 VM, with Drupal 8 installed.

Update: I've now tried the snippet at drush.org (below) on my laptop (running OS X 10.11, 8GB RAM) as well as on a much larger cloud instance with similar CPU and RAM specs, running Ubuntu. The out-of-memory error persists on this new box, but the installation succeeds without issues and produces a working drush on my laptop.

# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases.
php -r "readfile('http://files.drush.org/drush.phar');" &gt; drush
# Or use our upcoming release: php -r "readfile('http://files.drush.org/drush-unstable.phar');" &gt; drush

# Test your install.
php drush core-status

# Make `drush` executable as a command from anywhere. Destination can be anywhere on $PATH.
chmod +x drush
sudo mv drush /usr/local/bin

# Optional. Enrich the bash startup file with completion and aliases.
drush init


I suspect that drush requiring more than 8GB of RAM for normal operation isn't expected behaviour; it's probably pointless to spawn boxes with higher-performance CPU and RAM configurations at this point.

Notes:


I've allowed PHP to allocate 384M of RAM in my php.ini -- the process still respawns and prints Killed, all while making my system lag intensely.
as much as I'd like to bring out strace, the lag on my system is a major impediment. Keystrokes take a second or two to register as long as the processes are spawning.
This particular box has PHP 5.6, but the issue is also present on a box running PHP 7.0.
I haven't found a solution to the "Killed" loop issue (even after scaling up to the largest instance offered by my host, which has 64GB of RAM), but I've managed to get drush itself to work by pulling the .phar from Github and making it executable.

Using the install script still doesn't work (still leads to the Killed loop) despite making sure that everything that should be executable is executable, and installing from the tarballs or via composer likewise fails in a similar way.