Hi JMeter Team,
JMeter has a problem with testing services that have DNS round-robin
balancing, CDNs in particular. The paradigm “1 thread” =”1 virtual user” is
used in majority of tests and it would be logical, if every virtual user
resolved address on its own. JVM DNS cache prevents from it.
I’ve done some research in JMeter mailing lists and found several
user-requests with the same problem: DNS-Cache-when-using-Amazon-ELB
<http://jmeter.512774.n5.nabble.com/DNS-Cache-when-using-Amazon-ELB-td5715972.html>
, DNS-round-robin-and-JVM-DNS-lookup-caching
<http://jmeter.512774.n5.nabble.com/DNS-round-robin-and-JVM-DNS-lookup-caching-td524221.html>
Completely turning off JVM DNS cache doesn’t solve the problem ideally
because in this case DNS request are sent too often.
I’ve developed DNS Cache Manager for obtaining desired behavior “1
virtual user - 1 DNS cache”. But this plugin requires changes in
HTTPSamplerBase code to pass to HTTP Client alternative DNS resolver. For
now, HTTPSamplerBase does not apply third-party config elements because of
hardcoded list of class names.
Plugin was successfully tested huge CDN provider and I would like to share
it with community, because it could be usefull in performance testing.
I see two possible ways to contribute it:
1. I can prepare a patch with minimal changes, which make HTTP Sampler able
to apply third-party config elements and allow to change default DNS
resolver to alternate. This allows not to include required dnsjava library
into JMeter and not commit full code of DNS Cache Manager into repository.
2. We can simply commit all changes in JMeter, add dnsjava as dependency,
and get flexible DNS Cache Manager out-of-box. You can see implementation
via the following links:
DNSCacheManager
<https://github.com/Blazemeter/jmeter/blob/2d3ccd00f4b824e43cb8c1ea2cb5f19cd7cf56b0/src/protocol/http/org/apache/jmeter/protocol/http/control/DNSCacheManager.java>
DNSCachePanel
<https://github.com/Blazemeter/jmeter/blob/2d3ccd00f4b824e43cb8c1ea2cb5f19cd7cf56b0/src/protocol/http/org/apache/jmeter/protocol/http/gui/DNSCachePanel.java>
HTTPHC4Impl
<https://github.com/Blazemeter/jmeter/blob/2d3ccd00f4b824e43cb8c1ea2cb5f19cd7cf56b0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHC4Impl.java>
HTTPSamplerBase
<https://github.com/Blazemeter/jmeter/blob/2d3ccd00f4b824e43cb8c1ea2cb5f19cd7cf56b0/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java>
BTW, there is already an issue in bugzilla
<https://issues.apache.org/bugzilla/show_bug.cgi?id=43730> , related to
this problem.
I’d like to hear comments from contributors about my suggestion, please
guide me.
Thanks,
Dzimitry
--
View this message in context:
http://jmeter.512774.n5.nabble.com/DNS-Cache-Manager-improvement-for-testing-CDN-tp5720797.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.