memcached能否充分利用多核?

发布于 2024-09-02 23:00:08 字数 42 浏览 2 评论 0原文

memcached是否能够充分利用多核?或者有什么办法可以调整这个吗?

Is memcached capable of making full use of multi-core? Or is there any way tuning this?

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

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

发布评论

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

评论(4

不知所踪 2024-09-09 23:00:08

memcached 有“-t”选项:

       -t <threads>
          Number of threads to use to process incoming requests. This option is only meaningful
          if memcached was compiled with thread support enabled. It is typically not useful  to
          set  this higher than the number of CPU cores on the memcached server. The default is
          4.

所以,我相信它可以使用您所有的 CPU 核心,当然如果它是使用相应选项编译的。

memcached has "-t" option:

       -t <threads>
          Number of threads to use to process incoming requests. This option is only meaningful
          if memcached was compiled with thread support enabled. It is typically not useful  to
          set  this higher than the number of CPU cores on the memcached server. The default is
          4.

so, I believe it can use all your CPU cores, of course if it was compiled with corresponding option.

情愿 2024-09-09 23:00:08

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.

樱花坊 2024-09-09 23:00:08

基于英特尔的研究,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.

紫轩蝶泪 2024-09-09 23:00:08

小心。这个术语相当混乱。 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.

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