forked from Tantalor93/dnspyre
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option for rate limitting concurrent workers
- Loading branch information
Ondřej Benkovský
committed
Jul 9, 2023
1 parent
f2479a3
commit a17ddcb
Showing
5 changed files
with
89 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ GEM | |
PLATFORMS | ||
arm64-darwin-21 | ||
universal-darwin-22 | ||
universal-darwin-23 | ||
x86_64-darwin-19 | ||
x86_64-linux | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Rate limiting | ||
layout: default | ||
parent: Examples | ||
--- | ||
|
||
# Rate limiting | ||
dnspyre supports rate limiting number of queries send per second, for that you can use `--rate-limit` and `--rate-limit-worker` flags | ||
|
||
`--rate-limit` is used for setting a global rate limit, meaning that all concurrent workers spawned based on `--concurrency` flag will share this limit. | ||
It might happen, that some workers will be starving and the load generated by the `dnspyre` will not be evenly generated from all workers. | ||
|
||
For example this will generate load for 10 seconds using 10 concurrent workers and limit the load to 1 query per second | ||
``` | ||
dnspyre --duration 10s -c 10 --rate-limit 1 --server '8.8.8.8' google.com | ||
``` | ||
|
||
\ | ||
`--rate-limit-worker` is used for setting a rate limit **separately** for each concurrent worker spawned based on `--concurrency` flag. | ||
|
||
For example this will generate load for 10 seconds using 10 concurrent workers and limit the load generated by each worker to 1 query per second | ||
``` | ||
dnspyre --duration 10s -c 10 --rate-limit-worker 1 --server '8.8.8.8' google.com | ||
``` |