Akka HTTP in Play 2.6

1,343 views
Skip to first unread message

Greg Methvin

unread,
Feb 22, 2017, 6:37:28 PM2/22/17
to play-framework
Hi everyone,

I wanted to answer a few questions I have heard about Akka HTTP in Play 2.6. Hopefully this should clear up any concerns people have.

Why is Play switching to Akka HTTP as the default server?

Play is switching for a few reasons. Play already uses Akka and Akka streams internally, and the model Akka HTTP uses for representing requests and responses is much closer to Play's. Some of the improvements we plan to make in 3.0 will bring them closer together. We are optimistic about the Akka HTTP project and where it's headed in terms of features and performance.

While both Netty and Play are active projects, it's much easier for us to work with the Akka team. This is in part due to shared philosophy and goals but also due to the fact that both teams work for Lightbend. This improved communication will help us implement new features and fix bugs and security issues more quickly.

What's the difference in performance?

Currently we have done no optimization, so the Akka server on 2.6.0-M1 is actually slower than the Netty server. This is expected. We are working with the Akka team to bring the performance to the same level, or hopefully better. You should see the improvements on prune as we continue this work.

Our contributor Christian Schmitt also published a gist with nice benchmarks showing akka-http performance (without Play) actually exceeds that of play-netty-server in his test case, in terms of both latency and bytes transferred. Based on this and similar benchmarks we have done, we expect to see comparable performance to Netty once we've removed the unnecessary overhead introduced in the conversion between Play and Akka HTTP models.

Does Play still support the Netty server backend?

Yes. We will continue supporting both Netty and Akka HTTP backends for the foreseeable future, but will prioritize new features on Akka HTTP.

If you want to switch back to the Netty server, please see the Netty server documentation.

What about HTTP/2?

HTTP/2 is coming as part of the improvements being made to the Akka HTTP server and will be included in a future milestone. We are interested in implementing it on Netty as well, but it's not a priority for the 2.6.0 release. We'd gladly accept contributions from the community, though.

Feel free to reply to this thread if you have any other questions.

Cheers,
Greg

--
Greg Methvin
Tech Lead - Play Framework

William Narmontas

unread,
Feb 22, 2017, 8:02:43 PM2/22/17
to Play Framework
Thank you for the explanation, I'm sure many are interested.

Frederic Noyer

unread,
Aug 6, 2017, 4:33:07 PM8/6/17
to Play Framework
Thank you for this expaination.
The question I have regarding this choice is that Akka Doc is showing netty server configuration, per example when we are using remoting http://doc.akka.io/docs/akka/snapshot/scala/remoting.html.
Is there any equivalent example with akkaHttp server ?
If not does it means that when we want to run remote Actor we have to do so on a netty server?

YouTube 88

unread,
Aug 28, 2017, 2:26:46 AM8/28/17
to Play Framework
Hi Greg,

first of all i have to say that i love the Play Framework. It's really easy and fun to develop with and it used to be blazingly fast.

What i really dislike about Play is the constant radical changes in every minor new release. I mean take Play 2.3 and compare it to 2.6. The code base is mostly incompatible and almost like complete different Framework. You need hours to update your existing code base and i wonder how i sell that to my customers?

But what i REALLY don't understand is why on earth did you switched to Akka as the main webserver, even when it's way slower???

The main advantage of Play was that it was much faster than Spring Boot or anything else on the market. And you dumped all this? Why? Now we have a disadvantage using the latest Play version. All my apps are 416% slower running in 2.6 compared to 2.5. Sorry, but this is insane.

Play Could become the leading Framework, it has so much potential, but with your insane radical update policies in minor version numbers and now even downgrades of functionality you're basically ruining the Frameworks reputation.

Cheers,

Sven.

Igmar Palsenberg

unread,
Aug 28, 2017, 2:42:11 AM8/28/17
to Play Framework

first of all i have to say that i love the Play Framework. It's really easy and fun to develop with and it used to be blazingly fast.

What i really dislike about Play is the constant radical changes in every minor new release. I mean take Play 2.3 and compare it to 2.6. The code base is mostly incompatible and almost like complete different Framework. You need hours to update your existing code base and i wonder how i sell that to my customers?

2.3 vs 2.4 vs 2.5 vs 2.6 aren't minor releases. They are major releases. Play is versioned as epoch.major.minor, which makes it major releases. Which is clearly stated in the documentation.
I've done an upgrade to all the releases mentioned, and 80% of the code changes where actually captured in a sed script. With every release, things improved a lot.
Some things haven't from my point of view, but as is with software : You can't please everyone.

But what i REALLY don't understand is why on earth did you switched to Akka as the main webserver, even when it's way slower???

Because there is more to consider then speed. Akka-http is based on streams, which fits Play's internal model much better. And akka-http is improving in a rapid rate.
 
The main advantage of Play was that it was much faster than Spring Boot or anything else on the market. And you dumped all this? Why? Now we have a disadvantage using the latest Play version. All my apps are 416% slower running in 2.6 compared to 2.5. Sorry, but this is insane.

There is nothing holding you back from switching back to the Netty based implementation. I really don't see the issue here. If you don't like it : Switch, write your own version. Pick one.
Which can be said for more components : They are not tied to Play specially, and can be swapped out. We did that with the Cache implementation.

 
Play Could become the leading Framework, it has so much potential, but with your insane radical update policies in minor version numbers and now even downgrades of functionality you're basically ruining the Frameworks reputation. 

As stated in the documentation : They're MAJOR version numbers. Minor update rarely brake. And if you don't like akka-http : Switch back to the netty backend. Play gives you that option. Try that with Spring :)


Igmar
 

Greg Methvin

unread,
Aug 28, 2017, 2:56:58 AM8/28/17
to play-framework
The Akka server should now be at least as good performance as the Netty server, at least on the applications we've tested. If you are having a serious performance degradation, that is something we should look into. If you'd like to start a new thread with more information on what you're seeing I'd be happy to help diagnose the problem. (Ideally, it would be nice if you could show the difference with a sample app.)

As Igmar said, regarding the Akka HTTP vs Netty thing there is really nothing to complain about. We still support Netty if you want to use it.

For what it's worth, I agree that many of the changes in past releases have been an deterrent for people upgrading. I personally believe the 2.5->2.6 migration is one of the easiest ones in a while, and I want to continue that in future releases. We have even discussed the idea of providing binary compatibility for all non-deprecated APIs.

Greg

--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/be01bceb-a7d9-4240-bf6c-d31c9bfd23a0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

YouTube 88

unread,
Aug 28, 2017, 5:37:31 AM8/28/17
to Play Framework
Hi Greg,

thanks for your input. It's true, upgrading from 2.5 to 2.6 was the easiest update ever.

I'll probably start a new thread for this, as you mentioned. But i just used the 2.6 starter template and downgraded it to 2.5 and i saw the app runing 416% slower in 2.6 than in 2.5. If i stay with 2.6 and use Netty it's still 147% slower than 2.5.

I think that speed is very important, because it decides how much servers you need.

Sven
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages