Server resource expansion method and system based on container cloud engine
By deploying containerized applications in the container cloud engine and formulating automatic scaling rules based on monitoring logs, the problem of inaccurate performance thresholds in the existing technology is solved, and more efficient resource expansion and load balancing is achieved.
Patent Information
- Application Number
- CN202411204570.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-08-30
AI Technical Summary
In the prior art, automation expansion rules are affected by various factors, resulting in inaccurate performance thresholds, affecting the automation expansion effect, and poor adaptability to resource expansion.
By developing and packaging applications for container images, deploy containerized applications using container orchestration tools, and formulate automatic scaling rules based on previous monitoring logs, monitor performance in real time, configure load balancing, and optimize container images to improve the accuracy of performance thresholds.
Improve the accuracy and accuracy of performance threshold determination, ensure resource expansion effect, and meet application expansion needs.
Smart Images

Figure CN118708300B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and more specifically, to a server resource expansion method and system based on a container cloud engine. Background Art
[0002] Server resource expansion based on container cloud engine is an automated resource management method that relies on container technology and container orchestration platform to dynamically adjust server resources according to application requirements. This relies on key technologies such as monitoring, automated expansion strategies, load balancing, and elastic storage to ensure high availability, performance, and resource efficiency. This approach can be used to build elastic and efficient application deployment and management to adapt to changes in dynamic workloads and resource requirements.
[0003] In the prior art, automated expansion rules are subject to many influences, resulting in inaccurate performance thresholds, which in turn affects the automated expansion effect and poor resource expansion adaptability.
[0004] Therefore, how to improve the accuracy of performance threshold determination is a technical problem that needs to be solved. Summary of the invention
[0005] The present invention provides a server resource expansion method based on a container cloud engine to solve the technical problem of low performance threshold accuracy in the prior art. The method comprises:
[0006] Develop and package applications or microservices as container images, deploy container images in container cloud engines, and use container orchestration tools to deploy containerized applications;
[0007] Formulate automatic expansion rules based on the application's previous monitoring logs, monitor the application's performance in real time, and expand container instances when the application meets the automatic expansion rules;
[0008] Configure the load conditions between multiple containers to achieve load balancing;
[0009] Optimize container images and use CI / CD for continuous integration and delivery.
[0010] In some embodiments of the present application, automatic expansion rules are formulated based on previous monitoring logs of the application, including:
[0011] Obtain all performance indicators from previous monitoring logs, and receive application performance requirements and application user experience requirements;
[0012] Determine a corresponding first performance indicator among all performance indicators according to the application performance requirement, and determine a corresponding second performance indicator among all performance indicators according to the application user experience requirement;
[0013] Taking the same performance indicator of the first performance indicator and the second performance indicator as the third performance indicator, and removing the third performance indicator from the first performance indicator and the second performance indicator to obtain new first performance indicator and second performance indicator;
[0014] The threshold values corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, so as to formulate automatic expansion rules.
[0015] In some embodiments of the present application, the threshold values corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, including:
[0016] Determine a first interval and a second interval of the first performance indicator according to a service level agreement of the application and a performance requirement of the application, respectively, and use the lower of the first interval and the second interval as an initial interval of the first performance indicator;
[0017] Determine a first interval and a second interval of the second performance indicator respectively according to a service level agreement of the application and a user experience requirement of the application, and use the lower of the first interval and the second interval as an initial interval of the second performance indicator;
[0018] Determine the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator respectively according to the records of the first performance indicator, the second performance indicator, and the third performance indicator in the previous monitoring log;
[0019] Determine a first threshold value according to an initial interval and a third interval of the first performance indicator and the second performance indicator, determine a second threshold value according to the first threshold value and a security requirement of the application program, and use the second threshold value as a threshold value of the first performance indicator and the second performance indicator;
[0020] A third threshold is determined according to a third interval of the third performance indicator and a security requirement of the application program, and the third threshold is used as a threshold of the third performance indicator.
[0021] In some embodiments of the present application, the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined respectively according to the first performance indicator, the second performance indicator, and the third performance indicator records in the previous monitoring log, including:
[0022] Establishing a data distribution graph of the first performance indicator, the second performance indicator, and the third performance indicator changing over time within a preset period;
[0023] In the interval greater than the first indicator threshold value corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator, the point value with the highest frequency of occurrence is taken as the initial endpoint, so as to determine the standard indicator interval corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator;
[0024] Determine the first distance, the second distance and the third distance corresponding to the first performance indicator, the second performance indicator and the third performance indicator respectively based on the length of the standard indicator interval;
[0025] The point value with the highest frequency of occurrence within the first distance greater than the initial endpoint is taken as the first closed endpoint, the standard index interval is expanded according to the first closed endpoint, and the expanded standard index interval is taken as the third interval of the first performance indicator;
[0026] The point value with the highest frequency of occurrence within the second distance greater than the initial endpoint is used as the second closed endpoint, the standard index interval is expanded according to the second closed endpoint, and the expanded standard index interval is used as the third interval of the second performance indicator;
[0027] The point value with the highest frequency of occurrence within the third distance greater than the initial endpoint is taken as the third closed endpoint, the standard indicator interval is expanded according to the third closed endpoint, and the expanded standard indicator interval is taken as the third interval of the third performance indicator.
[0028] In some embodiments of the present application, determining a first threshold value according to an initial interval and a third interval of a first performance indicator and a second performance indicator, and determining a second threshold value according to the first threshold value and a security requirement of an application program include:
[0029] Using the intersection of the initial interval and the third interval of the first performance indicator and the second performance indicator as the first threshold value of the first performance indicator and the second performance indicator;
[0030] determining a fourth interval according to the security requirements of the application program, and if the fourth interval is within the first threshold, using the first threshold as the second threshold;
[0031] Otherwise, the intersection of the fourth interval and the first threshold is used as the second threshold.
[0032] In some embodiments of the present application, determining the third threshold according to the third interval of the third performance indicator and the security requirement of the application program includes:
[0033] determining a fifth interval according to the security requirements of the application program, and if the fifth interval is within the third interval, using the third interval as a third threshold;
[0034] Otherwise, the intersection of the third interval and the fifth interval is used as the third threshold.
[0035] In some embodiments of the present application, the performance of the application is monitored in real time, and container instance expansion is performed when the application meets the automatic expansion rules, including:
[0036] Monitor the first performance indicator, the second performance indicator and the third performance indicator of the application program in real time;
[0037] When the matching degree of the first performance indicator, the second performance indicator, and the third performance indicator with their respective corresponding thresholds exceeds a preset matching degree, the container instance is expanded;
[0038] At the same time, the load change during this period is obtained, and the load change degree is determined according to the load change;
[0039] If the load change degree exceeds the load change threshold, the extended delay is the first delay interval, otherwise, the extended delay is the second delay interval;
[0040] A comprehensive performance indicator is determined according to the first performance indicator, the second performance indicator, and the third performance indicator, and an expansion delay is determined within the first delay interval or the second delay interval according to the comprehensive performance indicator, so as to perform container instance expansion.
[0041] In some embodiments of the present application, optimizing the container image includes:
[0042] Choose a lightweight base image and merge multiple instructions into a single instruction, thereby reducing the number of image layers;
[0043] Determine the necessity level of each file and dependency, and delete the files and dependencies whose necessity level is lower than the necessity level threshold;
[0044] Compress files within a reasonable range and use multi-stage builds to reduce the size of container images.
[0045] Correspondingly, the present application also provides a server resource expansion system based on a container cloud engine, the system comprising:
[0046] The deployment module is used to develop and package applications or microservices as container images, deploy container images in the container cloud engine, and use container orchestration tools to deploy containerized applications;
[0047] The extension module is used to formulate automatic expansion rules based on the application's previous monitoring logs, monitor the application's performance in real time, and expand the container instance when the application meets the automatic expansion rules;
[0048] The balancing module is used to configure the load conditions between multiple containers to achieve load balancing;
[0049] The optimization module is used to optimize container images and use CI / CD for continuous integration and delivery.
[0050] By applying the above technical solutions, develop and package applications or microservices as container images, deploy container images in the container cloud engine, and use container orchestration tools to deploy containerized applications; formulate automatic expansion rules based on the previous monitoring logs of the application, monitor the performance of the application in real time, and expand the container instance when the application meets the automatic expansion rules; configure the load between multiple containers to achieve load balancing; optimize container images, and use CI / CD for continuous integration and delivery. This application formulates automatic expansion rules based on the previous monitoring logs of the application, and expands the container instance when the application meets the automatic expansion rules, which improves the precision and accuracy of the performance threshold determination, ensures the resource expansion effect, and meets the expansion needs of the application. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0052] Figure 1 A schematic diagram of a process of a server resource expansion method based on a container cloud engine proposed in an embodiment of the present invention is shown;
[0053] Figure 2 A structural schematic diagram of a server resource expansion system based on a container cloud engine proposed in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] The present application embodiment provides a server resource expansion method based on a container cloud engine, such as Figure 1 As shown, the method comprises the following steps:
[0056] Step S101, develop and package the application or microservice into a container image, deploy the container image in the container cloud engine, and use the container orchestration tool to deploy the containerized application.
[0057] In this example, prepare the infrastructure and deploy a container cloud engine on a cloud service provider (such as AWS, Azure, Google Cloud) or a private data center. Develop and package applications or microservices as container images, which can be deployed to the container cloud engine. Use Docker for containerization to package the application and its dependencies into images. Use container orchestration tools (such as Kubernetes) to deploy containerized applications. Create resource objects such as Pod, Deployment, and Service to define the deployment and service configuration of the application.
[0058] Step S102, formulate automatic expansion rules according to the previous monitoring logs of the application, monitor the performance of the application in real time, and expand the container instance when the application meets the automatic expansion rules.
[0059] In this embodiment, monitoring tools are set up to monitor the performance and resource utilization of applications in real time. Tools such as Prometheus and Grafana can be used for monitoring. Automated rules and policies are established to automatically scale container instances up or down based on performance requirements. This is usually done using a horizontal autoscaler, such as Kubernetes' HorizontalPod Autoscaler (HPA).
[0060] In some embodiments of the present application, automatic expansion rules are formulated based on previous monitoring logs of the application, including:
[0061] Obtain all performance indicators from previous monitoring logs, and receive application performance requirements and application user experience requirements;
[0062] Determine a corresponding first performance indicator among all performance indicators according to the application performance requirement, and determine a corresponding second performance indicator among all performance indicators according to the application user experience requirement;
[0063] Taking the same performance indicator of the first performance indicator and the second performance indicator as the third performance indicator, and removing the third performance indicator from the first performance indicator and the second performance indicator to obtain new first performance indicator and second performance indicator;
[0064] The threshold values corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, so as to formulate automatic expansion rules.
[0065] In this embodiment, the performance indicators are related to the performance of the application and the user experience, and are divided into three categories.
[0066] In this embodiment, the first performance indicator represents the performance requirement of the application, the second performance indicator represents the user experience requirement of the application, and the third performance indicator can represent both the performance requirement and the experience requirement.
[0067] In this embodiment, the application involves a service level agreement (SLA), and the performance indicators and thresholds in the SLA should be taken into consideration. The SLA usually specifies the requirements for application availability, response time, etc. Consider the security requirements and tolerance of the application. Some applications may require stricter performance monitoring and lower thresholds to ensure security.
[0068] In some embodiments of the present application, the threshold values corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, including:
[0069] Determine a first interval and a second interval of the first performance indicator according to a service level agreement of the application and a performance requirement of the application, respectively, and use the lower of the first interval and the second interval as an initial interval of the first performance indicator;
[0070] Determine a first interval and a second interval of the second performance indicator respectively according to a service level agreement of the application and a user experience requirement of the application, and use the lower of the first interval and the second interval as an initial interval of the second performance indicator;
[0071] Determine the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator respectively according to the records of the first performance indicator, the second performance indicator, and the third performance indicator in the previous monitoring log;
[0072] Determine a first threshold value according to an initial interval and a third interval of the first performance indicator and the second performance indicator, determine a second threshold value according to the first threshold value and a security requirement of the application program, and use the second threshold value as a threshold value of the first performance indicator and the second performance indicator;
[0073] A third threshold is determined according to a third interval of the third performance indicator and a security requirement of the application program, and the third threshold is used as a threshold of the third performance indicator.
[0074] In this embodiment, the thresholds of the three performance indicators are determined by comprehensively considering the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application.
[0075] In some embodiments of the present application, the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator are determined respectively according to the first performance indicator, the second performance indicator, and the third performance indicator records in the previous monitoring log, including:
[0076] Establishing a data distribution graph of the first performance indicator, the second performance indicator, and the third performance indicator changing over time within a preset period;
[0077] In the interval greater than the first indicator threshold value corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator, the point value with the highest frequency of occurrence is taken as the initial endpoint, so as to determine the standard indicator interval corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator;
[0078] Determine the first distance, the second distance and the third distance corresponding to the first performance indicator, the second performance indicator and the third performance indicator respectively based on the length of the standard indicator interval;
[0079] The point value with the highest frequency of occurrence within the first distance greater than the initial endpoint is taken as the first closed endpoint, the standard index interval is expanded according to the first closed endpoint, and the expanded standard index interval is taken as the third interval of the first performance indicator;
[0080] The point value with the highest frequency of occurrence within the second distance greater than the initial endpoint is used as the second closed endpoint, the standard index interval is expanded according to the second closed endpoint, and the expanded standard index interval is used as the third interval of the second performance indicator;
[0081] The point value with the highest frequency of occurrence within the third distance greater than the initial endpoint is taken as the third closed endpoint, the standard indicator interval is expanded according to the third closed endpoint, and the expanded standard indicator interval is taken as the third interval of the third performance indicator.
[0082] In this embodiment, the first distance, the second distance and the third distance corresponding to the first performance indicator, the second performance indicator and the third performance indicator are respectively determined based on the length of the standard indicator interval, and the performance indicators within this distance are in the critical interval of the application.
[0083] In some embodiments of the present application, determining a first threshold value according to an initial interval and a third interval of a first performance indicator and a second performance indicator, and determining a second threshold value according to the first threshold value and a security requirement of an application program include:
[0084] Using the intersection of the initial interval and the third interval of the first performance indicator and the second performance indicator as the first threshold value of the first performance indicator and the second performance indicator;
[0085] determining a fourth interval according to the security requirements of the application program, and if the fourth interval is within the first threshold, using the first threshold as the second threshold;
[0086] Otherwise, the intersection of the fourth interval and the first threshold is used as the second threshold.
[0087] In this embodiment, generally, either the fourth interval is within the first threshold, or the fourth interval intersects with the first threshold.
[0088] In some embodiments of the present application, determining the third threshold according to the third interval of the third performance indicator and the security requirement of the application program includes:
[0089] determining a fifth interval according to the security requirements of the application program, and if the fifth interval is within the third interval, using the third interval as a third threshold;
[0090] Otherwise, the intersection of the third interval and the fifth interval is used as the third threshold.
[0091] In this embodiment, generally, either the fifth interval is within the third interval, or there is an intersection between the third interval and the fifth interval.
[0092] In some embodiments of the present application, the performance of the application is monitored in real time, and container instance expansion is performed when the application meets the automatic expansion rules, including:
[0093] Monitor the first performance indicator, the second performance indicator and the third performance indicator of the application program in real time;
[0094] When the matching degree of the first performance indicator, the second performance indicator, and the third performance indicator with their respective corresponding thresholds exceeds a preset matching degree, the container instance is expanded;
[0095] At the same time, the load change during this period is obtained, and the load change degree is determined according to the load change;
[0096] If the load change degree exceeds the load change threshold, the extended delay is the first delay interval, otherwise, the extended delay is the second delay interval;
[0097] A comprehensive performance indicator is determined according to the first performance indicator, the second performance indicator, and the third performance indicator, and an expansion delay is determined within the first delay interval or the second delay interval according to the comprehensive performance indicator, so as to perform container instance expansion.
[0098] In this embodiment, when the matching degree of the first performance indicator, the second performance indicator and the third performance indicator with their respective corresponding thresholds exceeds the preset matching degree, the container instance is expanded. The first performance indicator, the second performance indicator and the third performance indicator have different corresponding weights, thereby determining the total matching degree.
[0099] In this embodiment, the container is expanded here, and the container reduction is similar to it, which will not be described in detail here.
[0100] In this embodiment, to avoid frequent expansion and reduction of container instances in a short period of time, you can set some delays. For example, you can set a reduction delay so that the system waits for 5 minutes for performance data to stabilize before performing a reduction operation. The pattern of the workload has an important impact on the delay setting. If the workload changes frequently, you may need a shorter reduction and expansion delay to respond to changes more quickly. On the contrary, if the changes in the workload are relatively stable, you can use a longer delay to avoid frequent expansion and reduction operations.
[0101] In this embodiment, the comprehensive performance index is determined according to the first performance index, the second performance index and the third performance index. Similar to the above, the first performance index, the second performance index and the third performance index have different weights. Different comprehensive performance indexes correspond to different delays.
[0102] Step S103: configure the load conditions between multiple containers to achieve load balancing.
[0103] In this embodiment, configuring load balancing is an important step to ensure even distribution of traffic between container instances to improve the availability and performance of the application. The following are the general steps to configure load balancing in the container cloud engine:
[0104] 1. Choose a suitable load balancer:
[0105] In container cloud engines, load balancer services or functions are usually used, such as Service resources or Ingress resources in Kubernetes, built-in load balancing in Docker Swarm, etc.
[0106] If you use a managed container service from a cloud provider, such as AWS Elastic Kubernetes Service (EKS) or Google Kubernetes Engine (GKE), they often provide integration with a load balancer.
[0107] 2. Define the service:
[0108] Create a Service or Ingress (in Kubernetes) or other similar object to direct traffic to the container instance. This object will act as the entry point for the load balancer.
[0109] Specify the application's label selectors or routing rules in a Service or Ingress to determine which container instances receive traffic.
[0110] 3. Select a load balancing algorithm:
[0111] Configure the load balancing algorithm to determine how to distribute traffic to container instances. Common algorithms include round-robin, least connections, least load, etc.
[0112] Choose the appropriate algorithm based on the application's needs to ensure even traffic distribution.
[0113] 4. Configure health check:
[0114] To ensure that only healthy container instances receive traffic, configure health checks. These checks detect the availability of container instances and route traffic to healthy instances.
[0115] Health checks can check the container's HTTP endpoint, TCP port, or custom script, etc.
[0116] 5. External Load Balancer:
[0117] If you are using a managed container service from a cloud provider, you will typically also need to configure an external load balancer to route traffic from the internet to the load balancer service.
[0118] 6. Testing and monitoring:
[0119] Always test your load balancing configuration before going to production to ensure that traffic is distributed as expected.
[0120] Set up a monitoring system to track load balancer performance and traffic distribution. If problems are found, adjust the configuration in time.
[0121] Step S104: Optimize the container image and use CI / CD for continuous integration and delivery.
[0122] In some embodiments of the present application, optimizing the container image includes:
[0123] Choose a lightweight base image and merge multiple instructions into a single instruction, thereby reducing the number of image layers;
[0124] Determine the necessity level of each file and dependency, and delete the files and dependencies whose necessity level is lower than the necessity level threshold;
[0125] Compress files within a reasonable range and use multi-stage builds to reduce the size of container images.
[0126] In this example, to optimize container images to ensure they are lightweight and efficient enough to reduce resource utilization and startup time, you can take the following simple steps:
[0127] 1. Choose a lightweight base image:
[0128] Choose a lightweight base image, such as Alpine Linux or Scratch. This will reduce the initial size of the image, thereby reducing resource usage.
[0129] 2Minimize the image layer:
[0130] Combine multiple instructions into one to reduce the number of layers in the image. This can be achieved by using multi-stage builds.
[0131] 3 contains only necessary files and dependencies:
[0132] Remove unnecessary files and dependencies to reduce the size of the image. Use the .dockerignore file to exclude unnecessary files and directories.
[0133] 4 Compress files and resources:
[0134] When building an image, compress files and resources to reduce the size of the image. For example, use gzip or tar to compress the files.
[0135] 5 Use multi-stage builds:
[0136] Use multi-stage builds to reduce the size of the final container image. In the first stage, build the application and then copy it into the final image. This can reduce the presence of unnecessary build tools and dependencies.
[0137] 6Minimize runtime dependencies:
[0138] Include only the runtime dependencies required by your application in your container image, removing unnecessary packages and library files.
[0139] 7 Use the latest version of the base image:
[0140] Update base images regularly to ensure they contain the latest security fixes and performance improvements.
[0141] 8 Cache building steps:
[0142] Use a build cache to avoid repeatedly downloading and compiling dependencies. This can significantly reduce build times.
[0143] 9 Avoid using the root user:
[0144] Avoid using the root user in containers to enhance security. Use non-privileged users to run applications.
[0145] 10. Clean up unnecessary temporary files:
[0146] During the build process, make sure to delete temporary files and caches that are no longer needed to reduce the size of the image.
[0147] 11Optimize the order of instructions in Dockerfile:
[0148] When defining a Dockerfile, place instructions that change less frequently at the end to take advantage of Docker's caching mechanism. This can speed up the build process.
[0149] 12 Use multiple versions of the image:
[0150] If your application depends on multiple dependency versions, you can create multiple image versions to meet different needs. This can reduce the size of each image because they only contain the required dependency versions.
[0151] 13. Regularly review and optimize images:
[0152] Regularly review container images to find unnecessary components or files and optimize them. As your application evolves, you may need to perform optimizations regularly.
[0153] In this example, using CI / CD (continuous integration and continuous delivery / continuous deployment) processes to automatically build, test, and deploy new versions of containerized applications can increase development speed and application reliability. The following are general steps to achieve this goal:
[0154] 1Set up the code repository:
[0155] Host your application's source code in a version control system such as Git. Make sure the repository contains all of your application's code and dependencies.
[0156] 2 Create Dockerfile:
[0157] Create a Dockerfile for your application, which defines how to build the container image. This includes choosing a base image, copying your application code and dependencies, setting up the container's runtime environment, etc.
[0158] 3. Write automated tests:
[0159] Write automated test cases including unit tests, integration tests, and end-to-end tests. These test cases should cover different aspects of the application to ensure its functionality and performance.
[0160] 4 Create a CI / CD pipeline:
[0161] Use CI / CD tools (such as Jenkins, Travis CI, GitLab CI / CD, CircleCI, etc.) to create an automated deployment pipeline.
[0162] 5In the CI / CD pipeline, define the following main steps:
[0163] Build: Build a container image based on the Dockerfile.
[0164] Testing: Run automated tests, including unit tests, integration tests, and end-to-end tests.
[0165] Deployment: Deploy the containerized application to the target environment, which can be development, test, or production.
[0166] Monitoring and reporting: Integrate monitoring and reporting tools to notify development teams when issues arise.
[0167] 6 Automation triggers:
[0168] Configure CI / CD pipelines to automatically trigger build, test, and deploy actions when new commits or branch merges are made to your code repository.
[0169] 7. Environmental Management:
[0170] Use Infrastructure as Code (IaC) tools (such as Terraform, Ansible, AWS CloudFormation, etc.) to manage the infrastructure of the target environment.
[0171] Integrate environment management in the CI / CD pipeline to ensure that every deployment can be performed in a clean environment.
[0172] 8Container Registry:
[0173] Configure a container registry (e.g. Docker Hub, Amazon ECR, Google Container Registry, etc.) to store the built container images.
[0174] 9 Deployment Strategy:
[0175] Define different deployment strategies for different environments (development, testing, production, etc.). This may include rolling deployment, blue-green deployment, or canary deployment.
[0176] 10 Monitoring and logging:
[0177] Integrate monitoring and log management tools to monitor the performance and health of applications in real time. This helps to detect and resolve problems in a timely manner.
[0178] 11Rollback strategy:
[0179] In case of deployment failure or problems, define a rollback strategy so that you can quickly roll back to the previous stable version.
[0180] 12 Documentation and Training:
[0181] Write documents for team members to explain how to use CI / CD processes and tools. Provide training to ensure team members can use CI / CD tools effectively.
[0182] 13Continuous optimization:
[0183] Regularly review and improve CI / CD processes to adapt to changing requirements and best practices.
[0184] By applying the above technical solutions, develop and package applications or microservices as container images, deploy container images in the container cloud engine, and use container orchestration tools to deploy containerized applications; formulate automatic expansion rules based on the application's previous monitoring logs, monitor the application's performance in real time, and expand container instances when the application meets the automatic expansion rules; configure the load between multiple containers to achieve load balancing; optimize container images, and use CI / CD for continuous integration and delivery. This application formulates automatic expansion rules based on the application's previous monitoring logs, and expands container instances when the application meets the automatic expansion rules, which improves the precision and accuracy of performance threshold determination, ensures the resource expansion effect, and meets the application's expansion needs.
[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present invention can be implemented by hardware, or by software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present invention.
[0186] In order to further explain the technical idea of the present invention, the technical solution of the present invention is now described in combination with specific application scenarios.
[0187] Correspondingly, this application also provides a server resource expansion system based on a container cloud engine, such as Figure 2 As shown, the system comprises:
[0188] A deployment module 201 is used to develop and package applications or microservices as container images, deploy the container images in a container cloud engine, and deploy containerized applications using a container orchestration tool;
[0189] The expansion module 202 is used to formulate automatic expansion rules based on the previous monitoring logs of the application, monitor the performance of the application in real time, and expand the container instance when the application meets the automatic expansion rules;
[0190] The balancing module 203 is used to configure the load conditions between multiple containers to achieve load balancing;
[0191] The optimization module 204 is used to optimize the container image and use CI / CD for continuous integration and delivery.
[0192] Those skilled in the art will appreciate that the modules in the system in the implementation scenario can be distributed in the system of the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more systems different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0193] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A server resource expansion method based on a container cloud engine, characterized in that: The method comprises: Develop and package applications or microservices as container images, deploy container images in container cloud engines, and use container orchestration tools to deploy containerized applications; Formulate automatic expansion rules based on the application's previous monitoring logs, monitor the application's performance in real time, and expand container instances when the application meets the automatic expansion rules; Configure the load conditions between multiple containers to achieve load balancing; Optimize container images and use CI / CD for continuous integration and delivery; Formulate automatic expansion rules based on the application's previous monitoring logs, including: Obtain all performance indicators from previous monitoring logs, and receive application performance requirements and application user experience requirements; Determine a corresponding first performance indicator among all performance indicators according to the application performance requirement, and determine a corresponding second performance indicator among all performance indicators according to the application user experience requirement; Taking the same performance indicator of the first performance indicator and the second performance indicator as the third performance indicator, and removing the third performance indicator from the first performance indicator and the second performance indicator to obtain new first performance indicator and second performance indicator; Determine the threshold values corresponding to the first performance indicator, the second performance indicator, and the third performance indicator according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, so as to formulate an automatic expansion rule; Determining thresholds corresponding to the first performance indicator, the second performance indicator, and the third performance indicator according to the service level agreement of the application, the performance requirements of the application, the user experience requirements of the application, and the security requirements of the application, including: Determine a first interval and a second interval of the first performance indicator according to a service level agreement of the application and a performance requirement of the application, respectively, and use the lower of the first interval and the second interval as an initial interval of the first performance indicator; Determine a first interval and a second interval of the second performance indicator respectively according to a service level agreement of the application and a user experience requirement of the application, and use the lower of the first interval and the second interval as an initial interval of the second performance indicator; Determine the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator respectively according to the records of the first performance indicator, the second performance indicator, and the third performance indicator in the previous monitoring log; Determine a first threshold value according to an initial interval and a third interval of the first performance indicator and the second performance indicator, determine a second threshold value according to the first threshold value and a security requirement of the application program, and use the second threshold value as a threshold value of the first performance indicator and the second performance indicator; determining a third threshold according to a third interval of the third performance indicator and a security requirement of the application program, and using the third threshold as a threshold of the third performance indicator; Determine the third intervals corresponding to the first performance indicator, the second performance indicator, and the third performance indicator respectively according to the previous monitoring log, including: Establishing a data distribution graph of the first performance indicator, the second performance indicator, and the third performance indicator changing over time within a preset period; In the interval greater than the first indicator threshold value corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator, the point value with the highest frequency of occurrence is taken as the initial endpoint, so as to determine the standard indicator interval corresponding to each of the first performance indicator, the second performance indicator and the third performance indicator; Determine the first distance, the second distance and the third distance corresponding to the first performance indicator, the second performance indicator and the third performance indicator respectively based on the length of the standard indicator interval; The point value with the highest frequency of occurrence within the first distance greater than the initial endpoint is taken as the first closed endpoint, the standard index interval is expanded according to the first closed endpoint, and the expanded standard index interval is taken as the third interval of the first performance indicator; The point value with the highest frequency of occurrence within the second distance greater than the initial endpoint is used as the second closed endpoint, the standard index interval is expanded according to the second closed endpoint, and the expanded standard index interval is used as the third interval of the second performance indicator; The point value with the highest frequency of occurrence within the third distance greater than the initial endpoint is taken as the third closed endpoint, the standard index interval is expanded according to the third closed endpoint, and the expanded standard index interval is taken as the third interval of the third performance indicator; Determining a first threshold according to an initial interval and a third interval of the first performance indicator and the second performance indicator, and determining a second threshold according to the first threshold and a security requirement of the application program, including: Using the intersection of the initial interval and the third interval of the first performance indicator and the second performance indicator as the first threshold value of the first performance indicator and the second performance indicator; determining a fourth interval according to the security requirements of the application program, and if the fourth interval is within the first threshold, using the first threshold as the second threshold; otherwise, taking the intersection of the fourth interval and the first threshold as the second threshold; Determining a third threshold according to a third interval of the third performance indicator and a security requirement of the application program includes: determining a fifth interval according to the security requirements of the application program, and if the fifth interval is within the third interval, using the third interval as a third threshold; Otherwise, the intersection of the third interval and the fifth interval is used as the third threshold.
2. The server resource expansion method based on the container cloud engine according to claim 1, characterized in that: Monitor application performance in real time and scale container instances when applications meet automatic scaling rules, including: Monitor the first performance indicator, the second performance indicator and the third performance indicator of the application program in real time; When the matching degree of the first performance indicator, the second performance indicator, and the third performance indicator with their respective corresponding thresholds exceeds a preset matching degree, the container instance is expanded; At the same time, the load change during this period is obtained, and the load change degree is determined according to the load change; If the load change degree exceeds the load change threshold, the extended delay is the first delay interval, otherwise, the extended delay is the second delay interval; A comprehensive performance indicator is determined according to the first performance indicator, the second performance indicator, and the third performance indicator, and an expansion delay is determined within the first delay interval or the second delay interval according to the comprehensive performance indicator, so as to perform container instance expansion.
3. The server resource expansion method based on the container cloud engine according to claim 1, characterized in that: Optimize container images, including: Choose a lightweight base image and merge multiple instructions into a single instruction, thereby reducing the number of image layers; Determine the necessity level of each file and dependency, and delete the files and dependencies whose necessity level is lower than the necessity level threshold; Compress files within a reasonable range and use multi-stage builds to reduce the size of container images.
4. A server resource expansion system based on a container cloud engine, applied to a server resource expansion method based on a container cloud engine as described in any one of claims 1 to 3, characterized in that: The system comprises: The deployment module is used to develop and package applications or microservices as container images, deploy container images in the container cloud engine, and use container orchestration tools to deploy containerized applications; The extension module is used to formulate automatic expansion rules based on the application's previous monitoring logs, monitor the application's performance in real time, and expand the container instance when the application meets the automatic expansion rules; The balancing module is used to configure the load conditions between multiple containers to achieve load balancing; The optimization module is used to optimize container images and use CI / CD for continuous integration and delivery.
Citation Information
Patent Citations
Chip testing method and device
CN116224013A
Management method, apparatus and device for container cluster, and non-volatile readable storage medium
WO2024077885A1