From 6c6d3ef13c5532f2d7d611213b0956c46c598be7 Mon Sep 17 00:00:00 2001 From: Sarthak Date: Thu, 28 Mar 2024 11:45:14 +0530 Subject: [PATCH] Sarthak | Updates README --- README.md | 55 ++++++++++++++++--------------------------------------- 1 file changed, 16 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index f39dcb5..0435a4b 100644 --- a/README.md +++ b/README.md @@ -37,15 +37,15 @@ All we needed was a tool that can send load (or specific load) on target TCP ser ## Features **blast** provides the following features: -1. Support for **sending N requests** to the target server. +1. Support for sending **N requests per second per worker**. 2. Support for **reading N total responses** from the target server. 3. Support for **reading N successful responses** from the target server. 4. Support for **customizing** the **load** **duration**. By default, blast runs for 20 seconds. -5. Support for sending N requests to the target server with the specified **concurrency** **level**. +5. Support for sending requests to the target server with the specified **concurrency level**. 6. Support for **establishing N connections** to the target server. 7. Support for specifying the **connection timeout**. -8. Support for specifying **requests per second** (also called **throttle**). -9. Support for **printing** the **report**. +8. Support for **printing** the **report**. +9. Support for sending dynamic payloads with **PayloadGenerator**. ## Installation @@ -53,7 +53,7 @@ All we needed was a tool that can send load (or specific load) on target TCP ser 1. **Download the current release** -`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.3/blast_Darwin_x86_64.tar.gz` +`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.6/blast_Darwin_x86_64.tar.gz` 3. **Unzip the release in a directory** @@ -63,7 +63,7 @@ All we needed was a tool that can send load (or specific load) on target TCP ser 1. **Download the current release** -`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.3/blast_Linux_x86_64.tar.gz` +`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.6/blast_Linux_x86_64.tar.gz` 2. **Unzip the release in a directory** @@ -73,11 +73,10 @@ All we needed was a tool that can send load (or specific load) on target TCP ser | **Flag** | **Description** | |----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| n | Number of requests to run. **Default is 1000.** | | c | Number of workers to run concurrently. **Default is 50.** | | f | File path containing the payload. | -| rps | Rate limit in requests per second per worker. **Default is no rate limit.** | -| z | Duration of the blast to send requests. **Default is 20 seconds.** | +| rps | Rate limit in requests per second per worker. **Default is 50.** | +| z | Duration of the blast to run. **Default is 20 seconds.** | | t | Timeout for establishing connection with the target server. **Default is 3 seconds.** | | Rr | Read responses from the target server. **Default is false.** | | Rrs | Read response size is the size of the responses in bytes returned by the target server. | @@ -93,26 +92,16 @@ All we needed was a tool that can send load (or specific load) on target TCP ser Yes. -The following command sends 200000 requests, over 10 TCP connections using 100 concurrent workers. +The following command sends 100 requests per second per worker, over 10 TCP connections using 100 concurrent workers. ```sh -./blast -n 200000 -c 100 -conn 10 -f ./payload localhost:8989 +./blast -rps 100 -c 100 -conn 10 -f ./payload localhost:8989 ``` 2. **Are the workers implemented using goroutines?** Yes, workers are implemented as cooperative goroutines. You can refer the code [here](https://github.com/SarthakMakhija/blast/blob/main/workers/worker.go). -3. **I want to send 1001 requests using 100 workers. How many requests will each worker send?** - -Let's consider two cases. - -**Case1**: Total requests % workers = 0. Let's consider **200 requests** with **10 workers**. **Each** **worker** will send **20 requests**. - -**Case2**: Total requests % workers != 0. Let's consider **1001 requests** with **100 workers**. **blast** will end up sending **1100 requests**, and **each worker** will send **11 requests**. - -You can refer the code [here](https://github.com/SarthakMakhija/blast/blob/main/workers/worker_group.go#L52). - -4. **Can I create more connections than workers?** +3. **Can I create more connections than workers?** No, you can not create more connections that workers. The relationship between the concurrency and the workers is simple: `concurrency % workers must be equal to zero`. This means, we can have 100 workers with 10 connections, where a group of 10 workers will share one connection. @@ -156,25 +145,13 @@ byte slice) that [ResponseReader](https://github.com/SarthakMakhija/blast/blob/m 8. **What is the significance of Rrd flag in blast?** -`Rrd` is the read response deadline flag that defines the deadline for the read calls on connections. This flag helps in understanding the responsiveness of the target server. Let's consider that we are running **blast** with the following command: - -`./blast -n 200000 -c 100 -conn 100 -f ./payload -Rr -Rrs 19 -Rrd 10ms -Rtr 200000 localhost:8989`. - -Here, `Rrd` is 10 milliseconds, this means that the `read` calls in [ResponseReader](https://github.com/SarthakMakhija/blast/blob/main/report/response_reader.go) will block for 10ms and then timeout if there is no response on the underlying connection. - -## Screenshots - -- **Sending load on the target server:** `./blast -n 200000 -c 100 -conn 100 -f ./payload localhost:8989 2> err.log` - - Sending load on the target server - -- **Reading responses from the target server:** `./blast -n 200000 -c 100 -conn 100 -f ./payload -Rr -Rrs 19 -Rtr 200000 localhost:8989 2> err.log` - - Reading responses from the target server +`Rrd` is the read response deadline flag that defines the deadline for the read calls on connections. +This flag helps in understanding the responsiveness of the target server. Let's consider that we are running **blast** with the following command: -- **Error distribution:** `./blast -n 200000 -c 100 -conn 100 -f ./payload localhost:8989 2> err.log` +`./blast -c 100 -conn 100 -f ./payload -Rr -Rrs 19 -Rrd 10ms -Rtr 200000 localhost:8989`. - Error distribution +Here, `Rrd` is 10 milliseconds, this means that the `read` calls in [ResponseReader](https://github.com/SarthakMakhija/blast/blob/main/report/response_reader.go) will block for 10ms and +then timeout if there is no response on the underlying connection. ## References [hey](https://github.com/rakyll/hey)