k8s学习--kubernetes服务自动伸缩之水平收缩(pod副本收缩)VPA策略应用案例

文章目录

  • 前言
  • 应用
    • 环境
      • 1.VPA应用案例 updateMode: "Off"
        • (1)创建应用实例
        • (2)创建vpa
      • 2.VPA应用案例 updateMode: "Auto"
        • (1)创建应用
      • (2)创建vpa
        • (3)执行压测


前言

有任何疑问或不懂的地方均可评论或私信,欢迎交流
关于VPA的详细解释
链接: VPA的详细解释

策略
在VPA中,updateMode 是一个重要的配置选项,它决定了VPA如何应用其提供的资源建议。根据不同的设置,VPA可以采取不同的策略来更新Pod的资源配置:

Off:
VPA不会应用任何资源推荐,只是收集和显示数据。


Auto
概述:
自动调整策略在无需重启 Pod 的情况下动态调整其资源请求。

特性:
动态调整: Pod 的资源请求在运行时逐步增加。

优点:
无需重启 Pod 即可调整资源,最小化中断。
提供更及时的资源调整,适合短周期和不稳定的负载。

缺点:
由于容器运行时资源的硬限制,可能无法完全满足新资源请求,导致资源不足。


Recreate
概述:
当资源需求变化时,使用重建策略重新启动 Pod 以调整资源请求。

特性:
重启调整:Pod 会被杀死并重新创建,以适应新的资源请求。

优点:
确保 Pod 能获取到新的资源请求,避免运行时的资源限制问题。
适合稳定负载且可以容忍短暂停机的应用。

缺点:
重启 Pod 会引起短暂的服务中断。
不适合要求高可用性且不能容忍重启的工作负载。


Initial
概述:
初始调整策略仅在 Pod 第一次创建时设置资源请求,不会对运行中的 Pod 进行调整。
特性:
静态调整:在 Pod 创建时基于历史数据设定初始资源请求。

优点:
避免了运行时调整带来的复杂性。
适合长期运行的负载,初始设置资源合理即可。

缺点:
无法调整已经运行的 Pod 的资源,若需求变化则需手动干预。

应用

环境

虚拟机

Ip主机名cpu内存硬盘
192.168.10.11master012cpu双核4G100G
192.168.10.12worker012cpu双核4G100G
192.168.10.13worker022cpu双核4G100G

版本 centos7.9
已部署k8s-1.27

1.VPA应用案例 updateMode: “Off”

(1)创建应用实例

VPA不会应用任何资源推荐,只是收集和显示数据。

vim 03-nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: nginx
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest 
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            cpu: 100m
            memory: 250Mi
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: default
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
kubectl apply -f 03-nginx.yaml
kubectl get pods

在这里插入图片描述

kubectl get svc

在这里插入图片描述

(2)创建vpa

使用updateMode: "Off"模式,这种模式仅获取资源推荐,不更新Pod

 vim nginx-vpa.yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: nginx-vpa
  namespace: default
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind: Deployment
    name: nginx
  updatePolicy:
    updateMode: "Off"
  resourcePolicy:
    containerPolicies:
    - containerName: "nginx"
      minAllowed:
        cpu: "250m"
        memory: "100Mi"
      maxAllowed:
        cpu: "2000m"
        memory: "2048Mi"
kubectl apply -f nginx-vpa.yaml
 kubectl get vpa

稍等片刻
在这里插入图片描述

kubectl describe vpa nginx-vpa
Name:         nginx-vpa
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  autoscaling.k8s.io/v1
Kind:         VerticalPodAutoscaler
Metadata:
  Creation Timestamp:  2024-06-09T11:10:34Z
  Generation:          1
  Resource Version:    19449
  UID:                 be19f937-fb0c-4c33-a559-4e5aa52043b8
Spec:
  Resource Policy:
    Container Policies:
      Container Name:  nginx
      Max Allowed:
        Cpu:     2000m
        Memory:  2048Mi
      Min Allowed:
        Cpu:     250m
        Memory:  100Mi
  Target Ref:
    API Version:  apps/v1
    Kind:         Deployment
    Name:         nginx
  Update Policy:
    Update Mode:  Off
Status:
  Conditions:
    Last Transition Time:  2024-06-09T11:11:17Z
    Status:                True
    Type:                  RecommendationProvided
  Recommendation:
    Container Recommendations:
      Container Name:  nginx
      Lower Bound:
        Cpu:     250m
        Memory:  262144k
      Target:
        Cpu:     250m
        Memory:  262144k
      Uncapped Target:
        Cpu:     25m
        Memory:  262144k
      Upper Bound:
        Cpu:     1142m
        Memory:  1194357142
