jmeter-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milamber <>
Subject Re: DNS Cache Manager: improvement for testing CDN
Date Sun, 10 Aug 2014 17:04:05 GMT

I think we can include the new behavior directly in JMeter (and
dns-utils uses the BSD license which is compliant with AL)

Your patch is incomplete, when I try to build a distribution, there are
these errors (ant task test):

     [java] There were 6 failures:
     [java] 1)
Should have no names left: [dnsjava]. Check ApacheJMeter_parent.pom
     [java]     at
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
     [java]     at
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(

==> Add dnsjava in Jmeter pom (ApacheJMeter_parent.pom)

     [java] 2)
Should have no names left: [dnsjava]. Check eclipse.classpath
     [java]     at
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
     [java]     at
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(

==> Add dnsjava in libs section in eclipse.classpath file

     [java] 3)
'dns_cache_manager_title' should be in resource file for
     [java]     at
     [java]     at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(
     [java] 4)
component_reference.xml needs

==> Add the entry in
dns_cache_manager_title=DNS Cache Manager

dns_cache_manager_title=Gestionnaire de cache DNS

'[res_key=dns_cache_manager_title]' anchor for
     [java]     at
     [java]     at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(

     [java] 5)
serialization of org.apache.jmeter.protocol.http.control.DNSCacheManager
failed: org.xbill.DNS.Cache
     [java]     at
     [java]     at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(

     [java] 6)
SaveService nameMap ( should contain
     [java]     at
     [java]     at
     [java]     at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown
     [java]     at
     [java]     at org.apache.jorphan.test.AllTests.main(

==> Add in ./bin/ the
org.apache.jmeter.protocol.http.control.DNSCacheManager entry

     [java] FAILURES!!!
     [java] Tests run: 2530,  Failures: 6,  Errors: 0

In addition,

- don't use wildcard in import directive
import org.xbill.DNS.*;  

- in, some strings must be internationalize (I18N)
+ private static final String ADD_COMMAND = "Add"; // $NON-NLS-1$
+ private static final String DELETE_COMMAND = "Delete"; // $NON-NLS-1$
+ private static final String SYS_RES_COMMAND = "Use system DNS
resolver"; // $NON-NLS-1$
+ private static final String CUST_RES_COMMAND = "Use custom DNS
resolver"; // $NON-NLS-1$
+ private static final String[] COLUMN_RESOURCE_NAMES = {
+ ("NAME/IP"), //$NON-NLS-1$
+ private String DNS_SERVERS_TABLE_NAME="DNS Servers";
+ sysResButton.setToolTipText("Use system DNS resolver");
custResButton.setToolTipText("Use custom DNS resolver");

Note : Add / Delete strings are already in

- the DNS cache panel must offer in default option : Use system DNS
resolver (not the custom)

- Add the default value in setProperty, to allow the save service don't
save the default value in JMX file (only the custom values)

Like this :
public static final String SERIES_SELECTION_REGEXP =
"RespTimeGraph.seriesselectionregexp"; // $NON-NLS-1$
public static final boolean DEFAULT_REGEXP = true;
in configure()
regexpChkBox.setSelected(te.getPropertyAsBoolean(SERIES_SELECTION_REGEXP, DEFAULT_REGEXP));
in modifyTestElement(
te.setProperty(SERIES_SELECTION_REGEXP, regexpChkBox.isSelected(),

- avoid to change code formatting in the same patch with a new behavior
(for a better history of changes)

Like this:
- private SystemDefaultDnsResolver systemDefaultDnsResolver=null;
- private Map<String,InetAddress[]> cache = null;
+ private SystemDefaultDnsResolver systemDefaultDnsResolver = null;
+ private Map<String, InetAddress[]> cache = null;
+ private Resolver resolver = null;
//++ JMX tag values

The better way is to provide a patch with the new behavior and without
code formatting on the existing code, and signal to the dev team that
the code needs a code formatting.

- seems have a bug, when I try to load a JMX file with a DNS cache
manager with the saving configuration : Use system DNS resolver: The
option is transform to "Use custom DNS resolver" and the DNS Servers
table is disabled.

- Add some docs in component_reference.xml

Please provide a patch in diff format (tools like Eclipse make this task
easy) and upload the patch in the Bugzilla (perhaps a new issue, Bug
43730 seems not directly related)


Le 10/08/2014 15:12, Dzmitry_Kashlach a ecrit :
> 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
> <>

> ,  DNS-round-robin-and-JVM-DNS-lookup-caching
> <>
>     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
> <>
> DNSCachePanel
> <>
> <>
> HTTPSamplerBase
> <>
> BTW, there is already an  issue in bugzilla
> <>  , 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:
> Sent from the JMeter - Dev mailing list archive at

View raw message