{"id":13587129,"url":"https://github.com/leshow/nailgun","last_synced_at":"2025-04-22T19:30:48.364Z","repository":{"id":38000215,"uuid":"341006594","full_name":"leshow/nailgun","owner":"leshow","description":"a dns performance testing client written in Rust","archived":false,"fork":false,"pushed_at":"2022-07-03T17:30:24.000Z","size":557,"stargazers_count":81,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-12T03:47:46.887Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leshow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-21T21:20:36.000Z","updated_at":"2025-01-11T21:08:45.000Z","dependencies_parsed_at":"2022-09-19T22:33:07.960Z","dependency_job_id":null,"html_url":"https://github.com/leshow/nailgun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Fnailgun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Fnailgun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Fnailgun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Fnailgun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leshow","download_url":"https://codeload.github.com/leshow/nailgun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250308206,"owners_count":21409224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:06:02.299Z","updated_at":"2025-04-22T19:30:48.045Z","avatar_url":"https://github.com/leshow.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# nailgun\n\n`nailgun` is a DNS performance testing client written in Rust using `trust-dns-proto` and `tokio`. Open to PRs, issues, comments!\n\n`nailgun` is written as a hobby project first and foremost, it's inspired by flamethrower and copies some of its arguments. It is single-threaded by default but configurable to use many threads. You can specify both the number of traffic generators (with `tcount`) and the number of tokio worker threads (with `wcount`), `nailgun` will start `tcount * wcount` generators. Most of the time, this is not necessary as 1 concurrent generator and a single worker thread is more than enough. Testing against a local `dnsdist` instance configured to return instantly with `NXDOMAIN`, (yes, not a real-world benchmark) `nailgun` can do well over 250K QPS (1 worker thread \u0026 generator).\n\n`nailgun` uses `tracing` for logging so `RUST_LOG` can be used in order to control the logging output.\n\n## Features\n\n### Rate limiting\n\nYou can specify a specific QPS with `-Q`, this allows you to set a desired QPS rate which will be divided up over all the senders.\n\n### Output\n\n`--output` allows you to specify different logging formats, courtesy of `tracing`. \"pretty\", \"json\" and \"debug\" are currently supported with \"pretty\" as the default. You can use `RUST_LOG` to filter on the output (ex. `RUST_LOG=\"naildns=trace\"` will print trace level from the `naildns` bin only). `nailgun` uses stdout by default, but will log to file if you accompany this with the `-o` flag and a path.\n\nRegardless of these options, a summary is printed to stdout sans-tracing after the run is over.\n\n### Generators\n\nThere are multiple generator types available with `-g`, the default is `static` but you can generate queries from file also or with some portion randomly generated.\n\n### DoH (new!)\n\n`nailgun` can now send DoH messages!\n\n```\nnaildns dns.google -Q 2 -P doh\n```\n\n## Usage\n\n```\nnaildns --help\n```\n\nBy default, nailgun will spawn a single threaded tokio runtime and 1 traffic generator:\n\n```\nnaildns 0.0.0.0 -p 1953\n```\n\nThis can be scaled up:\n\n```\nnaildns 0.0.0.0 -p 1953 -w 16 -t 1\n```\n\nWill spawn 16 OS threads (`w`/`wcount`) on the tokio runtime and 1 traffic generator (`t`/`tcount`) per thread spawned, for a total of 16\\*1 = 16 traffic generators.\n\n**Note** If you want a quick server to test against, I've been spinning up `dnsdist` and adding `addAction(AllRule(), RCodeAction(3))` to its config so that all DNS messages immediately return with `NXDomain`.\n\n### Building \u0026 Installing\n\nTo build locally:\n\n```\ncargo build --release\n```\n\n`naildns` binary will be present in `target/release/naildns`\n\n#### From crates.io\n\n#### Local\n\nTo install locally\n\n```\ncargo install\n```\n\n### TODO\n\n- throttle based on # of timeouts\n- first batch of messages always seems to be double the set QPS (try `--limit-secs 5 -Q 10` for example, it will end up sending 60 queries)\n- some TODO cleanups left in the code to address\n- arg parsing for generator is very different from flamethrower because clap doesn't seem to support parsing it in the same style-- would be nice to figure this out\n- ~~combine logging output from all generators rather than having them run individually~~\n- more generator types?\n- maybe leverage other parts of trustdns to make options for interesting types of queries. DOT? ~~DOH~~?\n- suggestions? bugs?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshow%2Fnailgun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleshow%2Fnailgun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshow%2Fnailgun/lists"}