Scala 如何在集群上扩展?
我一直在学习 Erlang,但我也一直在关注其他技术,例如 Scala。有谁知道Scala的多节点性能与Erlang相比如何?
I have been learning Erlang, but also I'm keeping my eyes open to other technologies such as Scala. Does anyone know how Scala's multi node performance compares to Erlang?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
[免责声明:我是 Akka 团队的一员]
我真的鼓励你好好看看 Scala 框架 Akka
我们真正努力提供一个可以水平和垂直扩展的平台,并且可以接受无法实现自我修复系统的失败。
希望很快能在邮件列表中见到您!
[Disclaimer: I'm on the Akka team]
I really encourage you to take a good look at the Scala framework Akka
We really strive to provide a platform that scales horizontally AND vertically, and that embraces failure to enable self-healing systems.
Hope to see you on the mailing list soon!
Scala 在某种程度上受到 Java 线程相当重这一事实的限制。它不会像 Erlang 那样扩展线程数量。
简单地说,短期内不要在 Scala 中运行数千个 Actor。 编辑:请参阅下面的评论来了解相反的体验。在我看来,我指的是数千条线程上的数千名演员。
然而,演员并不是基础语言的一部分。它们只是一个库,由于 Scala 的内在优势,它们看起来就像是该语言的一部分。其重要性在于演员是可以替换的。 Scala 有两个重要的替代 actor 库。最著名的是 Akka,其他人也谈到过它,我只能认为它值得认真研究一下。另一个是 Lift 的 actor,它走了另一条路,通过提供更简单(且可靠)的 actor 实现来满足 Lift 自身的需求,并且不会尝试超越这一点。
另一个有希望的发展是在 Scala 2.8 中添加了定界延续。分隔延续虽然难以使用,但可以实现非常快速的 Actor 实现。需要明确的是,编写带有分隔延续的库(例如 actor)是很困难的,但是这样的库在使用上与其他 actor 库没有任何不同。
Scala is limited somewhat by the fact that Java threads are rather heavy. It won't scale in number of threads as much as Erlang does.
To put it plainly, forget about running thousands of actors in Scala in the short term. EDIT: see comment below to an experience to the contrary. In my defense, I meant thousands of actors on thousands of threads.
However, actors are not part of the base language. They are just a library which, because of Scala's intrinsic strengths, look as if they are part of the language. The importance of that is that actors are replaceable. There are two important alternative actor libraries for Scala. The most famous one is Akka, of which others have spoken about, and which I can only endorse as being worth a serious look at. The other one is Lift's actors, which go the other way, by providing a more simple (and reliable) actor implementation that meets Lift's own needs, and doesn't try to go beyond that.
Another promising development is the addition of delimited continuations to Scala 2.8. Delimited continuations, while difficult to use, enable a very fast actor implementation. Just to be clear, it is difficult to write libraries (such as actors) with delimited continuations, but such library wouldn't be any different to use than the others actor libraries.
Scala 没有被设计为一个一致的平台(如 erlang),因此默认情况下不包含强大的分发功能。 scala actor库更像是在该语言上改装的erlang流程模型。有一些库提供类似 OTP 的功能和集群,即 Akka。
Scala is not designed as a coherent platform (like erlang) and therefore does not include robust distribution capabilities by default. The scala actor library is more like erlang's process model refitted on the language. There are libraries which provide OTP-like capabilities and clustering, i.e. Akka.