I run both Gatling and a server under test on the same Linux box. The issue is Gatling takes about 75% of CPU, resulting in degrading server performance. Say, with ApacheBench I get about 22 Krps (and about 80 Krps for keep-alive connections) while with Gatling about 15 Krps (and have not found a difference with added 'connection" → “keep-alive” header to request - it seems Gatling ignores it).
Any configuration tips to cure the issue?
Gatling 2 is in use. Used simulation is trivial and is shown below.
class Ti extends Simulation {
val httpConf = httpConfig.baseURL(“http://localhost:8910”)
val headers_1 = Map(“connection” → “Keep-Alive”)
val scn = scenario(“Tiscaf Ok”)
.repeat(200) {
exec(http(“request_1”)
.get("/ok")
//.headers(headers_1) // have tried both cases
)
}
setUp(scn.inject(atOnce(1000 user)).protocolConfig(httpConf))
}
Also note that you’re launching 1000 users at once, so all the users are as much in sync as possible, resulting in periodic hammering peaks. Don’t you want to ramp a bit so that they’re not in sync?
Well…
- … more functionalities come with a price.
Absolutely agree - features have cost
- I must say 15 Krps is pretty cool, I’ve never pushed Gatling this far myself
You didn’t use light servers, I guess
- Running both the server and the injector on the same box is not something you should do once you’re done with setting things up and want to get real results. You don’t even test your network this way
Sure, but at the moment I play with those cards which have in hands.
- Difficult to help improving things without some JVM profiling. Maybe setting shareConnections on httpConf could help, not sure.
Thanks! - will dig in… Just wanted to be sure haven’t missed something essential.
A ramp doesn’t change a picture at my case.
You didn't use light servers, I guess
Exactly.. Most of my everyday consulting implies JEE, Hibernate, SGBDR...
What does your server look like? httpd or nginx?
It’s old own one: http://gaydenko.com/scala/tiscaf/httpd/
I have tried to add
shareConnections = true
to Gatling http config but haven’t noticed any changes.
Interesting thread.
Andrew was are your hardware configuration for injector and server ?
For server, are you using this ?
http://gaydenko.com/scala/tiscaf/httpd/bench.txt
Cheers
Yes, both Gatling and server run on the same Linux box, but without overclocking (having legal 2.8 GHz instead of 3.2 GHz for CPU frequency, last one is Intel i5 760).
You can try to increase Akka’s throughput: change to akka-defaults.conf file to:
akka {
scheduler {
tick-duration = 50ms
}
actor {
default-dispatcher {
throughput = 5
}
}
Then I’m out of suggestions without JVM profiling.
Anyway, there’s no way Gatling can really compete with tools such as ab for stressing systems without scenarios and only 2 bytes responses.
You can try to increase Akka’s throughput: change to akka-defaults.conf file to:
akka {
scheduler {
tick-duration = 50ms
}
actor {
default-dispatcher {
throughput = 5
}
}
Thanks, I will play with these configuration options.
Anyway, there’s no way Gatling can really compete with tools such as ab for stressing systems without scenarios and only 2 bytes responses.
Yes, we have already discussed this moment, and I’m completely agree with you. Gatling is a perfect tool in it’s own (scenarios themselves and scenario recording). In that real scenario I have discovered Gatling for, last one takes 1-5% of CPU, being 1-2 order lighter rather real application under testing. Thanks!
Oups, actually, I forgot to change the value…
5 is the default throughput value, try to increase to 20 or 50 or more.