Gatling with load balanced IP hash Nginx

I’m load testing a Tomcat web application with 4 nodes. Those nodes are configured through Nginx with ip_hash:

ip_hash; server example:8888 weight=2 max_fails=3 fail_timeout=10s; server example:8888 weight=4 max_fails=3 fail_timeout=10s; server example:8888 weight=2 max_fails=3 fail_timeout=10s; server example:8888 weight=2 max_fails=3 fail_timeout=10s;

Anyway, I use Gatling for load and performance testing but everytime when I start a test all traffic is routed to one node… Only when I change the load balance node to least_conn of round robin then the traffic is divided. But this application needs a persistent node to do the work.

Is there any way to let Gatling route the traffic to all 4 nodes during a run? Maybe with a setup configuration? I’m using this setUp right now:

setUp(scenario1.inject( atOnceUsers(50), rampUsers(300) over (1800 seconds), ).protocols(httpConf) )

Thank you!

https://gatling.io/docs/2.3/http/http_protocol/#local-address

https://en.wikipedia.org/wiki/IP_aliasing

The web application is reachable by the full url, so only the upstream url defined in Nginx…

You got it wrong. Please read again: LOCAL address.

Do you may have some example? Thank you!