memcached能否充分利用多核?
memcached是否能够充分利用多核?或者有什么办法可以调整这个吗?
Is memcached capable of making full use of multi-core? Or is there any way tuning this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
memcached 有“-t”选项:
所以,我相信它可以使用您所有的 CPU 核心,当然如果它是使用相应选项编译的。
memcached has "-t" option:
so, I believe it can use all your CPU cores, of course if it was compiled with corresponding option.
memcached 默认是多线程的,并且在多个核心饱和时没有问题。让更大规模的并行设备(例如 256 核 CMT 设备)上的所有核心都达到饱和有点困难,因为将数据传入和传出网络变得更加困难。
如果您发现某些区域存在某种争用,导致核心无法饱和,请提交错误或开始讨论。
memcached is multi-threaded by default and has no problem saturating many cores. It's a bit harder to saturate all cores on more massively parallel boxes (e.g. a 256-core CMT box) just because it gets harder to get the data in and out of the network.
If you find areas where some sort of contention is preventing you from saturating cores, file a bug or start a discussion.
基于英特尔的此研究,Memcached v.1.6 beta 无法在多核系统上很好地扩展。他们的实验表明,随着核心数量从 1 个增加到 8 个,最大吞吐量(中值 RTT < 1ms SLA)只会增加一倍。
Based on a this research by Intel, Memcached v.1.6 beta cannot scale well on a multicore system. Their experiments show that as core counts increase from 1 to 8, maximum throughput (with a median RTT < 1ms SLA) only doubles.
小心。这个术语相当混乱。 Memcached 手册页显示 -t 选项仅适用于核心数量。然而,这很奇怪,因为线程和进程非常不同。线程与核心数量无关。进程绝对可以在多个 Cor 上运行,而线程则不能(除非它们调用操作系统例程,然后它们可以进行线程切换并占用超过 100% 的 CPU 使用率)。线程共享内存,仅依靠指令指针来区分谁是谁。除非提前明确声明为共享,否则进程不会共享任何内容,并且共享是通过操作系统进行的。
总的来说,我希望 Memcached 人员更清楚地了解他们的应用程序是多处理还是多线程,以及它是否可以使用超过 100% 的 cpu。
CAREFUL. This terminology is quite confusing. Memcached man page says -t option is only good up to the number of cores. However, this is odd because threads and processes are VERY different. Threads have NOTHING to do with the number of cores. Processes can definitely run on more than one cor, while threads cannot (unless they call to an OS routine, then they can thread switch and pack in more than 100% cpu usage). Threads share memory and just depend on an instruction pointer to differentiate who is who. Processes share nothing unless it is explicitly declared as shared ahead of time, and sharing occurs via the OS.
Overall, I want MORE CLARITY from the Memcached people about whether their app is multiprocessing or multithreaded and thus if it can use more than 100% of cpu.