Events:          <none>

解释如下:
Recommendation::包含对Pod资源需求的推荐值。
Container Recommendations::针对特定容器的推荐值。
Container Name::容器名称。
Lower Bound::推荐的下限资源量。
Target::推荐的最优资源量。
Uncapped Target::如果没有上限约束,则为目标资源量。
Upper Bound::推荐的上限资源量。

kubectl get svc

在这里插入图片描述

yum -y install httpd-tools
ab -c 1000 -n 100000000 http://192.168.10.11:30478/

打开一个新终端

kubectl describe vpa nginx-vpa
Name:         nginx-vpa
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  autoscaling.k8s.io/v1
Kind:         VerticalPodAutoscaler
Metadata:
  Creation Timestamp:  2024-06-09T11:10:34Z
  Generation:          1
  Resource Version:    20221
  UID:                 be19f937-fb0c-4c33-a559-4e5aa52043b8
Spec:
  Resource Policy:
    Container Policies:
      Container Name:  nginx
      Max Allowed:
        Cpu:     2000m
        Memory:  2048Mi
      Min Allowed:
        Cpu:     250m
        Memory:  100Mi
  Target Ref:
    API Version:  apps/v1
    Kind:         Deployment
    Name:         nginx
  Update Policy:
    Update Mode:  Off
Status:
  Conditions:
    Last Transition Time:  2024-06-09T11:11:17Z
    Status:                True
    Type:                  RecommendationProvided
  Recommendation:
    Container Recommendations:
      Container Name:  nginx
      Lower Bound:
        Cpu:     250m
        Memory:  262144k
      Target:
        Cpu:     250m
        Memory:  262144k
      Uncapped Target:
        Cpu:     25m
        Memory:  262144k
      Upper Bound:
        Cpu:     802m
        Memory:  838810574
Events:          <none>

由于使用updateMode: “Off”,所以没有更新pod

kubectl get pods

在这里插入图片描述

2.VPA应用案例 updateMode: “Auto”

此模式当目前运行的pod的资源达不到VPA的推荐值,就会执行pod驱逐,重新部署新的足够资源的服务

(1)创建应用
vim 05-nginx.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: nginx
  name: nginx
  namespace: default
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
        imagePullPolicy: IfNotPresent
        resources:
          requests:
            cpu: 100m
            memory: 50Mi
---
apiVersion: v1
kind: Service
metadata:
  name: nginx
  namespace: default
spec:
  type: NodePort
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
kubectl apply -f 05-nginx.yaml
 kubectl get pods
 kubectl apply -f 05-nginx.yaml
 kubectl get pods

在这里插入图片描述

(2)创建vpa

vim nginx-vpa-auto.yaml
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: nginx-vpa-auto
  namespace: default
spec:
  targetRef:
    apiVersion: "apps/v1"
    kind: Deployment
    name: nginx
  updatePolicy:
    updateMode: "Auto"
  resourcePolicy:
    containerPolicies:
    - containerName: "nginx"
      minAllowed:
        cpu: "250m"
        memory: "100Mi"
      maxAllowed:
        cpu: "2000m"
        memory: "2048Mi"
 kubectl apply -f nginx-vpa-auto.yaml
kubectl get vpa

在这里插入图片描述

(3)执行压测
kubectl get svc

在这里插入图片描述

ab -c 1000 -n 1000000000 http://192.168.10.11:31115/

打开另一个终端

 kubectl describe vpa nginx-vpa-auto
Name:         nginx-vpa-auto
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  autoscaling.k8s.io/v1
Kind:         VerticalPodAutoscaler
Metadata:
  Creation Timestamp:  2024-06-09T11:27:07Z
  Generation:          1
  Resource Version:    21845
  UID:                 453b03aa-fba5-4bcd-aa66-f85e43a57521
Spec:
  Resource Policy:
    Container Policies:
      Container Name:  nginx
      Max Allowed:
        Cpu:     2000m
        Memory:  2048Mi
      Min Allowed:
        Cpu:     250m
        Memory:  100Mi
  Target Ref:
    API Version:  apps/v1
    Kind:         Deployment
    Name:         nginx
  Update Policy:
    Update Mode:  Auto
