Play从2.6.x开始使用Akka HTTP作为默认服务后端
2017-09-20 18:04
344 查看
在Play 2.6.x之前,Play默认使用Netty服务后端。 而到了2.6.x,默认服务后端换成了Akka HTTP, 但还是可以通过手动选择Netty服务后端。想升级到2.6.x,就需要注意到这一点了。因为Akka HTTP服务器要比Netty HTTP服务器慢。所以如果对性能特别敏感,升级完就需要手动选择Netty服务后端。
至于为什么会选择性能有所下降的Akka HTTP服务后端,Play项目的Tech Leader Greg Methvin在Google网上论坛给了一些解释。
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.
至于为什么会选择性能有所下降的Akka HTTP服务后端,Play项目的Tech Leader Greg Methvin在Google网上论坛给了一些解释。
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.
相关文章推荐
- 使用Scala的Akka HTTP,Akka Stream和Reactive Mongo建立REST服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- Spring Boot 中使用Feign作为HTTP客户端调用远程HTTP服务
- 使用 http://tempuri.org/ 作为默认命名空间
- 下列服务使用的默认端口:ftp,ssh,telnet,dhcp,mail,pop3,smtp,dns,http,sm
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 偶决定开始使用 Chrome 作为默认浏览器了
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- OpenStack入门修炼之Cinder服务-->使用NFS作为后端存储(19)
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务的方法(推荐)
- php 5.3开始使用mysqlnd作为的默认mysql访问驱动
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 使用JavaServiceWrapper把Java程序作为Windows系统服务 from http://www.233.com
- Azure服务将开始使用WoSign作为HTTPS(超文本传输安全协议)端根证书
- 使用Spring Cloud Feign作为HTTP客户端调用远程HTTP服务
- 偶决定开始使用 Chrome 作为默认浏览器了