当前位置: 首页 > news >正文

怎么做县城分类信息网站2345网址导航电脑版

怎么做县城分类信息网站,2345网址导航电脑版,网站开发产品规划要求,做网站公司能赚钱吗CPU 管理配置 CPU 管理策略通过 kubelet 参数 --cpu-manager-policy 或 KubeletConfiguration 中的 cpuManagerPolicy 字段来指定。 支持两种策略: none:默认策略。static:允许为节点上具有某些资源特征的 Pod 赋予增强的 CPU 亲和性和独占…

CPU 管理配置

CPU 管理策略通过 kubelet 参数 --cpu-manager-policy 或 KubeletConfiguration 中的 cpuManagerPolicy 字段来指定。 支持两种策略:

  • none:默认策略。
  • static:允许为节点上具有某些资源特征的 Pod 赋予增强的 CPU 亲和性和独占性。

更改 CPU 管理器策略

以minikube为例,修改kubelet配置:

1、添加配置:

kubectl edit configmaps kubelet-config -n kube-system

    cpuManagerPolicy: static
    kubeReserved: {cpu: 100m, memory: 100Mi}

2、在节点机器删除 rm /var/lib/kubelet/cpu_manager_state

3、重启kubelet。

4、观察是否启动成功:

systemctl status kubelet

journalctl -f

5、查看 /var/lib/kubelet/cpu_manager_state 是否变化,如:

cat /var/lib/kubelet/cpu_manager_state
{"policyName":"static","defaultCpuSet":"0-3","checksum":611748604}

设置pod绑定cpu核数

1、绑定cpu的pod配置(Guaranteed Pod):

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 100%
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: docker.io/nginx:1.27.0
          imagePullPolicy: Never
          resources:
            requests:
              cpu: 1
              memory: "50Mi"
            limits:
              cpu: 1
              memory: "50Mi"
          ports:
            - name: http
              containerPort: 80
      terminationGracePeriodSeconds: 6

2、没有绑定cpu的pod配置(非Guaranteed Pod):

apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 100%
  selector:
    matchLabels:
      app: hello
  template:
    metadata:
      labels:
        app: hello
    spec:
      containers:
        - name: myhello
          image: docker.io/library/myhello:v1.4
          imagePullPolicy: Never
          ports:
            - name: http
              containerPort: 8000
      terminationGracePeriodSeconds: 6

3、先后部署hello和nginx:

kubectl apply -f hello-deployment-rs2.yaml

kubectl apply -f nginx-deployment-rs2.yaml

观察cpu绑定效果

1、只部署hello后的绑定情况:

docker ps | grep hello

docker inspect fa0c12f34ae5 | grep -i pid

taskset -pc 94245

pid 94245's current affinity list: 0-3

2、然后继续部署nginx容器的绑定情况:

docker ps | grep nginx
docker inspect 0d42e09a0f56 | grep -i pid
taskset -pc 59820
pid 59820's current affinity list: 1

2、查看hello容器的cpu绑定情况:

taskset -pc 94245
pid 94245's current affinity list: 0,2,3

3、查看kubelet的cpu_manager_state:

cat /var/lib/kubelet/cpu_manager_state

{"policyName":"static","defaultCpuSet":"0,2-3","entries":{"9268f4b8-bf6c-4910-9f3a-a9ac879ffc60":{"nginx":"1"}},"checksum":1987962493}

4、删除nginx容器:

kubectl delete -f nginx-deployment-rs2.yaml

5、再次查看kubelet的cpu_manager_state:

cat /var/lib/kubelet/cpu_manager_state

{"policyName":"static","defaultCpuSet":"0,2-3","entries":{"9268f4b8-bf6c-4910-9f3a-a9ac879ffc60":{"nginx":"1"}},"checksum":1987962493}

6、再次查看hello的cpu绑定状态:

taskset -pc 94245
pid 94245's current affinity list: 0,2,3

hello使用的cpu并没有变化,依然只能使用3个核。

7、删除hello并再次部署hello:

kubectl delete -f hello-deployment-rs2.yaml

kubectl apply -f hello-deployment-rs2.yaml

8、观察hello的cpu绑定情况:

#hello:

taskset -pc 91704
pid 91704's current affinity list: 0-3

hello恢复调度所有cpu。

9、再次查看kubelet的cpu_manager_state:

cat /var/lib/kubelet/cpu_manager_state
{"policyName":"static","defaultCpuSet":"0-3","checksum":611748604}

实验结论:

1、虽然设置了static调度模式,但是只要不部署独占cpu的pod即Guaranteed Pod,其他pod都可以在所有cpu上调度。

2、Guaranteed Pod部署后,非Guaranteed Pod会动态腾出cpu核心供Guaranteed Pod独占。

3、节点内的cpu已存在被Guaranteed Pod绑定核心后,只有在独占cpu核心的Guaranteed Pod全部退出后,然后其他pod重新部署后才能恢复其他pod在所有cpu上的调度。

--end--

http://www.yayakq.cn/news/110144/

相关文章:

  • 大学生网站建设策划书网站做gzip压缩
  • Ul设计网站近期军事新闻事件
  • 国信网络模版网站建设方案相关网站搭建中页面
  • 购物网站开发企业信用信息公示系统网址年检
  • 中交路桥建设有限公司地址招聘seo网站推广
  • wordpress 突然502网络优化器下载
  • wordpress 上传网站吗兰州网站建设搜王道下拉
  • 建设婚纱摄影网站的重要性设计周
  • 手机端网站如何做中山网站制作系统
  • 临沂网站建设电话4399网页版
  • 网站建设安全需求百度销售系统
  • 顺天亿建设网站无代码开发平台 免费
  • 建网络商城网站吗优化大师安卓版
  • 期货融网站建设icp备案服务码
  • 北京住房和城乡建设部网站首页常州本地网站
  • 舟山建设信息港wordpress h1标签优化
  • 建设工程官方网站北京市保障性住建设投资中心网站首页
  • 旅游网站系统源码网站百度搜索情况和反链接优化建议
  • 网站开发文案没域名 打开网站
  • 涂鸦网站建设企业邮箱申请理由
  • 做网站开发学什么软件电商网站开发需求文档
  • 盘锦网站建设公司哈尔滨网页设计推广
  • 建站工具箱建设部网站资质标准
  • 实训课做一个网站怎么做软件编程学什么专业
  • 谷歌建站哪家好京蓝科技(000711) 股吧
  • 跨境电商网站建设流程成都市公服广州海珠做网站
  • 网站icp备案条件中信建设有限责任公司哈萨克斯坦分公司
  • 永州网站制作怎么建设自己网站首页
  • 山东网站建设软件有没有做美食的规模网站
  • 朝阳网站建设开发网站开发后台注意事项