Status:
  Conditions:
    Last Transition Time:  2024-06-09T11:27:17Z
    Status:                True
    Type:                  RecommendationProvided
  Recommendation:
    Container Recommendations:
      Container Name:  nginx
      Lower Bound:
        Cpu:     250m
        Memory:  262144k
      Target:
        Cpu:     250m
        Memory:  262144k
      Uncapped Target:
        Cpu:     25m
        Memory:  262144k
      Upper Bound:
        Cpu:     521m
        Memory:  545693548
Events:          <none>
 kubectl get event
LAST SEEN   TYPE      REASON                   OBJECT                        MESSAGE
38m         Normal    Scheduled                pod/nginx-59d7c8bd89-q27gc    Successfully assigned default/nginx-59d7c8bd89-q27gc to worker02
38m         Normal    Pulling                  pod/nginx-59d7c8bd89-q27gc    Pulling image "nginx:latest"
38m         Normal    Pulled                   pod/nginx-59d7c8bd89-q27gc    Successfully pulled image "nginx:latest" in 18.118818504s (18.118826419s including waiting)
38m         Normal    Created                  pod/nginx-59d7c8bd89-q27gc    Created container nginx
38m         Normal    Started                  pod/nginx-59d7c8bd89-q27gc    Started container nginx
11m         Normal    Killing                  pod/nginx-59d7c8bd89-q27gc    Stopping container nginx
38m         Normal    Scheduled                pod/nginx-59d7c8bd89-qb4p4    Successfully assigned default/nginx-59d7c8bd89-qb4p4 to worker01
38m         Normal    Pulling                  pod/nginx-59d7c8bd89-qb4p4    Pulling image "nginx:latest"
38m         Normal    Pulled                   pod/nginx-59d7c8bd89-qb4p4    Successfully pulled image "nginx:latest" in 17.842596583s (17.842603536s including waiting)
38m         Normal    Created                  pod/nginx-59d7c8bd89-qb4p4    Created container nginx
38m         Normal    Started                  pod/nginx-59d7c8bd89-qb4p4    Started container nginx
11m         Normal    Killing                  pod/nginx-59d7c8bd89-qb4p4    Stopping container nginx
38m         Normal    SuccessfulCreate         replicaset/nginx-59d7c8bd89   Created pod: nginx-59d7c8bd89-q27gc
38m         Normal    SuccessfulCreate         replicaset/nginx-59d7c8bd89   Created pod: nginx-59d7c8bd89-qb4p4
11m         Normal    Scheduled                pod/nginx-6f78fbb759-hcbc6    Successfully assigned default/nginx-6f78fbb759-hcbc6 to worker02
11m         Normal    Pulled                   pod/nginx-6f78fbb759-hcbc6    Container image "nginx:latest" already present on machine
11m         Normal    Created                  pod/nginx-6f78fbb759-hcbc6    Created container nginx
11m         Normal    Started                  pod/nginx-6f78fbb759-hcbc6    Started container nginx
10m         Normal    Killing                  pod/nginx-6f78fbb759-hcbc6    Stopping container nginx
9m51s       Normal    Scheduled                pod/nginx-6f78fbb759-jhf7h    Successfully assigned default/nginx-6f78fbb759-jhf7h to worker02
9m51s       Normal    Pulled                   pod/nginx-6f78fbb759-jhf7h    Container image "nginx:latest" already present on machine
9m51s       Normal    Created                  pod/nginx-6f78fbb759-jhf7h    Created container nginx
9m51s       Normal    Started                  pod/nginx-6f78fbb759-jhf7h    Started container nginx
6m31s       Normal    Killing                  pod/nginx-6f78fbb759-jhf7h    Stopping container nginx
6m31s       Normal    EvictedByVPA             pod/nginx-6f78fbb759-jhf7h    Pod was evicted by VPA Updater to apply resource recommendation.
6m30s       Normal    Scheduled                pod/nginx-6f78fbb759-mcppm    Successfully assigned default/nginx-6f78fbb759-mcppm to worker02
6m30s       Normal    Pulled                   pod/nginx-6f78fbb759-mcppm    Container image "nginx:latest" already present on machine
6m30s       Normal    Created                  pod/nginx-6f78fbb759-mcppm    Created container nginx
6m30s       Normal    Started                  pod/nginx-6f78fbb759-mcppm    Started container nginx
9m51s       Normal    Scheduled                pod/nginx-6f78fbb759-s4xzm    Successfully assigned default/nginx-6f78fbb759-s4xzm to worker01
9m51s       Normal    Pulled                   pod/nginx-6f78fbb759-s4xzm    Container image "nginx:latest" already present on machine
9m51s       Normal    Created                  pod/nginx-6f78fbb759-s4xzm    Created container nginx
9m51s       Normal    Started                  pod/nginx-6f78fbb759-s4xzm    Started container nginx
7m31s       Normal    EvictedByVPA             pod/nginx-6f78fbb759-s4xzm    Pod was evicted by VPA Updater to apply resource recommendation.
7m31s       Normal    Killing                  pod/nginx-6f78fbb759-s4xzm    Stopping container nginx
7m30s       Normal    Scheduled                pod/nginx-6f78fbb759-x986h    Successfully assigned default/nginx-6f78fbb759-x986h to worker01
7m30s       Normal    Pulled                   pod/nginx-6f78fbb759-x986h    Container image "nginx:latest" already present on machine
7m30s       Normal    Created                  pod/nginx-6f78fbb759-x986h    Created container nginx
7m30s       Normal    Started                  pod/nginx-6f78fbb759-x986h    Started container nginx
11m         Normal    Scheduled                pod/nginx-6f78fbb759-z4sxb    Successfully assigned default/nginx-6f78fbb759-z4sxb to worker01
11m         Normal    Pulled                   pod/nginx-6f78fbb759-z4sxb    Container image "nginx:latest" already present on machine
11m         Normal    Created                  pod/nginx-6f78fbb759-z4sxb    Created container nginx
11m         Normal    Started                  pod/nginx-6f78fbb759-z4sxb    Started container nginx
10m         Normal    Killing                  pod/nginx-6f78fbb759-z4sxb    Stopping container nginx
11m         Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-hcbc6
11m         Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-z4sxb
9m52s       Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-jhf7h
9m52s       Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-s4xzm
7m31s       Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-x986h
6m31s       Normal    SuccessfulCreate         replicaset/nginx-6f78fbb759   Created pod: nginx-6f78fbb759-mcppm
38m         Normal    ScalingReplicaSet        deployment/nginx              Scaled up replica set nginx-59d7c8bd89 to 2
11m         Normal    ScalingReplicaSet        deployment/nginx              Scaled up replica set nginx-6f78fbb759 to 2
10m         Warning   FailedToUpdateEndpoint   endpoints/nginx               Failed to update endpoint default/nginx: Operation cannot be fulfilled on endpoints "nginx": the object has been modified; please apply your changes to the latest version and try again
9m52s       Normal    ScalingReplicaSet        deployment/nginx              Scaled up replica set nginx-6f78fbb759 to 2

