简体   繁体   中英

JMeter DNS Cache manager not working when adding multiple IP adressess for one host

I'm building a JMeter testplan for a NLB farm. In order to get the JMeter test users to all servers in the NLB farm I'm using the DNS Cache Manager (otherwise all tests will go to one server of the farm). I've created multiple Static Host Table entries with the same URL, but each with a unique IP address (eg: bla.url.com -> 10.10.10.10 bla.url.com -> 10.10.10.11, etc.)

But all test sessions go to the first entry in the host table instead of "round robin" around the multiple entries.

I've tried the following: - Used system host file instead of DNS cache manager - Enabled clear cache each iteration in DNS cache manager - Disabled Java cache in Java security properties

You're misusing the DNS Cache Manager, Static Host Table feature is basically implementation of the hosts file where you can add IP addresses to hostnames mapping just in case you cannot do it on operating system level (ie due to lack of admin rights).

For particular your scenario it would be just enough to simply add the DNS Cache Manager to your Test Plan to enable per-thread DNS resolution instead of relying on underlying Java/operating system implementations. And you should specify a single entry point like hostname of your load balancer instead of listing all the backend hostnames under the static host table.

More information: The DNS Cache Manager: The Right Way To Test Load Balanced Apps

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM