- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经在我的 pod 的所有容器上设置了 CPU 和 Memory Requests=Limits,以使其符合保证服务质量类的资格。现在,查看过去 6 小时同一 Pod 的这些 CPU 使用率和 CPU 节流图。
这看起来正常吗?
CPU 使用率甚至一次都没有达到设定限制的 50%,但有时仍会被限制到 58%。
还有一个附带问题,节流图中 25% 处的红线表示什么?
我对这个主题做了一些研究,发现 Linux 内核中存在一个可能导致这种情况的错误,并且它在内核的 4.18 版中得到了修复。引用:this和 this
我们在 GKE 上运行 Google Container Optimized OS。我检查了我们节点上的 linux 内核版本,它们在 4.19.112+ 上,所以我想我们已经有了那个补丁?这种节流模式的其他原因可能是什么?
附言这个 pod(实际上是一个具有自动缩放功能的部署)部署在一个单独的节点池上,该池上没有运行我们的其他工作负载。因此,除此部署之外,在此节点池中的节点上运行的唯一 Pod 是一些指标以及日志记录代理和导出器。这是在上面讨论的 pod 被安排在同一节点上运行的 pod 的完整列表。确实有一些 Pod 没有设置任何 CPU 限制。我是否还需要以某种方式对这些设置 CPU 限制?
我们的 GKE 版本是 1.16.9-gke.2
这是包含部署、服务和自动缩放器定义的 list 文件。
apiVersion: apps/v1
kind: Deployment
metadata:
name: endpoints
labels:
app: endpoints
spec:
replicas: 2
selector:
matchLabels:
run: endpoints
strategy:
rollingUpdate:
maxSurge: 2
maxUnavailable: 0
template:
metadata:
labels:
run: endpoints
spec:
terminationGracePeriodSeconds: 60
containers:
- name: endpoints
image: gcr.io/<PROJECT_ID>/endpoints:<RELEASE_VERSION_PLACEHOLDER>
livenessProbe:
httpGet:
path: /probes/live
port: 8080
initialDelaySeconds: 20
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /probes/ready
port: 8080
initialDelaySeconds: 20
timeoutSeconds: 5
ports:
- containerPort: 8080
protocol: TCP
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/path/to/secret/gke-endpoints-deployments-access.json"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: DEPLOYMENT_NAME
value: "endpoints"
resources:
requests:
memory: "5Gi"
cpu: 2
limits:
memory: "5Gi"
cpu: 2
volumeMounts:
- name: endpoints-gcp-access
mountPath: /path/to/secret
readOnly: true
lifecycle:
preStop:
exec:
# SIGTERM triggers a quick exit; gracefully terminate instead
command: ["/bin/sh","-c","sleep 3; /usr/sbin/nginx -s quit; sleep 57"]
# [START proxy_container]
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.16
command: ["/cloud_sql_proxy",
"-instances=<PROJECT_ID>:<ZONE>:prod-db=tcp:3306,<PROJECT_ID>:<ZONE>:prod-db-read-replica=tcp:3307",
"-credential_file=/path/to/secret/gke-endpoints-deployments-access.json"]
# [START cloudsql_security_context]
securityContext:
runAsUser: 2 # non-root user
allowPrivilegeEscalation: false
# [END cloudsql_security_context]
resources:
requests:
memory: "50Mi"
cpu: 0.1
limits:
memory: "50Mi"
cpu: 0.1
volumeMounts:
- name: endpoints-gcp-access
mountPath: /path/to/secret
readOnly: true
# [END proxy_container]
# [START nginx-prometheus-exporter container]
- name: nginx-prometheus-exporter
image: nginx/nginx-prometheus-exporter:0.7.0
ports:
- containerPort: 9113
protocol: TCP
env:
- name: CONST_LABELS
value: "app=endpoints"
resources:
requests:
memory: "50Mi"
cpu: 0.1
limits:
memory: "50Mi"
cpu: 0.1
# [END nginx-prometheus-exporter container]
tolerations:
- key: "qosclass"
operator: "Equal"
value: "guaranteed"
effect: "NoSchedule"
nodeSelector:
qosclass: guaranteed
# [START volumes]
volumes:
- name: endpoints-gcp-access
secret:
secretName: endpoints-gcp-access
# [END volumes]
---
apiVersion: cloud.google.com/v1beta1
kind: BackendConfig
metadata:
name: endpoints-backendconfig
spec:
timeoutSec: 60
connectionDraining:
drainingTimeoutSec: 60
---
apiVersion: v1
kind: Service
metadata:
name: endpoints
labels:
app: endpoints
annotations:
cloud.google.com/neg: '{"ingress": true}' # Creates a NEG after an Ingress is created
beta.cloud.google.com/backend-config: '{"ports": {"80":"endpoints-backendconfig"}}'
spec:
type: NodePort
selector:
run: endpoints
ports:
- name: endpoints-nginx
port: 80
protocol: TCP
targetPort: 8080
- name: endpoints-metrics
port: 81
protocol: TCP
targetPort: 9113
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: endpoints-autoscaler
spec:
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 40
- type: External
external:
metricName: external.googleapis.com|prometheus|nginx_http_requests_total
metricSelector:
matchLabels:
metric.labels.app: endpoints
targetAverageValue: "5"
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: endpoints
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: endpoints-nginx-monitor
namespace: monitoring
labels:
app: endpoints-nginx-monitor
chart: prometheus-operator-8.13.7
release: prom-operator
heritage: Tiller
spec:
selector:
matchLabels:
app: endpoints
namespaceSelector:
any: true
endpoints:
- port: endpoints-metrics
path: "/metrics"
这是部署中使用的唯一自定义容器镜像的 dockerfile:
# Dockerfile extending the generic PHP image with application files for a
# single application.
FROM gcr.io/google-appengine/php:latest
# The Docker image will configure the document root according to this
# environment variable.
ENV DOCUMENT_ROOT /app
RUN /bin/bash /stackdriver-files/enable_stackdriver_integration.sh
最佳答案
我不知道那条红线是什么,所以我会跳过那条。不过,如果知道您希望 CPU 节流情况下会发生什么,那就太好了。
因此,关于您的 CPU 使用率和节流,没有任何迹象表明出现任何问题。当有大量 CPU 可用时,任何现代系统都会发生 CPU 节流。因此,它会减慢时钟,并开始运行更慢(例如,2.3GHz 机器切换到 2.0GHz)。这就是您不能根据百分比设置 CPU 限制的原因。
所以,从你的图表中,我推测看到的是 CPU 时钟下降,自然而然地上升了一个百分比;正如预期的那样。没什么奇怪的。
关于Kubernetes CPU 节流,CPU 使用率远低于请求/限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62627827/
我有一个 ServiceBusQueue(SBQ),它获取大量消息负载。我有一个具有 accessRights(manage) 的 ServiceBusTrigger(SBT),它不断轮询来自 SBQ
在下面给出的结果集中,有 2 个唯一用户 (id),并且查询中可能会出现更多此类用户: 这是多连接查询: select id, name, col1Code, col2Code, col2Va
我正在用 Python 2.7.3 编写一个带有 GRequests 的小脚本和 lxml 可以让我从各种网站收集一些收藏卡价格并进行比较。问题是其中一个网站限制了请求的数量,如果我超过它,就会发回
我想知道何时实际使用删除级联或删除限制以及更新级联或更新限制。我对使用它们或在我的数据库中应用感到很困惑。 最佳答案 在外键约束上使用级联运算符是一个热门话题。 理论上,如果您知道删除父对象也将自动删
下面是我的输出,我只想显示那些重复的名字。每个名字都是飞行员,数字是飞行员驾驶的飞机类型。我想显示驾驶不止一架飞机的飞行员的姓名。我正在使用 sql*plus PIL_PILOTNAME
我正在评估不同的移动框架,我认为 nativescript 是一个不错的选择。但我不知道开发过程是否存在限制。例如,我对样式有限制(这并不重要),但我想知道将来我是否可以有限制并且不能使用某些 nat
我正在尝试使用 grails 数据绑定(bind)将一些表单参数映射到我的模型中,但我认为在映射嵌入式集合方面可能存在一些限制。 例如,如果我提交一些这样的参数,那么映射工作正常: //this wo
是否可以将 django 自过滤器起的时间限制为 7 天。如果日期超过 7 天,则不应用过滤器 最佳答案 timesince 的源代码位于 django/django/utils/timesince.
我想在我的网站上嵌入一个 PayPal 捐赠按钮。但问题是我住在伊朗——这个国家受到制裁,人们不使用国际银行账户或主要信用卡。 有什么想法吗?请帮忙! 问候 沮丧 最佳答案 您可以在伊朗境内使用为伊朗
这是我的查询 select PhoneNumber as _data,PhoneType as _type from contact_phonenumbers where ContactID = 3
这个问题在这里已经有了答案: What is the maximum number of parameters passed to $in query in MongoDB? (4 个答案) 关闭
我的一个项目的 AndroidManifest.xml 变得越来越大(> 1000 行),因为我必须对某些文件类型使用react并且涵盖所有情况变得越来越复杂。我想知道 list 大小是否有任何限制。
在使用 Sybase、Infomix、DB2 等其他数据库产品多年后使用 MySQL 5.1 Enterprise 时;我遇到了 MySQL 不会做的事情。例如,它只能为 SELECT 查询生成 EX
这个问题在这里已经有了答案: What is the maximum number of parameters passed to $in query in MongoDB? (4 个回答) 关闭5年
通常我们是在{$apache}/conf/httpd.conf中设置Apache的参数,然而我们并没有发现可以设置日志文件大小的配置指令,通过参考http://httpd.apache.org/do
我正在搜索最大的 Android SharedPreferences 键值对,但找不到任何好的答案。其次,我想问一下,如果我有一个键,它的字符串值限制是多少。多少字符可以放入其中。如果我需要频繁更改值
我目前正在试验 SoundCloud API,并注意到我对/tracks 资源的 GET 请求一次从不返回超过 200 个结果。关于这个的几个问题: 这个限制是故意的吗? 有没有办法增加这个限制? 如
我正在与一家名为 Dwolla 的金融技术公司合作,该公司提供了一个 API,用于将银行信息附加到用户并收取/发送 ACH 付款。 他们需要我将我的 TLS 最低版本升级到 1.2(禁用 TLS 1.
我在 PHP 中有一个多维数组,如下所示: $array = Array ( [0] => Array ( [bill] => 1 ) [1] => Array ( [
我在获取下一个查询的第一行时遇到了问题: Select mar.Title MarketTitle, ololo.NUMBER, ololo.Title from Markets mar JOIN(
我是一名优秀的程序员,十分优秀!