为什么Kubernetes的性能会随着资源请求内存而降低?

时间:2020-09-17 07:34:13

标签: apache kubernetes google-kubernetes-engine lamp

我在GKE上设置了一个LAMP堆栈,在那里我一直在使用自定义docker映像,并在entrypoint.sh中从httpd -DFOREGROUND启动我的Apache(取自官方httpd docker映像)。当前,正在使用apache的默认preforks设置

问题是当我为内存设置资源请求时,应用程序变得太迟钝和缓慢,但是当我删除资源请求时,一切正常。根据我的理解资源,Request仅用于pod的调度,我不了解它如何在性能中发挥作用。

根据观察结果,广告连播的内存使用率从未超过我提出的请求。

以下是数据:

每当pod启动时,它都会创建10个进程

root           1  0.0  0.3 511496 30724 ?        Ss   17:59   0:00 /usr/sbin/httpd -DFOREGROUND
apache         90  0.1  0.5 620584 48736 ?        S    19:09   0:04 /usr/sbin/httpd -DFOREGROUND
apache        100  0.1  0.4 526332 37044 ?        S    19:34   0:03 /usr/sbin/httpd -DFOREGROUND
root         103  0.1  0.0  54060  4336 pts/0    Ss+  19:35   0:03 watch ps aux
apache        446  0.0  0.4 528404 38496 ?        S    19:41   0:02 /usr/sbin/httpd -DFOREGROUND
apache        493  0.0  0.4 528048 37692 ?        S    19:42   0:01 /usr/sbin/httpd -DFOREGROUND
apache       1038  0.0  0.4 528104 37616 ?        S    19:51   0:01 /usr/sbin/httpd -DFOREGROUND
apache       1039  0.1  0.4 528232 38328 ?        S    19:51   0:02 /usr/sbin/httpd -DFOREGROUND
apache       1776  0.0  0.4 528104 38776 ?        S    20:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache       1779  0.0  0.4 528104 38040 ?        S    20:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache       1780  0.0  0.4 526056 35372 ?        S    20:03   0:00 /usr/sbin/httpd -DFOREGROUND
apache       1781  0.0  0.4 528104 37592 ?        S    20:03   0:00 /usr/sbin/httpd -DFOREGROUND

当我查看pod的内存使用情况时:

NAME                        CPU(cores)   MEMORY(bytes)   
web-6f58cf5b67-lfc46   17m          231Mi

因此,如果我们将每个进程的内存使用量相加〜40m,则是pod显示的内存的两倍。

有人可以解释一下这种行为吗?

0 个答案:

没有答案