从输出信息可以了解到,vpa执行了EvictedByVPA,自动停掉了nginx,然后使用 VPA推荐的资源启动了新的nginx,我们查看下nginx的pod可以得到确认

kubectl describe pods nginx-6f78fbb759-mcppm
Name:             nginx-6f78fbb759-mcppm
Namespace:        default
Priority:         0
Service Account:  default
Node:             worker02/192.168.10.13
Start Time:       Sun, 09 Jun 2024 19:29:09 +0800
Labels:           app=nginx
                  pod-template-hash=6f78fbb759
Annotations:      cni.projectcalico.org/containerID: 145e1f8509982da00e61eb180bb9f3b52e527bc94d8657237d340fd9bf01475a
                  cni.projectcalico.org/podIP: 10.244.30.72/32
                  cni.projectcalico.org/podIPs: 10.244.30.72/32
                  vpaObservedContainers: nginx
                  vpaUpdates: Pod resources updated by nginx-vpa-auto: container 0: cpu request, memory request
Status:           Running
IP:               10.244.30.72
IPs:
  IP:           10.244.30.72
Controlled By:  ReplicaSet/nginx-6f78fbb759
Containers:
  nginx:
    Container ID:   docker://97f865221289a48d042dfd039b2eb33876c2d08a89c2f7863fd7e42b5f7f8018
    Image:          nginx:latest
    Image ID:       docker-pullable://nginx@sha256:0f04e4f646a3f14bf31d8bc8d885b6c951fdcf42589d06845f64d18aec6a3c4d
    Port:           <none>
    Host Port:      <none>
    State:          Running
      Started:      Sun, 09 Jun 2024 19:29:10 +0800
    Ready:          True
    Restart Count:  0
    Requests:
      cpu:        250m
      memory:     262144k
    Environment:  <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-gfzhm (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  kube-api-access-gfzhm:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason     Age    From               Message
  ----    ------     ----   ----               -------
  Normal  Scheduled  8m56s  default-scheduler  Successfully assigned default/nginx-6f78fbb759-mcppm to worker02
  Normal  Pulled     8m56s  kubelet            Container image "nginx:latest" already present on machine
  Normal  Created    8m56s  kubelet            Created container nginx
  Normal  Started    8m56s  kubelet            Started container nginx

随着服务的负载的变化,VPA的推荐值也会不断变化。当目前运行的pod的资源达不到VPA的推荐值,就会执行pod驱逐,重新部署新的足够资源的服务。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/698539.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

护眼台灯哪个品牌好?几款性价比最高的护眼台灯推荐

在过去&#xff0c;科技尚未发展至如今这般先进水平时&#xff0c;晚上需要照明的时候&#xff0c;我们通常只能依赖白炽灯。尽管白炽灯以其低成本和接近自然光的显色性获得了一定的青睐&#xff0c;随着时代的发展&#xff0c;现在市面上出现了更为护眼的选择——LED台灯。然而…

VMware导入vmdk文件(亲测有效)

场景&#xff1a;从别的地方拷贝了一个系统镜像&#xff0c;实际测试案例是从vulnhub下载的Kioptix Level #4靶场解压缩以后的文件是【Kioptrix4_vmware.vmdk】后缀为名为vmdx,使用常规的方式【文件-----打开】的方式&#xff0c;不能导入虚拟机&#xff0c;现在演示如何导入到…

intel新CPU性能提升68%!却在内存上违反祖训

前几天的台北电脑展「Computex」&#xff0c;各家都拿出了看家本领。 老朋友 AMD 在会展上发布了最新的锐龙 9000 系列和自己家移动处理器 HX AI 系列&#xff0c;IPC 和能效都取得了不错的进步。 当然隔壁蓝厂 intel 也没闲着&#xff0c;当即就掏出了下一代的低功耗移动端处…

【SQL边干边学系列】05高级问题

文章目录 前言回顾高级问题32.高价值客户33.高价值的客户-总订单数34.高价值的客户-带有折扣35.月末订单36.具有许多详细信息行的订单 答案32.高价值客户33.高价值的客户-总订单数34.高价值的客户-带有折扣35.月末订单36.具有许多详细信息行的订单 未完待续 前言 该系列教程&am…

GaussDB技术解读——GaussDB架构介绍(二)

上篇图文&#xff0c;从GaussDB关键架构目标、GaussDB分布式架构、数据计算路由层&#xff08;Coordinator&#xff09;关键技术方案等三方面对GaussDB架构进行了介绍。本篇将从数据持久化存取层(DataNode)关键技术方案、全局事务管理层&#xff08;GTM&#xff09;关键技术方案…

大一学生分享网络编程聊天室-简单私聊

每天过得充实&#xff0c;你将不会焦虑 ---同行者联盟 Socket 是一种规范(标准)&#xff0c;封装了TCP协议的通信细节&#xff0c;使得我们使用它就可以完成与远端计算机的TCP链接&#xff0c;以及数据的传输。并且可以完成数据传输基于双向流的读写操作&#xff0c;Java语言…

揭秘:全自动阅读挂机项目,号称自动阅读一天窗口10-50+(脚本+教程)

首先&#xff0c;我们需要对全自动阅读挂机项目有一个基本的认识。这是一个高效利用时间和精力&#xff0c;使阅读成为一种被动行为的新型项目。它将阅读与电脑操作结合&#xff0c;通过挂机的方式&#xff0c;使得在忙碌的生活中仍能保持高效学习。 1.全自动阅读挂机项目背后…

G5 - Pix2Pix理论与实战

&#x1f368; 本文为&#x1f517;365天深度学习训练营 中的学习记录博客&#x1f356; 原作者&#xff1a;K同学啊 目录 理论知识图像翻译CGANU-NetPix2Pix损失函数模型结构生成器差别器 模型效果总结与心得体会 理论知识 前面已经学习了GAN与CGAN&#xff0c;这节开始学习P…

linux使用crontab定时执行url

在Linux操作系统中&#xff0c;Crontab是一个非常实用的工具&#xff0c;可以帮助用户定时执行任务&#xff0c;以达到自动化管理系统的目的。而在使用Crontab时&#xff0c;有时候我们可能需要让系统定时访问某个URL&#xff0c;以实现特定的功能或操作。本文将介绍如何使用Cr…

斯坦福新研究:RAG能帮助LLM更靠谱吗?

近年来&#xff0c;大型语言模型&#xff08;LLM&#xff09;在自然语言处理领域取得了显著的进展&#xff0c;但它们也存在一些问题&#xff0c;如容易产生幻觉和无法提供最新的知识。为了解决这些问题&#xff0c;研究人员提出了一种名为检索增强生成&#xff08;RAG&#xf…

猫头虎分享:2024应届生择业在大模型和智能机器人之间该如何选择?

猫头虎分享&#xff1a;2024应届生择业在大模型和智能机器人之间该如何选择&#xff1f; 博主猫头虎的技术世界 &#x1f31f; 欢迎来到猫头虎的博客 — 探索技术的无限可能&#xff01; 专栏链接&#xff1a; &#x1f517; 精选专栏&#xff1a; 《面试题大全》 — 面试准备的…

快速入门链路追踪sleuth整合zipkin(代码演示)

1、演示项目背景 2、pom.xml 3、启动项目 4、测试 5、保存数据到数据库 6、通过mq保存数据到mysql 7、通过mq保存数据到es 1、演示项目背景 下载zipkin&#xff0c;建议使用2.x版本的&#xff0c;3.x版本的要求jdk高版本。如果自己是1.8&#xff0c;就下载2.x的 下载地…

Postman环境变量以及设置token全局变量!

前言百度百科解释&#xff1a; 环境变量&#xff08;environment variables&#xff09;一般是指在操作系统中用来指定操作系统运行环境的一些参数&#xff0c;如&#xff1a;临时文件夹位置和系统文件夹位置等。 环境变量是在操作系统中一个具有特定名字的对象&#xff0c;它…

Ubuntu server 24 (Linux) 安装部署 Zabbix 7.0 LTS

一 安装Mysql 8.03 testtest:~$ mysqld --version /usr/sbin/mysqld Ver 8.0.36-2ubuntu3 for Linux on x86_64 ((Ubuntu)) #mysql 大于8.03.x ,启动zabbix-server会报错如下 Unable to start Zabbix server due to unsupported MySQL database version (8.04.00). Must not…

英伟达最新GPU和互联路线图分析

Nvidia在计算、网络和图形领域独树一帜&#xff0c;其显著优势在于雄厚的资金实力及在生成式人工智能市场的领先地位。凭借卓越的架构、工程和供应链&#xff0c;Nvidia能够自由实施创新路线图&#xff0c;引领行业未来。 到 21 世纪&#xff0c;Nvidia 已经是一个非常成功的创…

GStreamer学习2.1----获取mp4中的图片

这里通过获取mp4中的图片例子来加深Gstreamer的理解&#xff0c;问问AI实现这样功能的命令&#xff0c; 得到 gst-launch-1.0 filesrc locationtest.mp4 ! qtdemux ! queue ! h264parse ! avdec_h264 ! videoconvert ! jpegenc ! multifilesink locationoutput_image_%03d.jp…

大福利!微信付费进群源码

微信付费进群源码 前言效果图搭建教程源码领取下期更新预报 前言 1、修复SQL表 2、修复支付文件 3、修复支付图标不显示 4、修复定位、分销逻辑、抽成逻辑 5、新增支持源支付、易支付的支付接口 6、修复官方微信、支付宝支付接口文件 本来早就可以完工的&#xff0c;电脑…

MEGALODON:突破传统,实现高效无限上下文长度的大规模语言模型预训练和推理

在人工智能领域&#xff0c;尤其是在自然语言处理&#xff08;NLP&#xff09;中&#xff0c;大模型&#xff08;LLMs&#xff09;的预训练和推理效率一直是研究的热点。最近&#xff0c;一项突破性的研究提出了一种新型神经网络架构——MEGALODON&#xff0c;旨在解决传统Tran…

Redis 7.2.x 主从复制+哨兵模式

IP操作系统服务版本192.168.140.153CentOS 7redis-master,sentinel7.2.5192.168.140.156CentOS 7redis-slave,sentinel7.2.5192.168.140.159CentOS 7redis-slave,sentinel7.2.5 一、安装Redis 配置主从复制 参考下面文档&#xff1a; Redis 7.2.x 主从复制-CSDN博客文章浏览…

论文略读:Onthe Expressivity Role of LayerNorm in Transformers’ Attention

ACL 2023 研究了LayerNorm在 Transformers 中对注意力的作用LayerNorm为Transformer的Attention提供了两个重要的功能&#xff1a; 投影&#xff0c;projection LayerNorm 帮助 Attention 设计一个注意力查询&#xff0c;这样所有的Key都可以平等地访问通过将Key向量投影到同一…