Ddosify : High-performance load testing tool
Tags: performance, testing, webperf, go
Published: 2021-10-25 15:56:12

<!-- wp:paragraph -->
<p>There are over <a href="https://github.com/QAInsights/Performance-Testing-Tools" target="_blank" rel="noreferrer noopener">50+ tools and solutions</a> available in the market for performance testing your application and services. Now it is time to check out Ddosify, high-performance load testing tool which offers free and commercial features to test web applications and services over HTTP(S), HTTP/2, and other protocols are on their way. In this blog article, let us deep-dive into Ddosify tool and see whether it satisfies a typical performance engineer or not.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Before we see Ddosify, let us try to understand the name of the tool. Ddosify contains <code>Ddos</code> term. DDoS stands for Distributed Denial of Services. Below is the Wikipedia entry for Denial of Service:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><em>In computing, a denial-of-service attack is a cyber-attack in which the perpetrator seeks to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting services of a host connected to the Internet</em>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>An attacker targets a machine and tries to disrupt its services. The term <em>distributed </em>stands for <em>multiple sources. </em>Instead of attacking a system from one source, attacker uses multiple sources.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you try to fit the <em>DDoS </em>capabilities for good intent, you will get <code>Ddosify</code>. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>What is Ddosify?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://github.com/ddosify/ddosify" target="_blank" rel="noreferrer noopener">Ddosify</a> is a high-performance load testing tool written in Golang. It comes in two flavors: open-source and commercial. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It supports HTTP(S), HTTP/2 protocols (as of now); other protocols are on the way.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>JSON support for creating scenarios.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Supports various workload models.</p>
<!-- /wp:paragraph -->

<!-- wp:generateblocks/headline {"uniqueId":"445efbc3"} -->
<h2 class="gb-headline gb-headline-445efbc3 gb-headline-text">Getting Started</h2>
<!-- /wp:generateblocks/headline -->

<!-- wp:paragraph -->
<p>As Ddosify is Golang based, the prerequisite is to install the latest and stable version of Golang if you want to build from the source, else you can download the binaries to get started. Head to https://golang.org/dl/ to install the Golang.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To install Ddosify, you can leverage Docker or install it from source.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>docker run -it --rm ddosify/ddosify
</code></pre>
<!-- /wp:code -->

<!-- wp:code -->
<pre class="wp-block-code"><code>go install -v go.ddosify.com/ddosify@latest
</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>After successful installation, you can verify Ddosify by issuing the below command.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>ddosify -version</code></pre>
<!-- /wp:code -->

<!-- wp:heading -->
<h2>Quick Start</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Let us start a quick load testing, targeting the demo app. I am running a sample Jetty app locally on the port 8080. To begin the testing using Ddosify, you can issue the below command.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>ddosify -t http://localhost:8080/test/hello</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The above command sends 100 requests in 10 seconds. Below is the output. During the test, Ddosify displays the status runtime. Once the test is done, it will display the results with DNS, Connection, Request Write, Server Processing, Response Read time and Total time in seconds.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To terminate the test, you can press <code>Ctrl + C</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8724,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2021/10/image-4.png"><img src="https://qainsights.com/wp-content/uploads/2021/10/image-4-1024x651.png" alt="Ddosify : High-performance load testing tool" class="wp-image-8724"/></a><figcaption>Ddosify : High-performance load testing tool</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Scenario Design</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Now let us design a quick scenario to test the demo app in JSON. Copy and paste the below JSON and save it as <code>config.json</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To start the test, issue <code>ddosify -config .\config.json</code>.</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>{
  "request_count": 20,
  "load_type": "linear",
  "duration": 5,
  "output": "stdout",
  "steps": &#91;
    {
      "id": 1,
      "url": "http://localhost:8080/test/session/",
      "protocol": "http",
      "method": "POST",
      "headers": {
        "ContenType": "application/xml",
        "header1": "header2"
      },
      "payload": "Name=test&amp;Value=test&amp;Action=Set",
      "timeout": 3,      
      "others": {
        "keep-alive": true,
        "disableCompression": false,
        "h2": true,
        "disable-redirect": true
      }
    }    
  ]
}</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>The above scenario throws 20 requests (iterates) over the period of 5 seconds. Below is the output.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8725,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2021/10/image-5.png"><img src="https://qainsights.com/wp-content/uploads/2021/10/image-5-1024x568.png" alt="Ddosify : High-performance load testing tool" class="wp-image-8725"/></a><figcaption>Ddosify : High-performance load testing tool</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Below are the various flags available for Ddosify at this time of writing. </p>
<!-- /wp:paragraph -->

