Table of Contents
In this article, I will take you through the installation and usage of Ddosify for high performance testing in Linux. Ddosify is a free and open source Golang based tool available for performance testing of web applications. It is simple and easy to use in comparison to other open source tools like Apache JMeter. It is available for both free as well for commercial usage. More on GitHub.
Features
- It currently supports HTTP, HTTPS and HTTP/2 protocol.
- You can actually create your flow using just a JSON file.
- You can test your system's limits across different load types.
How to Install and Use Ddosify High Performance Testing Tool in Linux
Also Read: How to Use AIDE for Integrity Checks in Linux (RHEL/CentOS 7/8)
Step 1: Prerequisites
a) You should have a running Linux Server. In our case, we are using Ubuntu 20.04 LTS
Server. This could be different for you.
b) You should have sudo
or root
access to run privileged commands.
c) You should have curl
utility and a package manager available in your System.
Step 2: Update Your Server
Before installing a new package, let's check for any new available updates using apt update
command. If there are any specific packages which needs to be upgraded then run apt upgrade
command to upgrade it to the latest version.
root@cyberithub:~# apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:4 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu focal InRelease
Get:5 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:7 https://dl.google.com/linux/chrome/deb stable InRelease [1,811 B]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [610 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,608 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [308 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [279 kB]
If you are using RHEL/CentOS based Systems then you can use below command to update your System.
yum update dnf update
If any of the packages needs to be upgraded then you upgrade it by using below command.
yum upgrade dnf upgrade
Step 3: Install Ddosify
While there are multiple ways to install Ddosify package in the System, we will use the most easiest one that is by using the Installation Script. You can go to GitHub page and get the latest script to download and install the package. Below is the latest install.sh
script needed to run to complete the installation.
root@cyberithub:~# curl -sSfL https://raw.githubusercontent.com/ddosify/ddosify/master/scripts/install.sh | sh
Downloading latest ddosify binary from https://github.com/ddosify/ddosify/releases/download/v0.7.5/ddosify_0.7.5_linux_amd64.tar.gz
Installing ddosify to /usr/local/bin/
Installed ddosify to /usr/local/bin/
Step 4: Check Version
After successful installation, check the installed version by using ddosify -version
command as shown below.
root@cyberithub:~# ddosify -version
Version: 0.7.5
Git commit: 1af3316
Built 2022-03-05T03:47:37Z
Go version: go1.17.7
OS/Arch: linux/amd64
Step 5: Simple Load Test
To perform a simple load test, we are using our internal setup localhost Server as target(-t)
and running the test using ddosify -t https://localhost:443
command as shown below. It is important to note here that we are using our internal URL https://localhost:443
as target. You should also use only those URLs as target which you are the owner.
NOTE:
root@cyberithub:~# ddosify -t https://localhost:443 ⚙️ Initializing... 🔥 Engine fired. 🛑 CTRL+C to gracefully stop. ✔️ Successful Run: 2 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.27993s ✔️ Successful Run: 17 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.24813s ✔️ Successful Run: 31 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.24365s ✔️ Successful Run: 47 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.25068s ✔️ Successful Run: 62 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.24539s ✔️ Successful Run: 77 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.24364s ✔️ Successful Run: 92 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.25380s ✔️ Successful Run: 100 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.25622s RESULT ------------------------------------- Success Count: 100 (100%) Failed Count: 0 (0%) Durations (Avg): DNS :0.0016s Connection :0.3395s TLS :0.1017s Request Write :0.0002s Server Processing :0.1511s Response Read :0.6621s Total :1.2562s Status Code (Message) :Count 200 (OK) :100
Step 6: Change Total Request Count
By default, total request count will be set as 100
. If you want to change this count let's say to 1000
then you need to use -n
option and pass the value as shown below.
root@cyberithub:~# ddosify -t https://localhost:443 -n 1000 ⚙️ Initializing... 🔥 Engine fired. 🛑 CTRL+C to gracefully stop. ✔️ Successful Run: 9 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.31956s ✔️ Successful Run: 126 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.45559s ✔️ Successful Run: 268 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.59347s ✔️ Successful Run: 418 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.65413s ✔️ Successful Run: 570 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.69131s ✔️ Successful Run: 703 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.71053s ✔️ Successful Run: 844 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.74529s ✔️ Successful Run: 1000 100% ❌ Failed Run: 0 0% ⏱️ Avg. Duration: 1.75981s RESULT ------------------------------------- Success Count: 1000 (100%) Failed Count: 0 (0%) Durations (Avg): DNS :0.0045s Connection :0.4182s TLS :0.1914s Request Write :0.0078s Server Processing :0.2301s Response Read :0.9078s Total :1.7598s Status Code (Message) :Count 200 (OK) :1000
Step 7: Type of the Load Test
Ddosify supports three kind of workloads - Linear
, Incremental
and Waved
. Linear workload injects uniform load over a period of time. This can be tested by using -l linear
option with ddosify command as shown below.
root@cyberithub:~# ddosify -t https://localhost:443 -l linear
Incremental type allows a gradual increase in workload over the time. This can be tested by using -l incremental
option as shown below.
root@cyberithub:~# ddosify -t https://localhost:443 -l incremental
Waved type injects load in crest and trough form. This can be tested by using -l waved
option as shown below.
root@cyberithub:~# ddosify -t https://localhost:443 -l waved
Step 8: Using Config File
Ddosify allows us to use all its capabilities using config file. The features that can be used through config file are as follows:-
- Scenario creation
- Custom load type creation
- Payload from a file
- Multipart/form-data payload
- Extra connection configuration, like keep-alive enable/disable logic
- HTTP2 support
To use the config file, use below command.
ddosify -config <json_config_path>