Erlang SMP 在多核服务器上启用选项
我们在以下主机上运行 Erlang 14B03:
HP Proliant G6 服务器,有 2 个 Intel 处理器,每个处理器有 2.4GHz 速度,8MB 缓存,每个处理器有 4 个内核。服务器有 20 GB RAM。
我们如何应用-smp
模拟器选项来充分利用服务器的超线程功能。通过在每个处理器的每个核心上配备一个调度程序(总共 8 个调度程序),我们可以实现哪些性能优势?
We are running Erlang 14B03 on the following Host:
HP Proliant G6 Server, has 2 Intel processors, each processor has 2.4GHz speed, 8MB Cache, each processor has 4 cores. The Server has 20 GB RAM.
How would we apply the -smp
emulator option to make full use of Hyper Threading capability of the server. What performance benefits would we achieve with a scheduler on each Core of each processor (making them 8 schedulers in total) ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,如果 Erlang 使用 SMP 编译,它会为您启动 8 个调度程序。您可以在启动标头中看到这一点:
这相当于将
-smp auto
作为标志。-smp enable
只会强制 SMP 模式,即使在单核系统上也是如此(这通常会稍微降低性能)。使用 +S 标志您可以控制应创建多少个调度程序(以及应有多少个调度程序在线)。例如:
更进一步,您可以使用 +sct 标志来准确定义哪些调度程序应驻留在哪个确切的核心上。有关该标志的说明,请参阅 erlang 手册,因为它相当复杂。
但请注意,如果操作系统公开了它们,Erlang 应该已经为每个内核启动一个调度程序(即使它们是超线程)。确保您运行的不是双四核系统,并且超线程已经可见(总共有 8 个虚拟核心)。
By default Erlang should start up 8 schedulers for you if it is compiled with SMP. You can see this in the startup headers:
This is equivalent to giving
-smp auto
as a flag.-smp enable
would just force SMP mode, even on a single core system (which usually decreases performance somewhat).Using the
+S
flag you can control how many schedulers should be created (and how many should be online). For example:Going even further, you can use the
+sct
flag to exactly define which schedulers should reside on which exact core. See the erlang manual for a description of that flag, since it is quite complex.Note however that Erlang should already start one scheduler per core (even if they are hyper threads) if the OS exposes them. Make sure that you're not running on a dual quad core system with hyper threads already visible (making it a total of 8 virtual cores).