<!-- wp:table {"className":"is-style-stripes"} -->
<figure class="wp-block-table is-style-stripes"><table><thead><tr><th>Flag</th><th>Description</th><th>Type</th><th>Default</th><th>Required?</th></tr></thead><tbody><tr><td><code>-t</code></td><td>Target website URL. Example:&nbsp;<a href="https://ddosify.com/">https://ddosify.com</a></td><td><code>string</code></td><td>-</td><td>Yes</td></tr><tr><td><code>-n</code></td><td>Total request count</td><td><code>int</code></td><td><code>100</code></td><td>No</td></tr><tr><td><code>-d</code></td><td>Test duration in seconds.</td><td><code>int</code></td><td><code>10</code></td><td>No</td></tr><tr><td><code>-p</code></td><td>Protocol of the request. Supported protocols are&nbsp;<em>HTTP, HTTPS</em>. HTTP/2 support is only available by using a config file as described. More protocols will be added.</td><td><code>string</code></td><td><code>HTTPS</code></td><td>No</td></tr><tr><td><code>-m</code></td><td>Request method. Available methods for HTTP(s) are&nbsp;<em>GET, POST, PUT, DELETE, UPDATE, PATCH</em></td><td><code>string</code></td><td><code>GET</code></td><td>No</td></tr><tr><td><code>-b</code></td><td>The payload of the network packet. AKA body for the HTTP.</td><td><code>string</code></td><td>-</td><td>No</td></tr><tr><td><code>-a</code></td><td>Basic authentication. Usage:&nbsp;<code>-a username:password</code></td><td><code>string</code></td><td>-</td><td>No</td></tr><tr><td><code>-h</code></td><td>Headers of the request. You can provide multiple headers with multiple&nbsp;<code>-h</code>&nbsp;flag.</td><td><code>string</code></td><td>-</td><td>No</td></tr><tr><td><code>-T</code></td><td>Timeout of the request in seconds.</td><td><code>int</code></td><td><code>5</code></td><td>No</td></tr><tr><td><code>-P</code></td><td>Proxy address as host:port.&nbsp;<code>-P http://user:pass@proxy_host.com:port'</code></td><td><code>string</code></td><td>-</td><td>No</td></tr><tr><td><code>-o</code></td><td>Test result output destination. Other output types will be added.</td><td><code>string</code></td><td><code>stdout</code></td><td>No</td></tr><tr><td><code>-l</code></td><td><a href="https://github.com/ddosify/ddosify#load-types">Type</a>&nbsp;of the load test. Ddosify supports 3 load types.</td><td><code>string</code></td><td><code>linear</code></td><td>No</td></tr><tr><td><code>-config</code></td><td><a href="https://github.com/ddosify/ddosify#config-file">Config File</a>&nbsp;of the load test.</td><td><code>string</code></td><td>-</td><td>No</td></tr><tr><td><code>-version</code></td><td>Prints version, git commit, built date (utc), go information and quit</td><td>-</td><td>-</td><td>No</td></tr></tbody></table><figcaption>Ddosify Flags</figcaption></figure>
<!-- /wp:table -->

<!-- wp:heading -->
<h2>Workload Models</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>At this moment, Ddosify supports three workload models: Linear, Incremental, and Waved.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Linear </strong>helps to inject the load consistently over the period of time.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Incremental </strong>injects the load gradually increasing.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The <strong>wave </strong>pattern injects the load like peaks and valleys. </p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>How many requests you can send from your system?</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>To determine, how many requests you can generate on the system, purely depends on the CPU, memory, and other parameters. You need to run benchmark tests and conclude your findings.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I have two cores with 16 GB RAM. Golang is based on a lightweight thread managed by Go runtime called goroutines. Golang has better concurrency than other languages. You can easily spin up hundreds of threads using minimal resources. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I executed a test with 10000 requests. As you see, the load is proportional to the time. </p>
<!-- /wp:paragraph -->

<!-- wp:image {"align":"center","id":8726,"sizeSlug":"large","linkDestination":"media"} -->
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://qainsights.com/wp-content/uploads/2021/10/image-6.png"><img src="https://qainsights.com/wp-content/uploads/2021/10/image-6-1024x779.png" alt="High Load Test" class="wp-image-8726"/></a><figcaption>High Load Test</figcaption></figure></div>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>When I injected with 10000000, I observed high CPU and memory on ddosify.exe and the test took a long time to complete. I have to terminate the exe file. It is not DDosify issue, it is my system configuration. I have an under-powered config which cannot be useful for running very high load.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":8728,"sizeSlug":"full","linkDestination":"media"} -->
<figure class="wp-block-image size-full"><a href="https://qainsights.com/wp-content/uploads/2021/10/image-8.png"><img src="https://qainsights.com/wp-content/uploads/2021/10/image-8.png" alt="" class="wp-image-8728"/></a></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Overall</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Ddosify might be a good fit if you want to run a very high load quickly with minimal configuration. It is still in the very early stages, and a lot of features are missing (parameterization, logical actions, scripting to name a few). The commercial version is yet to be released.; I am on the waiting list. I hope Ddosify team will develop the features which will satisfy typical performance engineers eventually. I urge you to try Ddosify to ddosify your app. </p>
<!-- /wp:paragraph -->