Even though the Linux platform you develop on is considered very secure, it doesn’t mean it’s 100% guaranteed to be safe. Case in point: the fork bomb.

A fork bomb is a form of denial-of-service attack that uses the fork operation, which is executed recursively and can consume all system resources. The only way to regain control of a fork-bombed system is a reboot, and there’s no guarantee it won’t return.

So, how do you prevent this from happening? You lower the number of processes allowed on your Linux server.

By default, Linux allows 128,038 processes. In order to protect your server from a fork bomb, you must lower that number. It’s actually really simple to do, but you can’t lower the number too much, otherwise you might find your system unusable.

So, how do you lower the number of allowed processes? Let me show you.