Akka Http Performance with high-latency route.

85 views
Skip to first unread message

Dominic Kim

unread,
Sep 11, 2017, 4:58:44 AM9/11/17
to Akka User List
Hi.

I am newbie to Akka-http.
I got about  only 1,500 TPS with Akka-http.

I am running performance benchmark on Apahce OpenWhisk which uses Akka-http as a main web server.
In OpenWhisk, there are many routes, few routes have low latency and a few routes have relatively high latency.
For example,

 1. Ping API: 25ms
 2. Invoking an action API: 250ms
 3. Get all actions API: 500ms.

I got about 15000 TPS with ping API but got about 1500 TPS with Invoking an action API.
I used 40cores CPU with 128GB memory.
I monitored the number of thread and it was max 140, though there were idle CPU and memory.

Since their latency difference and TPS difference are about 10 times between Ping(20ms, 15000TPS) and Invoking API(200ms, 1500TPS),
I think this is because there are fixed number of threads(140) and they could not handle more requests due to high latency of each requests.
(When I run `get all actions API` which has about 20 times slower than `Ping API`, I got about 800 TPS which is also 20 times lesser than 15000 TPS)

Since there were idle CPI(50%) and memory(120GB), it should create more threads and throughput should be higher even though latency is high.

Do I have to configure anything to increase the number of concurrent threads?

I am using this version of libraries.

compile 'com.typesafe.akka:akka-actor_2.11:2.4.16'
compile 'com.typesafe.akka:akka-slf4j_2.11:2.4.16'
ompile 'com.typesafe.akka:akka-http-core_2.11:10.0.9'
compile 'com.typesafe.akka:akka-http-spray-json_2.11:10.0.2'



This is my(OpenWhisk`s) akka-http configurations.
akka.http {
  server {
    request-timeout = 90s
    max-connections = 8192
    stats-support = off
    idle-timeout = 120s

    parsing {
      max-uri-length = 8k   
      max-content-length = 50m
    }
  }
}



Thanks in advance
Regards
Dominic

johannes...@lightbend.com

unread,
Sep 11, 2017, 5:23:21 AM9/11/17
to Akka User List
Hi Dominic,

it depends on what you mean with "high-latency" API. If you mean that some external service is called which takes a long while, then you need to ensure that executing this external call does not block the thread and the thread can be used for other tasks while waiting for the result of the external call. The same consideration applies if the API call is local but is heavy on IO.

Here's more information about blocking operations in Akka / Akka-Http: http://doc.akka.io/docs/akka-http/current/scala/http/handling-blocking-operations-in-akka-http-routes.html

Johannes
Reply all
Reply to author
Forward
0 new messages