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

928 views
Skip to first unread message

Pablo Fernandez

unread,
Nov 6, 2013, 3:26:55 PM11/6/13
to gat...@googlegroups.com
Hi guys,

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

scala> java.net.InetAddress.getAllByName("my.proxy.net")
res0: Array[java.net.InetAddress] = Array(my.proxy.net/10.70.129.38, my.proxy.net/10.70.5.7)

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.

Stéphane Landelle

unread,
Nov 6, 2013, 4:09:42 PM11/6/13
to gat...@googlegroups.com
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?



2013/11/6 Pablo Fernandez <fernande...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Gatling User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gatling+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Stéphane Landelle

unread,
Nov 6, 2013, 4:20:16 PM11/6/13
to gat...@googlegroups.com
Note that you can also have Gatling perform load balancing for you with baseUrls: https://github.com/excilys/gatling/wiki/HTTP#wiki-base-url

Pablo Fernandez

unread,
Nov 6, 2013, 4:46:07 PM11/6/13
to gat...@googlegroups.com
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(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)

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

Stéphane Landelle

unread,
Nov 7, 2013, 3:45:59 AM11/7/13
to gat...@googlegroups.com
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.

Cheers,

Stéphane
Reply all
Reply to author
Forward
0 new messages