Dns round-robin not working despite *cache.ttl java options being set

Hi guys,

I’m running gatling against a bunch of servers load balanced over dns:

res0: Array[java.net.InetAddress] = Array(my.proxy.net/, my.proxy.net/

I also changed gatling.sh to avoid the JDK dns cache:

// gatling.sh last line
java -Dnetworkaddress.cache.ttl=0 -Dsun.net.inetaddr.ttl=0 $JAVA_OPTS -cp $CLASSPATH io.gatling.app.Gatling $@

However, running tcpdump I see that only one of the servers is taking all the hits. Is this something that I have to configure in Gatling (keep-alive, connection pooling, etc)?

Thanks for the help.

networkaddress.cache.ttl can’t be set on the command line, it has to be set up in java.security.

However, -Dsun.net.inetaddr.ttl=0 has the same effect.

Which version of Gatling do you use?
Which JDK?
What does your simulation look like? Do you have several users?

Note that you can also have Gatling perform load balancing for you with
baseUrls: https://github.com/excilys/gatling/wiki/HTTP#wiki-base-url

Hi Stéphane,

Thanks for answering.

Which version of Gatling do you use?

2.0.0-M3a (the latest at the time of this writing)

Which JDK?

java version “1.7.0”
Java™ SE Runtime Environment (build 1.7.0-b147)
Java HotSpot™ 64-Bit Server VM (build 21.0-b17, mixed mode)

What does your simulation look like? Do you have several users?

Here’s the scenario:


Hi Pablo,

I don’t see a reason why setting -Dsun.net.inetaddr.ttl=0 wouldn’t work.
Someone had an issue with Amazon ELB and it did fix the problem.

At this point, I advice you go with my previous suggestion and have Gatling do the round robin with baseUrls.