---
title: "Docker ile 1 Adımda Ddosify Kurulumu ve İncelemesi - Load Testing"
description: "Ddosify nedir? Docker ile kurulum, parametreli ve senaryo bazlı load testing, dinamik değişkenler ve linear, incremental, waved yük tiplerini görün."
image: "https://sezer.in/wp-content/uploads/2022/11/ddosify-logo.webp"
url: "https://sezer.in/ddoisfy-ile-load-testing/"
date: "2022-11-16T14:35:26+03:00"
updated: "2022-11-16T14:43:35+03:00"
author: "Sezer Şanlıkan"
lang: "tr"
source: "https://sezer.in/ddoisfy-ile-load-testing/"
---

# Docker ile 1 Adımda Ddosify Kurulumu ve İncelemesi - Load Testing

## Ddosify Nedir?

Yüksek performanslı yük testi aracıdır. *HTTP, HTTPS* ve *HTTP/2* protokolleri üzerinden destek verir. JSON üzerinden senaryonuzu hazırlayıp tek bir satır kod yazmadan load testlerinizi yapabiliyorsunuz. Farklı yük tipi seçenekleri sunar. Bunlar Linear, Incremental ve Waved olarak geçer. Ddosify'ı macOS & Linux'a kurabilirsiniz, docker üzerinde ayağa kaldırabilirsiniz veya Windowsta bile çalıştırabilirsiniz. Biz en basit kurulum seçeneği olan docker üzerinden ilerleyeceğiz.

## Ddosify Kurulumu

### Docker Kurulumu

Öncelikle işletim sisteminde Docker'ın yüklü olması gerekmektedir. Eğer işletim sisteminizde docker yüklü değilse [aşağıdaki](https://sezer.in/ubuntu-uzerinde-docker-kurulumu/) yazımdan basitçe kurulum adımını uygulayabilirsiniz.

https://sezer.in/ubuntu-uzerinde-docker-kurulumu/

### Ddosify'ın Docker Üzerinden Ayağa Kaldırılması

Aşağıdaki komutla Ddosify'ı ayağa kaldırıp -it ile içerisine doğrudan girebiliriz.

```
docker run -it --rm ddosify/ddosify
```

