Simulating Denial of Service Attacks

In this lesson, we will be using a tool called Siege to simulate Denial of Service attacks on our application.

Running Siege to simulate a DoS attack

Another scenario that could happen is that we might be under attack. Somebody, intentionally or unintentionally, might be creating a Denial of Service attack (DoS attack). What that really is that our applications, or even the whole cluster, might be under an extreme load. It might be receiving such a vast amount of traffic that our infrastructure cannot handle it. Although uncommon, it is not unheard of for a whole system to collapse when under a DoS attack. It is likely that a system will collapse if we don’t undertake some precautionary measures.

Before we simulate such an attack, let’s confirm that our application works more or less correctly when serving an increased number of requests. We’re not going to go through simulating millions of requests. That would be out of the scope of this course. We’re going to do a “poor man” equivalent of a Denial of Service attack.

First, we’ll put our application under test and see what happens if we keep sending fifty concurrent requests for, let’s say, 20 seconds.

We’ll use a tool called Siege that will be running as a container in a Pod.

Let’s see what happens.

Get hands-on with 1200+ tech skills courses.