How you can discover and kill zombie processes in your Linux knowledge middle servers

Zombied processes can point out a software program drawback. So when a course of goes full-on zombie, it is advisable to know what to do.

How you can discover and kill zombie processes in your Linux knowledge middle servers
Zombied processes can point out an issue with a bit of software program. Jack Wallen reveals you the way to discover and kill these zombies in your Linux knowledge middle servers.


Wait. Fallacious kind of zombies.

CPUUUU cycllllles.



Extra prefer it.

Occasionally a Linux course of goes astray and does nothing—not even gobble up CPU cycles. Though zombies do not use treasured assets (like a operating and rogue app would possibly), it could pose a risk. How? When a course of is zombied, it retains its Course of ID (PID). Since Linux programs have a finite variety of PIDs (though that quantity is fairly excessive), ought to sufficient PIDs be zombied, no different course of may launch.

SEE: Catastrophe restoration and enterprise continuity plan (Tech Professional Analysis)

Possibilities of that taking place are impossible. Nonetheless, extra importantly, zombied processes point out one thing has gone fallacious with an software, and there is perhaps a bug in a specific program. Bugs on knowledge middle software program shouldn’t be tolerated and must be addressed. Till the flaw is addressed, you would possibly wish to examine for and kill zombie processes.

So when a course of goes full-on zombie, what do you do? You discover and kill these zombie processes. Let me present you ways.

Discovering a zombie

The very first thing to do is to seek out the zombie course of. Luckily, that is very easy, due to the ps command. Pipe the output of the ps command by means of grep to checklist out any course of whose STAT is Z (for zombie). Open a terminal window and situation the next command:

ps aux | grep ‘Z’

The output of the above command will checklist out any course of that features Z within the output (Determine A).

Figure A

Determine A: Loads of Zombied instructions.

As you possibly can see, there are a variety of operating processes which have a Zombie standing. This command may also checklist any course of that features the letter Z within the output, so it is advisable to ignore something and not using a Z within the STAT column.

Killing a zombie

As a substitute of decapitating, burning, or utterly dismembering the zombie, we wish to use the kill command to finish these zombies. The output of the primary command will embrace the PID of all zombied processes, so to kill a type of, you situation the command:

kill PID

The place PID is the method ID of the method in query. So if you wish to kill the zombied thunderbird course of (with PID 20589), the command is:

kill 20589

And that is it.

You can get artful and cobble collectively a bash script to handle this mechanically, nonetheless, you run the danger of killing a crucial course of. Due to that danger, I all the time suggest caring for this activity manually. That is very true, contemplating we’re working with a production-level, knowledge middle server (though I demonstrated on a desktop machine).

For those who discover providers and apps crashing on you, it is best to examine for zombied processes and eliminate them. As soon as which processes are being zombied, file a bug report or contact the developer and allow them to know (particularly if this turns into an everyday incidence for an software).

Additionally see

Picture: Jack Wallen

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *