# Please review TechEmpower performance benchmark variant with Akka HTTP and Slick

**URL:** <https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204>\
**Category:** Akka HTTP\
**Tags:** akka, akka-http, scala, configuration, slick\
**Created:** [May 16, 2019, 5:31pm UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204 "2019-05-16T17:31:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourcekick](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sourcekick](https://discuss.akka.io/u/sourcekick)\
**Post date:** [May 16, 2019, 5:31pm UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/1 "2019-05-16T17:31:18Z")

</div>

Hi all,

I have contributed a new tech stack variant to TechEmpower performance benchmarks based on Akka HTTP and Slick.

> **[TechEmpower/FrameworkBenchmarks](https://github.com/TechEmpower/FrameworkBenchmarks/tree/master/frameworks/Scala/akka-http/akka-http-slick-postgres)**
>
> Source for the TechEmpower Framework Benchmarks project - TechEmpower/FrameworkBenchmarks

Now there is a problem. Locally the test results look fine, but on the servers most of the test fail to perform in any reasonable way, to be seen in the results here:

> **[TechEmpower Framework Benchmarks (TFB) Results Dashboard](https://tfb-status.techempower.com/)**
>
> Continuous Benchmarking results for the TechEmpower Web Framework Benchmarks Project.

  
– the runs started after including 2019-05-12 (i. e. including and after commit [https://github.com/TechEmpower/FrameworkBenchmarks/commit/dbf6f14900c7ee4b913e3a09a45b81d9bbbcce8d](https://github.com/TechEmpower/FrameworkBenchmarks/commit/dbf6f14900c7ee4b913e3a09a45b81d9bbbcce8d) )

I am a of course worried that I may have made a basic mistake in the code. However, as it seems all fine in local runs on my laptop, I do not know where to start looking.

Thus I now come here to ask the **Akka Team** and perhaps also **Slick experts** for a review.

Cheers,  
Sven

---

<div class="post-metadata">

**Author:** ![jrudolph](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/jrudolph/32/80_2.png) [@jrudolph](https://discuss.akka.io/u/jrudolph)\
**Post date:** [May 29, 2019, 6:44am UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/2 "2019-05-29T06:44:57Z")

</div>

Hi Sven,

I looked into it a while ago but there are no obvious mistakes. The most likely culprit would be the docker image / JVM configuration. Might make sense to print out `Runtime.availableProcessors()` to see if the JVM can figure up the right amount of processors from the docker runtime configuration.

Johannes

---

<div class="post-metadata">

**Author:** ![sourcekick](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sourcekick](https://discuss.akka.io/u/sourcekick)\
**Post date:** [June 11, 2019, 2:33pm UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/3 "2019-06-11T14:33:05Z")

</div>

Hi Johannes, hi all,

the new results are out. The logs of how many processors the JVM determines on that server I cannot see. Locally it worked correctly. However, we can derive, from the fact that only akka-http-slick-postgres has the problems and akka-http works correctly, that this probably works, also since I use the same Dispatcher configuration.

I discovered that it is quite interesting to look at the individual data tables where the different performance with respect to the amount of concurrency can be seen.

For example, the use case “JSON serialization” degrades harshly with more concurrency, while the use case “Single query” is capped early at a max of 50000 requests.

So probably some implementation mistakes are lurking and they are potentially different from use case to use case.

> **[TechEmpower Web Framework Performance Comparison](https://www.techempower.com/benchmarks/#section%3Dtest%26runid%3D9271e861-10e9-48b8-8a66-6e9d6582ffb9%26hw%3Dph%26test%3Dquery%26p%3Dzik0zj-zdk8an-zik0zj-4fti4f)**
>
> Performance comparison of a wide spectrum of web application frameworks and platforms using community-contributed test implementations.

Sven

---

<div class="post-metadata">

**Author:** ![sourcekick](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sourcekick](https://discuss.akka.io/u/sourcekick)\
**Post date:** [June 11, 2019, 7:32pm UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/4 "2019-06-11T19:32:57Z")

</div>

Maybe someone can review the Dispatcher(s) and Executors used in my code.

It could well be that I have made a mistake by either having a blocking operation on the main Dispatcher or by having introduced a custom undersized thread-pool.

---

<div class="post-metadata">

**Author:** ![TimMoore](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/timmoore/32/7_2.png) [@TimMoore](https://discuss.akka.io/u/TimMoore)\
**Post date:** [June 12, 2019, 12:06am UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/5 "2019-06-12T00:06:55Z")

</div>

Slick also introduces its own thread pool, which must be sized correctly with respect to the available resources and also the size of the connection pool:

[http://slick.lightbend.com/doc/3.3.1/database.html#database-thread-pool](http://slick.lightbend.com/doc/3.3.1/database.html#database-thread-pool)

---

<div class="post-metadata">

**Author:** ![sourcekick](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sourcekick](https://discuss.akka.io/u/sourcekick)\
**Post date:** [June 12, 2019, 1:51pm UTC](https://discuss.akka.io/t/please-review-techempower-performance-benchmark-variant-with-akka-http-and-slick/4204/6 "2019-06-12T13:51:14Z")

</div>

@TimMoore Thank you, this I was aware of though. I actually tried different sizes of the HikariCP already. I also verified that the pool actually gets used and configured. But someone helping in the investigation or reviewing the code could have another look, would be appreciated.

Note however that even use cases “JSON serialization” and “Plain text” perform poorly. They do not even make use of Slick/Database.
