[httperf] Modify httperf to do host lookups for each request
arlitt at hpl.hp.com
Thu Apr 6 07:02:52 PDT 2006
> So my questions are: Do any of you have tips on how I can modify the
> code so that there is one DNS lookup (gethostbyaddr()) per HTTP query?
> Is this a good idea, or should I look for alternative solutions? I
> have not come across any viable alternatives so far.
as I'm sure you understand, httperf was designed to evaluate the
performance of a Web server. as a result, httperf caches the dns lookup
information, so that httperf stresses the Web server and not the dns
server. in core_connect() of core.c httperf calls hash_lookup to
retrieve the cached information. also, I assume you mean one dns
lookup per TCP connection established, i.e., you are not sending multiple
HTTP requests over a persistent TCP connection.
I have several suggestions.
1. if you are not dealing with high request rates, you could just invoke
httperf for each request; there would be some overhead for caching the dns
lookup information, but in most cases that should be small relative to the
dns lookup time. of course this could complicate your experimental setup.
2. if you want to modify httperf to do a dns lookup for each new TCP
connection that is established, you could replace the call to hash_lookup
in core_connect with a dns lookup.
please note that I haven't attempted this, so there may be some side
effects that you need to handle.
More information about the httperf