Closed chadell closed 6 years ago
my goal was just avoid resolving a DNS each TCP connection because the tcpgoon is only to stress TCP not DNS. So I would force this DNS caching by default unless you have other ideas/suggestion on it
I've checked that it's only done once per execution. Not issue at all.
@chadell : Can you revisit this and provide more details about your tests? Please, use the binary generated by the compilation scripts/travis, or the docker image, rather than a "go run" or a direct "go build" in your machine, as the resolver may differ (we compile without cgo to avoid linking dynamically against libs, so it may mean your binary use the golang resolver, that behaves different)
@dcaba you were right, using the binary I've checked that multiple DNS queries are generated...
https://golang.org/pkg/net/#hdr-Name_Resolution
@dcaba , regarding the above document, using -tags netcgo
could solve this (I double checked it). do you have any argument to move to cgo resolver instead of pure Go? (I don't think the dns blocking is a big issue because without it we can't do anything)
It'd be nice, but probably you will generate a binary dynamically linked against libc. So pure go looks the most portable option, but probably means using https://golang.org/pkg/net/#LookupIP before calling the Dial function (this is like the "most basic" discovery mechanism we will need to implement xD)
In order to test individual instances (closer to the mission of the project), this may have sense, but keeping the original mode with a flag could be an option. Any other rationale behind changing the mode?