Releases: c3l3si4n/pugdns
Releases · c3l3si4n/pugdns
v1.0.5
v.1.0.4 - Major Improvements
feat(perf): Implement major performance optimizations and profiling
This commit introduces a series of significant performance enhancements across the entire application, focusing on optimizing the critical packet generation and sending paths. A new performance profiling system has also been added to help identify bottlenecks.
* **Packet Generation Overhaul**:
* Replaced the repeated use of `gopacket.SerializeLayers` with a highly optimized manual packet-building process.
* A single packet template (Ethernet/IP/UDP headers) is created at startup.
* For each domain, this template is cloned, and its headers are mutated with dynamic data (IP ID, Dst IP, Src Port, lengths).
* Manual and efficient checksum calculation is now used for both IP and UDP layers, avoiding gopacket's overhead.
* **Concurrency and State Management**:
* Replaced the global `sync.Mutex` protecting the `domainStates` map with a `haxmap` for high-performance, concurrent read/write access.
* Added a fine-grained mutex to the `DomainStatus` struct to prevent contention when updating the status of individual domains.
* The main manager loop was converted from a busy-wait `select/default` to a more efficient `time.Ticker`.
* **Asynchronous Processing & I/O**:
* Domain list reading (`readDomainsFromFile`) now reads the entire file at once, which is faster for typical list sizes.
* Domain normalization and deduplication are now performed asynchronously in a separate goroutine, allowing the packet sending process to start sooner.
* The final cache saving (`saveCachePrettified`) is now parallelized using a worker pool to handle JSON marshalling, dramatically speeding up file writing for large result sets.
* **Performance Profiling**:
* Introduced a new profiling utility to measure the time spent in critical functions (`PacketPrep`, `Sender_Transmit`, `Manager_RetryCheck`, etc.).
* When in verbose mode, a `bottleneckReporter` goroutine periodically prints a summary of where time is being spent.
* A final, comprehensive performance report is printed at the end of the run.
* The packet sender now implements smart batching, requesting UMEM descriptors based on the number of waiting packets and available TX slots.
* The sender uses `runtime.Gosched()` to yield the CPU when the queue is empty, reducing CPU usage during lulls.
Bug fixes!
Full Changelog: v1.0.2...v1.0.3
Bug fixes!
v1.0.2 Fix: Filter empty authority records
v1.0.1
Full Changelog: v1.0.0...v1.0.1
v1.00 - Major Release
PugDNS v1.0.0 - The Leap Forward! 🚀
This is the first major release of PugDNS (v1.0.0)! It contains major overhauls from previous development versions, focusing significantly on performance, reliability, and observability for high-speed DNS querying using AF_XDP and eBPF.
We've rebuilt core components to provide a more robust and efficient experience. If you've tried earlier versions, you'll find v1.0.0 is a significant step up.
✨ Key Highlights & Improvements:
- 🚀 Enhanced Performance & Throughput:
- BPF Worker Pool: Introduced a concurrent worker pool in the Go user-space application to parse incoming DNS responses from the BPF ring buffer in parallel, dramatically increasing processing capacity.
- Optimized Packet Transmission: Refined AF_XDP packet sending logic using batching and improved descriptor handling via a dedicated sender goroutine.
- Efficient eBPF: The underlying eBPF program (
pugdns.c) has been refactored to efficiently pass metadata and packet payloads, usingbpf_probe_read_kernelfor better performance and verifier compatibility. Tuned XDP socket options for better frame/descriptor allocation.
- 🛡️ Improved Reliability & Query Management:
- Retry Logic: Implemented robust domain status tracking. PugDNS now automatically retries queries for domains that haven't received a response after a configurable timeout, up to a specified number of attempts.
- Managed Transmission: Replaced the previous "send-all" approach with a central manager that controls the flow of initial queries and retries, ensuring resources are used effectively.
- 📊 Better Observability & Statistics:
- Drop Monitoring: Added counters and warnings for both kernel-level drops (e.g., BPF ring buffer full) and user-space drops (e.g., processing queue full), helping diagnose bottlenecks.
- Domain-Centric Stats: The statistics display (both UI and text mode) now focuses on the progress of domains (Total, Responded, Retrying, Failed), providing a clearer picture of the query campaign's success, alongside raw packet rates.
- ⚙️ Enhanced Configuration & Usability:
- New Config Options: Added flags to configure the number of BPF workers (
-workers), AF_XDP poll timeout (-poll), and query retries (-retries). - Pretty JSON Output: Results saved to the output file are now formatted in a more readable "pretty" JSON structure.
- Clearer Setup: Added installation and build instructions to the
README.md.
- New Config Options: Added flags to configure the number of BPF workers (
Full Changelog: https://github.com/c3l3si4n/pugdns/commits/v1.0.0