The problems:
- The business wants to know what our response times look like to real-world clients
- The application is sensitive to source IP in its load balancer, so we need to have traffic coming from multiple IP addresses
Possible solutions:
- a cluster of instances of Gatling, e.g. running on AWS
- one gatling instance, routing its traffic through a number of web proxies, running on AWS
Do you prefer one over the other? And is the second one even doable? Would it be possible to make it so that each virtual user is configured to hit a different proxy server?
Currently, what I’ve been doing is solution #1, but on Rackspace (I work there). I have a Jenkins master configured with 2 extra beefier nodes as slaves. For isolation, each node can only run 1 build at a time. The slaves are targeted by labels. Then I configured a Job to use the Workflow plugin, and setup the job to this Workflow script https://github.com/meteorfox/gatling-workflow/blob/master/gatling_flow.groovy
With that workflow script, it will configure both nodes in parallel, get the Gatling simulations, and start them at roughly the same time. Finally at the end it aggregates the simulation logs from each Gatling client,
and generates a report.
It works kind of OK, if one of the slaves takes longer to start, then they will be out of sync. I’m working on a new primitive (i.e. rendezvous) for Workflow, to fix this problem.
https://github.com/meteorfox/workflow-plugin/tree/rendezvous-step
Alternatively, for solution #2 you could have them ‘whitelist’ the IP address of your load client(s) in the LB to go around the problem of stickiness. Another way is to use IP spoofing, here’s a tutorial to do that in JMeter https://blazemeter.com/blog/using-ip-spoofing-simulate-requests-different-ip-addresses-jmeter I assume there’s gotta be a way to accomplish the same in Gatling.
Cheers,
Carlos
Recently localAddress was contributed that can help with the IP spoofing:
https://github.com/gatling/gatling/issues/2725
The term “IP spoofing” is an abuse: AFAIK it’s impossible to do IP spoofing on the JVM.
The only thing you can do is to bind on a valid local hostname. You can’t impersonate whatever hostname.