Spring Webflux – 在真实硬件核心和虚拟核心之间的事件循环性能

huangapple go评论122阅读模式
英文:

Spring Webflux - performance of event loop between real hardware cores and virtual cores

问题

关于Spring Webflux事件循环性能的一个快速问题。

我们使用Gatling + JMeter + Yourkit对Spring Webflux进行了一些基本的性能测试。

我们注意到在两种情况下存在重大差异:

1 - 情况1,我们的测试设置:向部署在裸金属主机上的Webflux Web应用发送N个HTTP请求。我们拿出一个配备有8个核心的MacBook Pro。我们在一台具有8个核心的物理服务器上重复了相同的测试。两者之间的测试结果相匹配。我们看到事件循环负责在IO之间切换核心,Webflux表现出色,我们非常满意。

2 - 情况2,完全相同的测试,但现在在虚拟核心上运行。通过虚拟核心,我是指我们请求具有8个核心的虚拟机,或者我们请求在Kubernetes上使用8个CPU。在这种情况下,性能大幅下降。

只是一个简单的问题,当Webflux和事件循环在裸金属物理核心之间运行,以及在虚拟核心上运行时,是否应该存在差异?

谢谢

英文:

A quick question regarding performance of the Spring Webflux event loop.

We performed some rudimentary performance test with gatling + JMeter + Yourkit for Spring Webflux.

We noticed some major difference between two scenarios:

1 - Scenario 1, Our test setup: send N amount of HTTP request to the Webflux web app deployed on a bare metal host. We took a MacBook Pro out of the box with 8 cores. We repeated the same test on a physical server with 8 cores. The test result between the two matches. We saw event loop taking care of switching cores between the IO, we saw Webflux shine and are very happy.

2 - Scenario 2, Exact same test, except it is now running on virtual cores. By virtual cores, I mean we request VMs with 8 cores, or we request 8 CPUs to Kubernetes. Here, we saw a major drop in performance.

Just a simple question, is there supposed to be a difference when Webflux and the event loop is running between bare metal physical cores, and when running with virtual ones?

Thank you

答案1

得分: 2

你的操作将由裸金属和虚拟模式中的真实核心执行。不同之处在于,在虚拟核心中,我们在真实核心上具有多租户性,并且还有其他必须由真实核心完成的任务。

您的性能还取决于诸如网络、磁盘IO等其他因素。但是如果我们假设它们是固定的,如果没有其他虚拟机或任务与您的虚拟机一起运行,可能在两者之间会达到相等的结果。然而,在许多情况下,在虚拟化模式下会与其他任务产生干扰,并且您会因此而导致与裸金属相比性能较低。此外,在虚拟模式下,您可能会在每次单独运行时获得不同的性能。

请查看Bare Metal vs. Virtualization: What Performs Better?,并查看最后显示的性能比较。

英文:

Your operations will done by real core in bare metal and virtual mode. The difference is that in virtual cores we have multi tenancy on real cores and there are other tasks which must be done by real core.

Your performance is also depend to other factors such as Network, Disk IO and so on. But if we suppose they are fixed, probably you reach an equal result on both if there is no other VM or tasks along side your VM. However in many cases you have interference with other tasks in virtualization mode and you take lower performance related to bare metal. Furthermore, in virtual mode you may take different performance in every single run.

Take a look at Bare Metal vs. Virtualization: What Performs Better? and see the performance comparison depicted at the end.

huangapple
  • 本文由 发表于 2020年9月16日 07:57:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/63911310.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定