FAQ
Try run it as:

   val source = Http().bind(interface = "localhost", port = 8080)
   source.runForeach { conn =>
     conn.handleWith(route)
   }
On Tue, Feb 2, 2016 at 12:30 AM Sebastian Jastrzebski wrote:

Hi,

I'm trying to run a simple load test against Akka HTTP 2.0 (2.0.3
specifically using openjdk 8) and I'm having problems getting the server to
saturate all cores. The cpu utilization revolves around 180% on a 8 core
system resulting in 1300 req/s. Same test against Spay results in 700%
utilization and 12000+ req/s.

The setup is using reference akka and akka-http configuration.

Any ideas on how to get these numbers and utilization up?

Thanks
-Sebastian

## Load Test Results
Server Software: akka-http/2.3.12
Server Hostname: localhost
Server Port: 8080

Document Path: /v1/tweets
Document Length: 61 bytes

Concurrency Level: 100
Time taken for tests: 76.685 seconds
Complete requests: 100000
Failed requests: 0
Total transferred: 21400000 bytes
HTML transferred: 6100000 bytes
Requests per second: 1304.04 [#/sec] (mean)
Time per request: 76.685 [ms] (mean)
Time per request: 0.767 [ms] (mean, across all concurrent requests)
Transfer rate: 272.52 [Kbytes/sec] received

## application.conf

akka {
loglevel = ERROR
}

## Backend

import akka.actor.ActorSystem
import akka.http.scaladsl.Http
import akka.http.scaladsl.marshallers.sprayjson.SprayJsonSupport
import akka.http.scaladsl.server.Directives._
import akka.stream.ActorMaterializer
import spray.json._

case class Tweet(id: String, author: String, content: String)

trait TweetProtocol extends DefaultJsonProtocol {
implicit val tweetFormatter = jsonFormat3(Tweet.apply)
}

object Boot extends App with TweetProtocol with SprayJsonSupport {

implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()

val routes = pathPrefix("v1") {
path("tweets") {
get {
complete {
List(Tweet("1", "author", "tweet"))
}
}
}
}

Http().bindAndHandle(
handler = routes,
interface = "localhost",
port = 8080)
}

--
Read the docs: http://akka.io/docs/
Check the FAQ:
http://doc.akka.io/docs/akka/current/additional/faq.html
---
You received this message because you are subscribed to the Google Groups
"Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+unsubscribe@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 29 | next ›
Discussion Overview
groupakka-user @
categoriesscala
postedFeb 1, '16 at 4:30p
activeFeb 6, '16 at 5:18p
posts29
users7
websiteakka.io
irc#akka

People

Translate

site design / logo © 2019 Grokbase