Thanks, we'll look into those suggestions.
> > 2. What is the meaning of the "dropped Ack(0)" warnings? Do they
> > need fixing?
> It seems you have HTTP pipelining enabled. Is that by purpose?
Yes.
Does pipelining cause those warnings? Are they worth worrying about?
> What happens if you reset the spray.can.server.pipelining-limit to 1?
I think we had that set to 1 until recently and it hasn't affected the load testing (I think our test client might not support pipelining).
We'll do a test run with that off again and see if it makes any difference.
Best,
Rich
Thanks, we'll look into those suggestions.
Yes, a more easily reproducible test-case would be very good. The
spray codebase contains similar benchmark code inside its codebase.
Maybe you can start from there:
https://github.com/spray/spray/tree/master/examples/spray-can/server-benchmark
We have reproduced the issue using the Spray “benchmark” app linked above.
It shows the exact same symptoms:
We used Spray v 1.3.1 and Akka v 2.3.3
I can’t upload the test harness here, but it just makes lots of HTTP requests, using a new TCP connection for each request.
We have already eliminated the following possible bottlenecks:
I have included some relevant graphs below, as well as the
diff of changes we had to make to the benchmark app (nothing significant).
If anyone has any ideas about what might be causing this
bottleneck, or any suggestions on relevant stats we could gather, they would be
gratefully received.
Thanks,
Rich
In these graphs, the test starts at 10:00, and takes about 20 mins to ramp up the load, reaching 1200 connections/sec at around 10:20.
CPU load (low throughout the test):
Response times (starts low, increases when the TCP connection issue manifests after around 10:20):
Number of TCP “listen socket overflow” events, as reported by “netstat -s” (“times the listen queue of a socket overflowed”).
I think this proves that the system isn’t accepting TCP connections fast enough:
Number of open TCP connections:
We have graphs showing that the slow requests are taking 3 or 9 seconds to complete, which is consistent with TCP backoff times when a connection attempt fails.
The diff of changes we made to the benchmark app:
diff --git a/spray/build.sbt b/spray/build.sbt
index 2a9b86f..b2ed753 100644
--- a/spray/build.sbt
+++ b/spray/build.sbt
@@ -15,9 +15,9 @@ resolvers ++= Seq(
libraryDependencies ++= Seq(
"io.spray" %% "spray-json" % "1.2.4",
- "io.spray" % "spray-can" % "1.1-20130619",
- "com.typesafe.akka" %% "akka-actor" % "2.1.2",
- "com.typesafe.akka" %% "akka-slf4j" % "2.1.2",
+ "io.spray" % "spray-can" % "1.3.1",
+ "com.typesafe.akka" %% "akka-actor" % "2.3.3",
+ "com.typesafe.akka" %% "akka-slf4j" % "2.3.3",
"ch.qos.logback"% "logback-classic" % "1.0.12" % "runtime"
)
diff --git a/spray/src/main/resources/application.conf b/spray/src/main/resources/application.conf
index ca36824..9e376ab 100644
--- a/spray/src/main/resources/application.conf
+++ b/spray/src/main/resources/application.conf
@@ -24,5 +24,5 @@ spray.can.server {
app {
interface = "0.0.0.0"
- port = 8080
+ port = 8099
}
diff --git a/spray/src/main/scala/spray/examples/BenchmarkService.scala b/spray/src/main/scala/spray/examples/BenchmarkService.scala
index ca3e66b..49c4280 100644
--- a/spray/src/main/scala/spray/examples/BenchmarkService.scala
+++ b/spray/src/main/scala/spray/examples/BenchmarkService.scala
@@ -18,6 +18,8 @@ class BenchmarkService extends Actor {
val unknownResource = HttpResponse(NotFound, entity = "Unknown resource!")
def fastPath: Http.FastPath = {
+ case HttpRequest(_, Uri(_, _, Slash(Segment("myapp", _)), _, _), _, _, _) =>
+ HttpResponse(entity = "You hit myapp ")
case HttpRequest(GET, Uri(_, _, Slash(Segment(x, Path.Empty)), _, _), _, _, _) =>
x match {
case "json" =>
Mike
This is great info. It might be good to include a "Performance Tuning" section in the spray-can docs that could make suggestions on config parameters that should be changed in spray to get high connection throughput? Even some guidance on kernel parameter tuning would be nice, though not directly related to spray.