小编Vik*_*idu的帖子

Akka Http性能调整

我在Akka-http框架(版本:10.0)上执行负载测试,我使用的是wrk工具.wrk命令:

wrk -t6 -c10000 -d 60s --timeout 10s --latency http://localhost:8080/hello

首次运行没有任何阻塞调用,

object WebServer {

  implicit val system = ActorSystem("my-system")
  implicit val materializer = ActorMaterializer()
  implicit val executionContext = system.dispatcher
  def main(args: Array[String]) {


    val bindingFuture = Http().bindAndHandle(router.route, "localhost", 8080)

    println(
      s"Server online at http://localhost:8080/\nPress RETURN to stop...")
    StdIn.readLine() // let it run until user presses return
    bindingFuture
      .flatMap(_.unbind()) // trigger unbinding from the port
      .onComplete(_ => system.terminate()) // and shutdown when done
  }
}

object router {
  implicit …
Run Code Online (Sandbox Code Playgroud)

scala akka akka-http

20
推荐指数
1
解决办法
3760
查看次数

标签 统计

akka ×1

akka-http ×1

scala ×1