![ddosify](https://sezer.in/wp-content/uploads/2022/11/image-12.png)

## Kullanım Tipleri

### Basit Kullanım

```
ddosify -t google.com
```

![](https://sezer.in/wp-content/uploads/2022/11/image-13-850x1024.png)

### Parametrelerle Kullanım

Aşağıdaki kodda *-t* hedef adres, *-n* kaç adet istek gönderileceği, *-d* kaç saniye boyunca isteğin devam edeceği, *-p* protokol, *-m* istek tipi, *-T* timeout süresini, -o stdout-json ise çıktının json formatında verilmesini ifade eder.

```
ddosify -t google.com -n 1000 -d 20 -p HTTPS -m PUT -T 7 -o stdout-json
```

![](https://sezer.in/wp-content/uploads/2022/11/image-15.png)

### Senaryo Bazlı Kullanım

Örnek senaryo dosyamız aşağıdaki gibi olsun;

\* config.json

```
{
    "request_count": 20,
    "load_type": "linear",
    "duration": 5,
    "manual_load": [
        {"duration": 5, "count": 5},
        {"duration": 6, "count": 10},
        {"duration": 7, "count": 20}
    ],
    "proxy": "http://proxy_host.com:proxy_port",
    "output": "stdout",
    "steps": [
        {
            "id": 1,
            "url": "https://test_site1.com/endpoint_1",
            "protocol": "https",
            "method": "POST",
            "headers": {
                "Content-Type": "application/xml",
                "header1": "header2"
            },
            "payload": "Body content 1",
            "timeout": 3,
            "sleep": "300-500",
            "auth": {
                "username": "test_user",
                "password": "12345"
            },
            "others": {
                "keep-alive": true,
                "disableCompression": false,
                "h2": true,
                "disable-redirect": true
            }
        },
        {
            "id": 2,
            "url": "https://test_site1.com/endpoint_2",
            "method": "GET",
            "payload_file": "config_examples/payload.txt",
            "timeout": 2,
            "sleep": "1000"
        },
        {
            "id": 3,
            "url": "https://test_site1.com/endpoint_3",
            "method": "POST",
            "payload_multipart": [
                {
                    "name": "[field-name]",
                    "value": "[field-value]"
                },
                {
                    "name": "[field-name]",
                    "value": "./test.png",
                    "type": "file"
                },
                {
                    "name": "[field-name]",
                    "value": "http://test.com/test.png",
                    "type": "file",
                    "src": "remote"
                }
            ],
            "timeout": 2
        }
    ]
}
```

\* payload.txt

```
body file 1111111111
body file 22222222222
```

Ddosify, önce http://proxy_host.com:proxy_port üzerinden basic auth bilgileri ile test_user:12345 3 saniyelik bir zaman aşımı kullanarak https://test_site1.com/endpoint_1 adresine HTTP/2 POST isteği gönderir. Yanıt alındıktan sonra payload.txt dosyasında yer alan payload ile birlikte https://test_site1.com/endpoint_2 adresine HTTPS GET isteğini 2 saniyelik zaman aşımı ile gönderilir. Bu flow 5 saniyede 20 defa tekrarlanacak ve stdout'a yazılacaktır.

```
ddosify -config config.json
```

### Dinamik Değişkenlerle Kullanım

Ddosify , https://target_site.com/{{_randomInt}} adresine 10 saniyede toplam 100 GET isteği gönderir. {{\_randomInt}} path, her istekte 1 ile 1000 arasında rasgele tamsayılar üretir. Dinamik değişkenler *URL*, *headers*, *payload (body)* and *basic authentication* olarak kullanılabilir. Bu örnekte Ddosify, başlıkta rastgele bir user agent ve body'de rastgele bir şehir oluşturur. Dinamik değişkenlerin tam listesine [buradan](https://docs.ddosify.com/extra/dynamic-variables-parameterization) ulaşabilirsiniz.

```
ddosify -t target_site.com/{{_randomInt}} -d 10 -n 100 -h 'User-Agent: {{_randomUserAgent}}' -b '{"city": "{{_randomCity}}"}'
```

### Commandline Flag'leri

| Flag | Description | Type | Default | Required? |
| --- | --- | --- | --- | --- |
| `-t` | Target website URL. Example: [https://ddosify.com](https://ddosify.com/) | `string` | - | Yes |
| `-n` | Total request count | `int` | `100` | No |
| `-d` | Test duration in seconds. | `int` | `10` | No |
| `-p` | Protocol of the request. Supported protocols are *HTTP, HTTPS*. HTTP/2 support is only available by using a config file as described. More protocols will be added. | `string` | `HTTPS` | No |
| `-m` | Request method. Available methods for HTTP(s) are *GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS* | `string` | `GET` | No |
| `-b` | The payload of the network packet. AKA body for the HTTP. | `string` | - | No |
| `-a` | Basic authentication. Usage: `-a username:password` | `string` | - | No |
| `-h` | Headers of the request. You can provide multiple headers with multiple `-h` flag. Usage: `-h 'Accept: text/html'` | `string` | - | No |
| `-T` | Timeout of the request in seconds. | `int` | `5` | No |
| `-P` | Proxy address as host:port. `-P 'http://user:pass@proxy_host.com:port'` | `string` | - | No |
| `-o` | Test result output destination. Supported outputs are [*stdout, stdout-json*] Other output types will be added. | `string` | `stdout` | No |
| `-l` | [Type](https://github.com/ddosify/ddosify#load-types) of the load test. Ddosify supports 3 load types. | `string` | `linear` | No |
| `--config` | [Config File](https://github.com/ddosify/ddosify#config-file) of the load test. | `string` | - | No |
| `--version` | Prints version, git commit, built date (utc), go information and quit | - | - | No |
| `--cert_path` | A path to a certificate file (usually called 'cert.pem') | - | - | No |
| `--cert_key_path` | A path to a certificate key file (usually called 'key.pem') | - | - | No |

## Yük Tipleri

### Linear

```
ddosify -t target_site.com -l linear
```

Aşağıdaki görselden de anlaşılacağı üzere istekler sabit bir oranda iletilir.

![](https://sezer.in/wp-content/uploads/2022/11/linear.gif)

### Incremental

```
ddosify -t target_site.com -l incremental
```

Aşağıdaki resimden de anlaşılacağı üzere istek sayısı doğrusal oranda iletilir.

![](https://sezer.in/wp-content/uploads/2022/11/incremental.gif)

### Waved

```
ddosify -t target_site.com -l waved
```

Aşağıdaki resimden de anlaşıldığı üzere istekler sayısı başlangıçta artık daha sonradan azalan ve tekrardan -artan azalan şeklinde iletilir.

![](https://sezer.in/wp-content/uploads/2022/11/waved.gif)
