简体   繁体   English

在Kubernetes上运行2个Pod对比1个更大的Pod?

[英]running 2 pods vs 1 larger pod on Kubernetes?

What is the difference between running 2 pods (2 replicas) in Kubernetes vs a one larger pod ? 在Kubernetes中运行2个Pod(2个副本)与一个更大的Pod有什么区别?

I have set a pod with 20m memory request limit. 我已将Pod设置为20m的内存请求限制。 Is it better to have 2 replicas with 20m limits or a single pod with 40m memory request limit? 拥有2个限制为20m的副本或一个内存限制为40m的单个pod更好?

Personally, I think the performance had better to run multiple pods on the same host. 就个人而言,我认为性能最好在同一主机上运行多个Pod。 I don't know what web server you use, but the requests are processed by limited cpu time, though it has multiple processes or threads for work. 我不知道您使用的是哪种Web服务器,但是请求是由有限的CPU时间处理的,尽管它有多个工作进程或线程。 Additionally it's more efficient to utilize cpu time during network I/O waiting in using multiple processes. 此外,在使用多个进程的网络I / O等待期间利用CPU时间更为有效。 In order to improve the throughput, you should increase the processes or instances to work horizontally, because the response time is getting slower as time past. 为了提高吞吐量,应该增加进程或实例以使其水平工作,因为随着时间的流逝,响应时间会越来越慢。

Depends mainly on the requirements of the web/mobile application being hosted, which you can ascertain by benchmarking the app performance under 20m & 40m configurations. 主要取决于托管的Web /移动应用程序的要求,您可以通过在20m和40m配置下对应用程序性能进行基准测试来确定这些要求。 Overall, you can expect better performance for the application running at 40m and scaling elastically when required by user traffic. 总体而言,您可以期望在40m处运行的应用程序具有更好的性能,并在用户流量需要时进行弹性伸缩。 Running two pods in different data centers will give better fail-over performance in case of system crash or other issues. 在系统崩溃或其他问题的情况下,在不同数据中心中运行两个Pod将提供更好的故障转移性能。 You may have higher billing rates running two pods when supporting the same rate of web traffic. 当支持相同的Web流量速率时,运行两个Pod的计费率可能更高。

I think there is no golden rule on how to plan your infrastructure capacity to met specific level of your application/service`s objectives. 我认为,如何计划基础架构容量以满足应用程序/服务目标的特定级别没有黄金法则。 You should start collecting some key performance metrics of your application, and based on these monitoring stats start doing proper dimensioning of your PODs, for which you can use Kubernetes features like Horizontal /Vertical Pod Autoscaling. 您应该开始收集应用程序的一些关键性能指标,并基于这些监视统计信息开始对POD进行正确的尺寸确定,为此您可以使用Kubernetes功能(例如, 水平 /垂直Pod自动缩放)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM