Erlang 的可扩展性秘诀是什么?

发布于 2024-07-13 18:02:57 字数 233 浏览 3 评论 0原文

Erlang 因在处理大量消息和请求方面无可挑剔而享有盛誉。 我还没有时间下载并尝试深入了解 Erlang 先生对切换理论的理解......所以我想知道是否有人可以教我(或指向一个好的教学网站)。

说作为一个思想实验我我想将 Erlang ejabberd 移植到 Python 和 C 的组合,以一种给我相同的速度和可扩展性的方式。 我必须理解和实施哪些结构或模式? (Python 的 Twisted 已经这样做了吗?)

Erlang is getting a reputation for being untouchable at handling a large volume of messages and requests. I haven't had time to download and try to get inside Mr. Erlang's understanding of switching theory... so I'm wondering if someone can teach me (or point to a good instructional site.)

Say as a thought-experiment I wanted to port the Erlang ejabberd to a combination of Python and C, in a way that gave me the same speed and scalability. What structures or patterns would I have to understand and implement? (Does Python's Twisted already do this?)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

寂寞美少年 2024-07-20 18:02:57

函数式语言(特别是 Erlang)如何/为何使用规模很好?(讨论原因)

http://erlang.org/course/course .html(用于教程链)

就移植到其他语言而言,消息传递系统在大多数现代语言中很容易实现。 尽管您无法“免费”获得 Erlang 的内部调度功能,但在 Python 中可以轻松地获得函数式风格。 Stackless Python 可以复制 Erlang 的许多并发功能,尽管我不能透露细节,因为我没有太多使用它。 如果确实看起来更加“明确”(因为它要求您在代码中定义并发性,而 Erlang 的设计将允许内部发生并发性)。

How/why do functional languages (specifically Erlang) scale well? (for discussion of why)

http://erlang.org/course/course.html (for a tutorial chain)

As far as porting to other languages, a message passing system would be easy to do in most modern languages. Getting the functional style can be done in Python easily enough, although you wouldn't get the internal dispatching features of Erlang "for free". Stackless Python can replicate much of Erlang's concurrency features, although I can't speak to details as I haven't used it much. If does appear to be much more "explicit" (in that it requires you to define the concurrency in code in places that Erlang's design will allow concurrency to happen internally).

甜柠檬 2024-07-20 18:02:57

Erlang 不仅涉及可扩展性,而且主要涉及

  • 可靠性
  • 软实时特性(通过软实时 GC 实现,这是可能的,因为不变性 [无循环] 且不共享任何内容等)
  • 并发任务中的性能(廉价的任务切换、廉价的进程生成) ,演员模型,...)
  • 可扩展性 - 在当前状态下有争议,但正在快速发展(大约 32 个核心,它比大多数竞争对手更好,但在不久的将来应该会更好)。

Erlang is not only about scalability but mostly about

  • reliability
  • soft real-time characteristics (enabled by soft real-time GC which is possible because immutability [no cycles] and share nothing and so)
  • performance in concurrent tasks (cheap task switch, cheap process spawn, actors model, ...)
  • scalability - debatable in current state , but rapidly evolving (about 32 cores well, it is better than most competitors but should be better in near future).
蝶…霜飞 2024-07-20 18:02:57

Erlang 的另一个对可扩展性有影响的特性是轻量级的廉价进程。 由于进程的开销很小,erlang 可以产生比大多数其他语言更多的进程。 与许多其他语言相比,使用 erlang 进程可以获得更多的收益。

Another of the features of erlang that have an impact on scalability is the the lightweight cheap processes. Since processes have so little overhead erlang can spawn far more of them than most other languages. You get more bang for your buck with erlang processes than many other languages give you.

鸢与 2024-07-20 18:02:57

我认为 Erlang 的最佳选择是网络绑定应用程序 - 使节点之间的通信更加简单,并且 OTP 中内置了诸如心跳监控、使用 Supervisor 自动重启之类的功能。

I think the best choice for Erlang is Network bound applications - makes communication much simpler between nodes and things like heartbeat monitoring, auto restart using supervisor are built into OTP.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文