Skip to content

Commit 6c6d3ef

Browse files
Sarthak | Updates README
1 parent c58d62c commit 6c6d3ef

File tree

1 file changed

+16
-39
lines changed

1 file changed

+16
-39
lines changed

Diff for: README.md

+16-39
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ All we needed was a tool that can send load (or specific load) on target TCP ser
3737
## Features
3838

3939
**blast** provides the following features:
40-
1. Support for **sending N requests** to the target server.
40+
1. Support for sending **N requests per second per worker**.
4141
2. Support for **reading N total responses** from the target server.
4242
3. Support for **reading N successful responses** from the target server.
4343
4. Support for **customizing** the **load** **duration**. By default, blast runs for 20 seconds.
44-
5. Support for sending N requests to the target server with the specified **concurrency** **level**.
44+
5. Support for sending requests to the target server with the specified **concurrency level**.
4545
6. Support for **establishing N connections** to the target server.
4646
7. Support for specifying the **connection timeout**.
47-
8. Support for specifying **requests per second** (also called **throttle**).
48-
9. Support for **printing** the **report**.
47+
8. Support for **printing** the **report**.
48+
9. Support for sending dynamic payloads with **PayloadGenerator**.
4949

5050
## Installation
5151

5252
### MacOS
5353

5454
1. **Download the current release**
5555

56-
`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.3/blast_Darwin_x86_64.tar.gz`
56+
`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.6/blast_Darwin_x86_64.tar.gz`
5757

5858
3. **Unzip the release in a directory**
5959

@@ -63,7 +63,7 @@ All we needed was a tool that can send load (or specific load) on target TCP ser
6363

6464
1. **Download the current release**
6565

66-
`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.3/blast_Linux_x86_64.tar.gz`
66+
`wget -o - https://github.com/SarthakMakhija/blast/releases/download/v0.0.6/blast_Linux_x86_64.tar.gz`
6767

6868
2. **Unzip the release in a directory**
6969

@@ -73,11 +73,10 @@ All we needed was a tool that can send load (or specific load) on target TCP ser
7373

7474
| **Flag** | **Description** |
7575
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
76-
| n | Number of requests to run. **Default is 1000.** |
7776
| c | Number of workers to run concurrently. **Default is 50.** |
7877
| f | File path containing the payload. |
79-
| rps | Rate limit in requests per second per worker. **Default is no rate limit.** |
80-
| z | Duration of the blast to send requests. **Default is 20 seconds.** |
78+
| rps | Rate limit in requests per second per worker. **Default is 50.** |
79+
| z | Duration of the blast to run. **Default is 20 seconds.** |
8180
| t | Timeout for establishing connection with the target server. **Default is 3 seconds.** |
8281
| Rr | Read responses from the target server. **Default is false.** |
8382
| 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
9392

9493
Yes.
9594

96-
The following command sends 200000 requests, over 10 TCP connections using 100 concurrent workers.
95+
The following command sends 100 requests per second per worker, over 10 TCP connections using 100 concurrent workers.
9796
```sh
98-
./blast -n 200000 -c 100 -conn 10 -f ./payload localhost:8989
97+
./blast -rps 100 -c 100 -conn 10 -f ./payload localhost:8989
9998
```
10099

101100
2. **Are the workers implemented using goroutines?**
102101

103102
Yes, workers are implemented as cooperative goroutines. You can refer the code [here](https://github.com/SarthakMakhija/blast/blob/main/workers/worker.go).
104103

105-
3. **I want to send 1001 requests using 100 workers. How many requests will each worker send?**
106-
107-
Let's consider two cases.
108-
109-
**Case1**: Total requests % workers = 0. Let's consider **200 requests** with **10 workers**. **Each** **worker** will send **20 requests**.
110-
111-
**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**.
112-
113-
You can refer the code [here](https://github.com/SarthakMakhija/blast/blob/main/workers/worker_group.go#L52).
114-
115-
4. **Can I create more connections than workers?**
104+
3. **Can I create more connections than workers?**
116105

117106
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`.
118107
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
156145

157146
8. **What is the significance of Rrd flag in blast?**
158147

159-
`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:
160-
161-
`./blast -n 200000 -c 100 -conn 100 -f ./payload -Rr -Rrs 19 -Rrd 10ms -Rtr 200000 localhost:8989`.
162-
163-
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.
164-
165-
## Screenshots
166-
167-
- **Sending load on the target server:** `./blast -n 200000 -c 100 -conn 100 -f ./payload localhost:8989 2> err.log`
168-
169-
<img width="715" alt="Sending load on the target server" src="https://github.com/SarthakMakhija/blast/assets/21108320/0eca825c-22e5-4120-9460-cf5eead92c9b">
170-
171-
- **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`
172-
173-
<img width="715" alt="Reading responses from the target server" src="https://github.com/SarthakMakhija/blast/assets/21108320/d15a1782-b1e6-4200-b697-1083015c3cb3">
148+
`Rrd` is the read response deadline flag that defines the deadline for the read calls on connections.
149+
This flag helps in understanding the responsiveness of the target server. Let's consider that we are running **blast** with the following command:
174150

175-
- **Error distribution:** `./blast -n 200000 -c 100 -conn 100 -f ./payload localhost:8989 2> err.log`
151+
`./blast -c 100 -conn 100 -f ./payload -Rr -Rrs 19 -Rrd 10ms -Rtr 200000 localhost:8989`.
176152

177-
<img width="715" alt="Error distribution" src="https://github.com/SarthakMakhija/blast/assets/21108320/b4ca41cd-17ea-497e-9290-29eeb8ba2089">
153+
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
154+
then timeout if there is no response on the underlying connection.
178155

179156
## References
180157
[hey](https://github.com/rakyll/hey)

0 commit comments

Comments
 (0)