WO2018121210A1 - Elastic scaling method and device for containerized application on paas platform - Google Patents
Elastic scaling method and device for containerized application on paas platform Download PDFInfo
- Publication number
- WO2018121210A1 WO2018121210A1 PCT/CN2017/115049 CN2017115049W WO2018121210A1 WO 2018121210 A1 WO2018121210 A1 WO 2018121210A1 CN 2017115049 W CN2017115049 W CN 2017115049W WO 2018121210 A1 WO2018121210 A1 WO 2018121210A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- user data
- containerized application
- threshold
- containerized
- microservice
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Definitions
- the present disclosure relates to the field of communications technologies, and in particular, to a method and apparatus for shrinking a containerized application of a PaaS platform.
- PaaS Platform-as-a-Service
- the PaaS platform not only needs to complete the rapid deployment of containerized applications, but also supports the elastic scaling of the applications it carries to meet the needs of business expansion and capacity reduction. For example, in the telecommunications field, more and more network functions are beginning to be hosted on the PaaS platform in the form of containerized applications.
- a traditional communication network element is split into functional energy sets composed of multiple services.
- a complete network function is generally composed of multiple services with different characteristics, each of which contains multiple microservices (Microservice).
- the entity of the microservice is generally a containerized application, which is also a functional entity that the PaaS platform can deploy independently. There may be several serving cells in the microservice to provide services to network users. When the service cell business volume changes suddenly, the PaaS platform needs to expand or shrink a number of micro service instances according to the current business volume elasticity, that is, containerized applications to meet business needs.
- the present disclosure provides a method and apparatus for shrinking a containerized application of a PaaS platform.
- the disclosure provides a method for scaling a containerized application of a PaaS platform, including: collecting corresponding user data from a containerized application corresponding to a micro service; and according to a change of a preset indicator in the user data,
- the microservice expands or contracts at least one containerized application.
- the collecting, by the micro-service corresponding containerized application, the corresponding user data comprises: when the containerized application outputs user data to the corresponding container, forwarding the user data to a network port; The ownership of the containerized application adds a label to the user data; and stores the user data to which the label is added.
- the expanding or shrinking the at least one containerized application for the microservice according to a change of a preset indicator in the user data comprises: comparing a preset indicator in the user data with a preset a relationship between a threshold and a second threshold; if the preset index is greater than the first threshold, expanding at least one containerized application for the microservice; and the preset indicator is smaller than the second threshold In the case of the microservice, the at least one containerized application is shrunk, wherein the first threshold is greater than the second threshold.
- the preset indicator includes an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
- the expanding or shrinking the at least one containerized application for the microservice according to the change of the preset indicator in the user data comprises: combining a plurality of preset indicators in the user data A change in the situation, for the microservice to expand or shrink at least one containerized application.
- the method further includes: filtering the required key from the user data Data; performing data processing on the key data to obtain the preset indicator.
- the method further includes: configuring the collection parameter of the user data, where the collection parameter includes at least one of the following: a sampling interval, a number of samples, The threshold of the contraction and the time of the contraction.
- the present disclosure further provides a retracting device for a containerized application of a PaaS platform, comprising: an acquisition unit configured to collect corresponding user data from a containerized application corresponding to the micro service; and a contraction unit configured to be Deriving a change in a preset indicator in the user data, expanding or shrinking at least one containerized application for the microservice.
- the collection unit includes: a forwarding module configured to be the container When the application outputs the user data to the corresponding container, the user data is forwarded to the network port; the adding module is configured to add a label to the user data according to the attribution of the containerized application; the storage module is set to be added The user data of the tag is stored.
- the pinching unit includes: a comparison module configured to compare a size relationship between a preset indicator in the user data and a first threshold and a second threshold; and an expansion module configured to be in the pre- If the indicator is greater than the first threshold, expanding at least one containerized application for the microservice; and the shrinking module is configured to be the microservice if the preset indicator is smaller than the second thresholdshrinking at least one containerized application, wherein the first threshold is greater than the second threshold.
- the preset indicator includes an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
- the pinching unit is configured to expand or contract at least one containerized application for the microservice in conjunction with a change in a plurality of preset metrics in the user data.
- the apparatus further includes a screening unit configured to filter out from the user data before the microservice expands or shrinks at least one containerized application according to a change of a preset indicator in the user data Key data required; a processing unit configured to perform data processing on the key data to obtain the preset indicator.
- the device further includes a configuration unit configured to configure an acquisition parameter of the user data before collecting corresponding user data from a containerized application corresponding to the microservice, the collection parameter comprising at least one of the following: sampling interval, sample Number, shrink threshold, and contraction time.
- Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the methods described above.
- the method and device for shrinking the PaaS platform containerized application provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, according to the change of the preset indicator in the user data,
- the microservice expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste of platform resources. Or insufficient problem, effective Improve the utilization efficiency of platform resources.
- FIG. 1 is a flowchart of a method for scaling a containerized application of a PaaS platform provided by an embodiment of the present disclosure
- FIG. 2 is a schematic diagram of data flow of a method for capturing a containerized application of the PaaS platform provided by the present disclosure
- FIG. 3 is a flow chart of a method of shrinking a containerized application of the PaaS platform of the embodiment shown in FIG. 2;
- FIG. 4 is a schematic structural diagram of a retracting device for a containerized application of a PaaS platform according to an embodiment of the present disclosure.
- the elastic scaling of containerized applications on the current PaaS platform is mostly based on system resources occupied by applications, such as CPU and memory.
- the CPU of the microservice to which the serving cell belongs may not reflect the traffic carried by the cell, and the microservice may be collapsed according to the CPU usage, and platform resources may be wasted (unnecessary expansion). Or insufficient business resources (unnecessary shrinkage).
- an embodiment of the present disclosure provides a method for scaling a containerized application of a PaaS platform, including:
- S11 Collect corresponding user data from a containerized application corresponding to the micro service
- the shrinking method of the PaaS platform containerized application provided by the embodiment of the present disclosure can be from the micro service Collecting corresponding user data in the corresponding containerized application, expanding or contracting at least one containerized application for the microservice according to the change of the preset indicator in the user data, so that the containerization can be more comprehensively reflected
- the service volume of the application service object provides the most suitable resource for the change of the service volume, thereby avoiding the problem of waste or insufficient platform resources, and effectively improving the utilization efficiency of the platform resources.
- each microservice may have one or more containerized applications that serve it.
- the final vehicle for deploying applications on the PaaS platform is the Docker container, and various user data generated by the application can be output to the corresponding Docker container.
- Each Docker container has a corresponding daemon thread, Docker deamon, which allows the user data of the application running in the container to be output to the network port by customizing the Docker deamon.
- step S11 collecting corresponding user data from the containerized application corresponding to the micro service may include:
- the user data to which the tag is added is stored.
- the PaaS platform can listen to network ports, receive user data forwarded by the application through Docker deamon, parse and filter user data, and filter out irrelevant data. Then, the corresponding user data is tagged according to the attribution of the user data.
- the attribution of the user data may refer to which application, which container, which micro service, etc. the user data is from, and the added tag may be, for example, a container ID, a micro service ID, or the like.
- the user data needs to be stored to obtain the preset metrics from the user data.
- the user may be cached first, for example, the distributed data is processed by the distributed publish and subscribe system kafka.
- User data-specific message queues can also be created in kafka for subscription by back-end consumers. Kafka can not only provide message queues, but also provide a message persistence mechanism by writing disks, thus effectively avoiding data loss caused by data storms.
- slow The stored user data can be stored persistently using the elasticsearch database. For example, user data can be subscribed to from kafka via logstash-indexer and stored in a fixed format in the elasticsearch database.
- the user data in elasticsearch can be used as the data source of PaaS to obtain the corresponding preset indicators.
- the preset indicators that the user cares about may also be different, and the corresponding preset indicators may be obtained from the user data as needed.
- At least one containerized application may be expanded or contracted for the micro service according to the change of the preset indicator in the user data in step S12.
- expanding or shrinking at least one containerized application for the microservice may include: according to a change of a preset indicator in the user data:
- the preset indicator is smaller than the second threshold, shrinking, by the micro service, at least one containerized application, wherein the first threshold is greater than the second threshold. That is, the first threshold corresponds to the elastic expansion threshold, and the second threshold corresponds to the elastic contraction threshold.
- the preset indicator may include an average service indicator of each containerized application corresponding to the micro service.
- the related parameter of the user access amount may be extracted in the collected user data, and the user access amount is corresponding.
- Preset indicator If there are three containerized applications corresponding to a certain serving cell, the user access amount related parameter indicates that the average normalized parameter of the user access amount of each containerized application is 80%, that is, the user access of the three applications. The number has reached 80% of the maximum allowable access. If the first threshold is 75% and the second threshold is 40%, you can expand a containerized application for the microservice.
- the application shares a portion of user access, thereby reducing the amount of user access per containerized application.
- the user access amount related parameter indicates that the average normalized parameter of the user access amount of each containerized application is 35%, that is, the user access of the three applications. If the number is only 35% of the maximum allowable access, the containerized application can be reduced for the micro-service, and the user access of the three containerized applications can be shared to two containerized applications, thereby effectively saving the platform.
- Application resources Of course, it is also possible to expand or contract according to the relationship between the preset index and the first threshold and the second threshold. An example of a plurality of containerized applications is not limited by the embodiments of the present disclosure.
- the preset indicator may also include a highest service indicator in each containerized application corresponding to the micro service. For example, if there are 4 containerized applications corresponding to a certain serving cell, the user access amount related parameter indicates that the maximum of the normalized parameters of the user access amount in the four containerized applications is 85%, if specified at this time.
- the first threshold is 80%, which can expand a containerized application for the microservices, and enable the containerized application with the largest user access to actively transfer some of the user access services to the newly expanded containerized application, thereby reducing the task most. The load of heavy containerized applications.
- a plurality of preset indicators may be set for the retraction of the application, and the microservices may be expanded or combined with changes in the plurality of preset indicators in the user data.
- Shrink one or more containerized applications may be set as follows: the cell user access amount is less than 40% and the cell access failure rate is less than 20%. That is, a containerized application is only shrunk when both conditions are met.
- a sticky relationship between multiple user data is arranged, and a joint scaling strategy based on multiple types of user data is configured, so that the containerized application can be contracted in combination with various factors. control.
- the method may further include :
- Data processing is performed on the key data to obtain the preset indicator.
- the scaling method of the PaaS platform containerized application provided by the embodiment of the present disclosure may also be used.
- the collection parameter of the user data is configured, and the collection parameter includes one or more of the following: a sampling interval, a sample number, a contraction threshold, and a contraction penalty time.
- the sampling interval indicates how often the user data is collected, and the number of samples indicates how many samples are collected to start the change of the preset index.
- the contraction threshold can be divided into a contraction expansion threshold and a contraction contraction threshold.
- the contraction expansion threshold indicates that the preset index exceeds the threshold to expand a containerized application, and the contraction contraction threshold indicates that the preset index exceeds the threshold and decreases.
- a containerized application is configured, and the collection parameter includes one or more of the following: a sampling interval, a sample number, a contraction threshold, and a contraction penalty time.
- the sampling interval indicates how often the user data is collected, and the number of samples indicates how many samples are collected to start the change of the preset index.
- the contraction threshold can be divided into a contraction expansion threshold and a contraction contraction threshold.
- the contraction expansion threshold indicates that the preset index
- the contraction penalty time indicates that the expansion or contraction of the containerization application is not performed for a period of time after the change of the contraction of the containerization application, and the corresponding expansion of the containerization application is not performed.
- the regulation of the contraction prevents the expansion or contraction of the containerized application from being too frequent and affects the stability of the system.
- FIG. 2 is a schematic diagram of data flow of a method for capturing a containerized application of the PaaS platform provided by the present disclosure
- FIG. 3 is a flowchart of a method for scaling a containerized application of the PaaS platform of the embodiment shown in FIG. 2 and FIG. 3, the method for shrinking the container application of the PaaS platform of the present embodiment may include the following steps:
- the PaaS platform provides a docker base image for deploying containerized applications.
- the image provides a customized print module, and the application can print user data to the standard output of the container according to the agreed format.
- S202 Modify the Docker configuration file and configure the driver mode as tcp output, so that the user data can be redirected to the userkpi-forwarder (user data agent module).
- Userkpi-forwarder is mainly used to increase the attribution information of user data, such as adding micro service name and ID information, and outputting to the back end.
- the user data proxy module outputs the user data to the kafka (distributed publish and subscribe system), and creates a message queue dedicated to the user data in the kafka for the backend consumer to subscribe.
- Kafka is not only used as a message queue, but also because of its own message persistence mechanism, which can avoid data loss caused by data storms.
- S204 The logstash-indexer subscribes to the user data from kafka and stores it in the elasticsearch database in a fixed format.
- User data in elasticsearch is the data source for the PaaS bombing module.
- the scaler reads data from the elasticsearch database according to characteristics of the user data, such as user data name, micro service ID, etc., and calculates a current average value of the user data according to a pre-configured algorithm.
- S206 The scaler compares the current user data actual value and the zoom threshold to initiate a contraction decision. If the actual value of the user data is higher than the elastic extension threshold, the deployer (PaaS deployment module) is notified to flexibly extend the microservice. If the actual value of the user data is lower than the elastic shrinkage threshold, notify the deployer (PaaS deployment module) to elastically shrink the microservice.
- an embodiment of the present disclosure further provides a retracting device for a containerized application of a PaaS platform, including:
- the collecting unit 41 is configured to collect corresponding user data from the containerized application corresponding to the micro service;
- the pinch unit 42 is configured to expand or contract at least one containerized application for the microservice according to a change in a preset indicator in the user data.
- the captive device of the containerized application of the PaaS platform provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, and according to the change of the preset indicator in the user data, the micro
- the service expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste or insufficient platform resources.
- the problem effectively improves the utilization efficiency of platform resources.
- the collecting unit 41 may include:
- a forwarding module configured to forward the user data to a network port when the containerized application outputs user data to the corresponding container
- Adding a module configured to add a label to the user data according to the attribution of the containerized application
- a storage module configured to store the user data to which the tag is added.
- the pinch unit 42 can include:
- a comparison module configured to compare a size relationship between the preset indicator in the user data and the first threshold and the second threshold
- An expansion module configured to expand at least one containerized application for the microservice if the preset indicator is greater than the first threshold
- a shrinking module configured to be in a case where the preset index is less than the second threshold
- the microservice shrinks at least one containerized application, wherein the first threshold is greater than the second threshold.
- the preset indicator may include an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
- the pinching unit may be configured to expand or shrink at least one containerized application for the microservice in combination with a change of a plurality of preset indicators in the user data.
- a screening unit configured to filter out required key data from the user data before expanding or shrinking the at least one containerized application according to the change of the preset indicator in the user data ;
- a processing unit configured to perform data processing on the key data to obtain the preset indicator.
- the retracting device of the PaaS platform container application may further include a configuration unit configured to configure the collection parameter of the user data before collecting corresponding user data from the containerized application corresponding to the micro service.
- the acquisition parameters include at least one of the following: a sampling interval, a number of samples, a contraction threshold, and a penalty time.
- Embodiments of the present disclosure also provide a communication network element, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being implemented by the processor
- the following steps are: collecting corresponding user data from the containerized application corresponding to the micro service; expanding or shrinking at least one containerized application for the micro service according to the change of the preset indicator in the user data.
- Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the methods described above.
- computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media.
- Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
- communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
- the method and device for shrinking the PaaS platform containerized application provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, according to the change of the preset indicator in the user data,
- the microservice expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste of platform resources. Or insufficient problems, effectively improving the utilization efficiency of platform resources.
- the present disclosure therefore has industrial applicability.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
本公开涉及通信技术领域,特别是涉及一种PaaS平台容器化应用的弹缩方法及装置。The present disclosure relates to the field of communications technologies, and in particular, to a method and apparatus for shrinking a containerized application of a PaaS platform.
随着以Docker为代表的容器技术的迅速发展,容器云也越来越受到云计算领域所关注。PaaS(Platform-as-a-Service,平台即服务)作为软件行业快速开发部署定制化应用的云平台,也都纷纷兼容容器化应用的开发和部署。PaaS平台不仅需要完成容器化应用的快速部署,还要能支持其所承载的应用的弹性伸缩,以满足业务扩容和缩容的需求。比如在电信领域,越来越多的网络功能开始以容器化应用的形式托管于PaaS平台之上。With the rapid development of container technology represented by Docker, container clouds are becoming more and more concerned by the cloud computing field. PaaS (Platform-as-a-Service) is a cloud platform that rapidly develops and deploys customized applications in the software industry. It is also compatible with the development and deployment of containerized applications. The PaaS platform not only needs to complete the rapid deployment of containerized applications, but also supports the elastic scaling of the applications it carries to meet the needs of business expansion and capacity reduction. For example, in the telecommunications field, more and more network functions are beginning to be hosted on the PaaS platform in the form of containerized applications.
传统的通信网元被拆分为多个服务构成的功能能集合。一个完整的网络功能一般由多个具有不同特性的服务(Service)构成,每个服务包含了多个微服务(Microservice)。微服务的实体一般是一个容器化的应用,这也是PaaS平台能够独立部署的功能实体。微服务中可以存在若干个服务小区对网络用户提供服务。当服务小区业务量发生突变时,就需要PaaS平台根据当前业务量弹性的扩张或者收缩出若干个微服务实例,也就是容器化应用来满足业务需求。A traditional communication network element is split into functional energy sets composed of multiple services. A complete network function is generally composed of multiple services with different characteristics, each of which contains multiple microservices (Microservice). The entity of the microservice is generally a containerized application, which is also a functional entity that the PaaS platform can deploy independently. There may be several serving cells in the microservice to provide services to network users. When the service cell business volume changes suddenly, the PaaS platform needs to expand or shrink a number of micro service instances according to the current business volume elasticity, that is, containerized applications to meet business needs.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本公开提供了一种PaaS平台容器化应用的弹缩方法及装置。The present disclosure provides a method and apparatus for shrinking a containerized application of a PaaS platform.
一方面,本公开提供一种PaaS平台容器化应用的弹缩方法,包括:从微服务对应的容器化应用中采集相应的用户数据;根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。 In one aspect, the disclosure provides a method for scaling a containerized application of a PaaS platform, including: collecting corresponding user data from a containerized application corresponding to a micro service; and according to a change of a preset indicator in the user data, The microservice expands or contracts at least one containerized application.
在示例性实施例中,所述从微服务对应的容器化应用中采集相应的用户数据包括:当所述容器化应用向对应容器输出用户数据时,将所述用户数据转发到网络端口;根据所述容器化应用的归属情况,为所述用户数据添加标签;将添加了标签的所述用户数据进行存储。In an exemplary embodiment, the collecting, by the micro-service corresponding containerized application, the corresponding user data comprises: when the containerized application outputs user data to the corresponding container, forwarding the user data to a network port; The ownership of the containerized application adds a label to the user data; and stores the user data to which the label is added.
在示例性实施例中,所述根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用包括:比较所述用户数据中的预设指标与第一阈值、第二阈值的大小关系;在所述预设指标大于所述第一阈值的情况下,为所述微服务扩张至少一个容器化应用;在所述预设指标小于所述第二阈值的情况下,为所述微服务收缩至少一个容器化应用,其中,所述第一阈值大于所述第二阈值。In an exemplary embodiment, the expanding or shrinking the at least one containerized application for the microservice according to a change of a preset indicator in the user data comprises: comparing a preset indicator in the user data with a preset a relationship between a threshold and a second threshold; if the preset index is greater than the first threshold, expanding at least one containerized application for the microservice; and the preset indicator is smaller than the second threshold In the case of the microservice, the at least one containerized application is shrunk, wherein the first threshold is greater than the second threshold.
在示例性实施例中,所述预设指标包括所述微服务对应的各个容器化应用的平均业务指标,或者所述微服务对应的各个容器化应用中的最高业务指标。In an exemplary embodiment, the preset indicator includes an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
在示例性实施例中,所述根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用包括:结合所述用户数据中的多种预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。In an exemplary embodiment, the expanding or shrinking the at least one containerized application for the microservice according to the change of the preset indicator in the user data comprises: combining a plurality of preset indicators in the user data A change in the situation, for the microservice to expand or shrink at least one containerized application.
在所述根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用之前,所述方法还包括:从所述用户数据中筛选出所需的关键数据;对所述关键数据进行数据处理以获得所述预设指标。Before the expanding or shrinking the at least one containerized application for the microservice according to the change of the preset indicator in the user data, the method further includes: filtering the required key from the user data Data; performing data processing on the key data to obtain the preset indicator.
在所述从微服务对应的容器化应用中采集相应的用户数据之前,所述方法还包括:配置所述用户数据的采集参数,所述采集参数包括以下至少一种:取样间隔、样本数、弹缩门限、弹缩惩罚时间。Before collecting the corresponding user data in the containerized application corresponding to the micro service, the method further includes: configuring the collection parameter of the user data, where the collection parameter includes at least one of the following: a sampling interval, a number of samples, The threshold of the contraction and the time of the contraction.
另一方面,本公开还提供一种PaaS平台容器化应用的弹缩装置,包括:采集单元,设置为从微服务对应的容器化应用中采集相应的用户数据;弹缩单元,设置为根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。In another aspect, the present disclosure further provides a retracting device for a containerized application of a PaaS platform, comprising: an acquisition unit configured to collect corresponding user data from a containerized application corresponding to the micro service; and a contraction unit configured to be Deriving a change in a preset indicator in the user data, expanding or shrinking at least one containerized application for the microservice.
在示例性实施例中,所述采集单元包括:转发模块,设置为当所述容器 化应用向对应容器输出用户数据时,将所述用户数据转发到网络端口;添加模块,设置为根据所述容器化应用的归属情况,为所述用户数据添加标签;存储模块,设置为将添加了标签的所述用户数据进行存储。In an exemplary embodiment, the collection unit includes: a forwarding module configured to be the container When the application outputs the user data to the corresponding container, the user data is forwarded to the network port; the adding module is configured to add a label to the user data according to the attribution of the containerized application; the storage module is set to be added The user data of the tag is stored.
在示例性实施例中,所述弹缩单元包括:比较模块,设置为比较所述用户数据中的预设指标与第一阈值、第二阈值的大小关系;扩张模块,设置为在所述预设指标大于所述第一阈值的情况下,为所述微服务扩张至少一个容器化应用;收缩模块,设置为在所述预设指标小于所述第二阈值的情况下,为所述微服务收缩至少一个容器化应用,其中,所述第一阈值大于所述第二阈值。In an exemplary embodiment, the pinching unit includes: a comparison module configured to compare a size relationship between a preset indicator in the user data and a first threshold and a second threshold; and an expansion module configured to be in the pre- If the indicator is greater than the first threshold, expanding at least one containerized application for the microservice; and the shrinking module is configured to be the microservice if the preset indicator is smaller than the second threshold Shrinking at least one containerized application, wherein the first threshold is greater than the second threshold.
在示例性实施例中,所述预设指标包括所述微服务对应的各个容器化应用的平均业务指标,或者所述微服务对应的各个容器化应用中的最高业务指标。In an exemplary embodiment, the preset indicator includes an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
在示例性实施例中,所述弹缩单元设置为结合所述用户数据中的多种预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。In an exemplary embodiment, the pinching unit is configured to expand or contract at least one containerized application for the microservice in conjunction with a change in a plurality of preset metrics in the user data.
所述装置还包括筛选单元,设置为在所述根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用之前,从所述用户数据中筛选出所需的关键数据;处理单元,设置为对所述关键数据进行数据处理以获得所述预设指标。The apparatus further includes a screening unit configured to filter out from the user data before the microservice expands or shrinks at least one containerized application according to a change of a preset indicator in the user data Key data required; a processing unit configured to perform data processing on the key data to obtain the preset indicator.
所述装置还包括配置单元,设置为在从微服务对应的容器化应用中采集相应的用户数据之前,配置所述用户数据的采集参数,所述采集参数包括以下至少一种:取样间隔、样本数、弹缩门限、弹缩惩罚时间。The device further includes a configuration unit configured to configure an acquisition parameter of the user data before collecting corresponding user data from a containerized application corresponding to the microservice, the collection parameter comprising at least one of the following: sampling interval, sample Number, shrink threshold, and contraction time.
本公开实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现以上描述的方法。Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the methods described above.
通过本公开实施例提供的PaaS平台容器化应用的弹缩方法及装置,能够从微服务对应的容器化应用中采集相应的用户数据,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用,这样即可较为全面地反映出容器化应用的服务对象的业务量,并针对该业务量的变化提供最适合的资源,从而避免了平台资源浪费或不足的问题,有效 提高了平台资源的利用效率。The method and device for shrinking the PaaS platform containerized application provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, according to the change of the preset indicator in the user data, The microservice expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste of platform resources. Or insufficient problem, effective Improve the utilization efficiency of platform resources.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
图1是本公开实施例提供的PaaS平台容器化应用的弹缩方法的一种流程图;1 is a flowchart of a method for scaling a containerized application of a PaaS platform provided by an embodiment of the present disclosure;
图2是本公开提供的PaaS平台容器化应用的弹缩方法的数据流向示意图;2 is a schematic diagram of data flow of a method for capturing a containerized application of the PaaS platform provided by the present disclosure;
图3是为图2所示的实施例的PaaS平台容器化应用的弹缩方法的一种流程图;3 is a flow chart of a method of shrinking a containerized application of the PaaS platform of the embodiment shown in FIG. 2;
图4是本公开实施例提供的PaaS平台容器化应用的弹缩装置的一种结构示意图。FIG. 4 is a schematic structural diagram of a retracting device for a containerized application of a PaaS platform according to an embodiment of the present disclosure.
目前的PaaS平台上的容器化应用的弹性伸缩,大都基于应用占用的系统资源,如CPU和内存等指标。然而,服务小区所归属的微服务的CPU有时候并不能反映出该小区所承载的业务量,仅仅根据CPU使用率来对微服务进行弹缩,可能会出现平台资源浪费(不必要的扩张)或者业务资源不足(不必要的缩容)。The elastic scaling of containerized applications on the current PaaS platform is mostly based on system resources occupied by applications, such as CPU and memory. However, the CPU of the microservice to which the serving cell belongs may not reflect the traffic carried by the cell, and the microservice may be collapsed according to the CPU usage, and platform resources may be wasted (unnecessary expansion). Or insufficient business resources (unnecessary shrinkage).
以下结合附图对本公开进行详细说明。应当理解,此处所描述的示例性实施例仅仅用以解释本公开,并不限定本公开。The present disclosure will be described in detail below with reference to the accompanying drawings. It is to be understood that the exemplary embodiments described herein are merely illustrative of the disclosure,
如图1所示,本公开实施例提供一种PaaS平台容器化应用的弹缩方法,包括:As shown in FIG. 1 , an embodiment of the present disclosure provides a method for scaling a containerized application of a PaaS platform, including:
S11,从微服务对应的容器化应用中采集相应的用户数据;S11: Collect corresponding user data from a containerized application corresponding to the micro service;
S12,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。S12. Expand or shrink at least one containerized application for the microservice according to a change of a preset indicator in the user data.
本公开实施例提供的PaaS平台容器化应用的弹缩方法,能够从微服务 对应的容器化应用中采集相应的用户数据,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用,这样即可较为全面地反映出容器化应用的服务对象的业务量,并针对该业务量的变化提供最适合的资源,从而避免了平台资源浪费或不足的问题,有效提高了平台资源的利用效率。The shrinking method of the PaaS platform containerized application provided by the embodiment of the present disclosure can be from the micro service Collecting corresponding user data in the corresponding containerized application, expanding or contracting at least one containerized application for the microservice according to the change of the preset indicator in the user data, so that the containerization can be more comprehensively reflected The service volume of the application service object provides the most suitable resource for the change of the service volume, thereby avoiding the problem of waste or insufficient platform resources, and effectively improving the utilization efficiency of the platform resources.
例如,微服务与容器化应用之间存在着一对一或者一对多的对应关系,也就是说,每个微服务可能存在一个或多个为其提供服务的容器化应用。PaaS平台上部署应用的最终载体是Docker容器,应用产生的各种用户数据可以输出至对应的Docker容器中。每个Docker容器具有相应的守护线程Docker deamon,可以通过对Docker deamon进行定制化配置,使得容器中运行的应用的用户数据输出到网络端口。For example, there is a one-to-one or one-to-many correspondence between a microservice and a containerized application, that is, each microservice may have one or more containerized applications that serve it. The final vehicle for deploying applications on the PaaS platform is the Docker container, and various user data generated by the application can be output to the corresponding Docker container. Each Docker container has a corresponding daemon thread, Docker deamon, which allows the user data of the application running in the container to be output to the network port by customizing the Docker deamon.
在本实施例中,在步骤S11中,从微服务对应的容器化应用中采集相应的用户数据可包括:In this embodiment, in step S11, collecting corresponding user data from the containerized application corresponding to the micro service may include:
当所述容器化应用向对应容器输出用户数据时,将所述用户数据转发到网络端口;Transmitting the user data to a network port when the containerized application outputs user data to the corresponding container;
根据所述容器化应用的归属情况,为所述用户数据添加标签;Adding a label to the user data according to the attribution of the containerized application;
将添加了标签的所述用户数据进行存储。The user data to which the tag is added is stored.
例如,PaaS平台可以监听网络端口,接收应用通过Docker deamon转发过来的用户数据,并对用户数据进行解析及过滤处理,过滤掉无关数据。然后根据用户数据的归属情况为相应的用户数据添加标签。在本实施例中,用户数据的归属情况可以指用户数据来自哪个应用,哪个容器,对应哪个微服务等,添加的标签例如可以是容器ID,微服务ID等。For example, the PaaS platform can listen to network ports, receive user data forwarded by the application through Docker deamon, parse and filter user data, and filter out irrelevant data. Then, the corresponding user data is tagged according to the attribution of the user data. In this embodiment, the attribution of the user data may refer to which application, which container, which micro service, etc. the user data is from, and the added tag may be, for example, a container ID, a micro service ID, or the like.
在添加了标签后,需要将用户数据进行存储,以便从用户数据获取预设指标。在用户数据的存储过程中,为避免用户数据由于风暴导致的数据丢失,可以先对用户进行缓存处理,例如采用分布式发布订阅系统kafka对用户数据进行缓存处理。还可以在kafka中创建用户数据专用的消息队列,供后端消费者进行订阅。Kafka在这里不仅可以提供消息队列,还可以通过写磁盘来提供消息持久化机制,从而有效避免数据风暴导致的数据丢失。此外,缓 存后的用户数据可以采用elasticsearch数据库进行持久化存储。例如,可以通过logstash-indexer从kafka订阅用户数据,并按照固定格式存入elasticsearch数据库。elasticsearch中的用户数据可以作为PaaS的数据源来获取相应的预设指标。根据应用场景的不同,用户关心的预设指标也可能不同,可以根据需要从用户数据中获得相应的预设指标。After the tag is added, the user data needs to be stored to obtain the preset metrics from the user data. In the process of storing user data, in order to avoid data loss caused by storms, the user may be cached first, for example, the distributed data is processed by the distributed publish and subscribe system kafka. User data-specific message queues can also be created in kafka for subscription by back-end consumers. Kafka can not only provide message queues, but also provide a message persistence mechanism by writing disks, thus effectively avoiding data loss caused by data storms. In addition, slow The stored user data can be stored persistently using the elasticsearch database. For example, user data can be subscribed to from kafka via logstash-indexer and stored in a fixed format in the elasticsearch database. The user data in elasticsearch can be used as the data source of PaaS to obtain the corresponding preset indicators. Depending on the application scenario, the preset indicators that the user cares about may also be different, and the corresponding preset indicators may be obtained from the user data as needed.
采集完用户数据后即可在步骤S12中根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。例如,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用可包括:After the user data is collected, at least one containerized application may be expanded or contracted for the micro service according to the change of the preset indicator in the user data in step S12. For example, expanding or shrinking at least one containerized application for the microservice may include: according to a change of a preset indicator in the user data:
比较所述用户数据中的预设指标与第一阈值、第二阈值的大小关系;Comparing a size relationship between the preset indicator in the user data and the first threshold and the second threshold;
在所述预设指标大于所述第一阈值的情况下,为所述微服务扩张至少一个容器化应用;And expanding, in the case where the preset indicator is greater than the first threshold, at least one containerized application for the microservice;
在所述预设指标小于所述第二阈值的情况下,为所述微服务收缩至少一个容器化应用,其中,所述第一阈值大于所述第二阈值。也就是说,第一阈值对应着弹性扩展门限,第二阈值对应着弹性收缩门限。And in a case that the preset indicator is smaller than the second threshold, shrinking, by the micro service, at least one containerized application, wherein the first threshold is greater than the second threshold. That is, the first threshold corresponds to the elastic expansion threshold, and the second threshold corresponds to the elastic contraction threshold.
在本实施例中,所述预设指标可以包括微服务对应的各个容器化应用的平均业务指标。举例说明,在本公开的一个实施例中,假如比较关心通信中服务小区的用户接入量,则可以在采集的用户数据中提取用户接入量的相关参数,以用户接入量为相应的预设指标。如果某个服务小区对应的容器化应用有3个,用户接入量相关参数指示平均每个容器化应用的用户接入量的归一化参数为80%,即这三个应用的用户接入数量都已经达到各自最大允许接入数量的80%,如果此时规定的第一阈值为75%,第二阈值为40%,则可以为微服务扩张一个容器化应用,为上述3个容器化应用分担一部分用户接入,从而降低每个容器化应用的用户接入量。而假如该服务小区对应的容器化应用有3个,用户接入量相关参数指示平均每个容器化应用的用户接入量的归一化参数为35%,即这三个应用的用户接入数量都只达到各自最大允许接入数量的35%,则可以为微服务减少一个容器化应用,将上述3个容器化应用的用户接入量分担给两个容器化应用,从而有效节约了平台的应用资源。当然,也可以根据预设指标与第一阈值、第二阈值的关系,扩张或收缩 多个容器化应用的实例,本公开的实施例对此不做限定。In this embodiment, the preset indicator may include an average service indicator of each containerized application corresponding to the micro service. For example, in an embodiment of the present disclosure, if the user access amount of the serving cell in the communication is concerned, the related parameter of the user access amount may be extracted in the collected user data, and the user access amount is corresponding. Preset indicator. If there are three containerized applications corresponding to a certain serving cell, the user access amount related parameter indicates that the average normalized parameter of the user access amount of each containerized application is 80%, that is, the user access of the three applications. The number has reached 80% of the maximum allowable access. If the first threshold is 75% and the second threshold is 40%, you can expand a containerized application for the microservice. The application shares a portion of user access, thereby reducing the amount of user access per containerized application. If there are three containerized applications corresponding to the serving cell, the user access amount related parameter indicates that the average normalized parameter of the user access amount of each containerized application is 35%, that is, the user access of the three applications. If the number is only 35% of the maximum allowable access, the containerized application can be reduced for the micro-service, and the user access of the three containerized applications can be shared to two containerized applications, thereby effectively saving the platform. Application resources. Of course, it is also possible to expand or contract according to the relationship between the preset index and the first threshold and the second threshold. An example of a plurality of containerized applications is not limited by the embodiments of the present disclosure.
在本实施例中,所述预设指标也可以包括微服务对应的各个容器化应用中的最高业务指标。例如,如果某个服务小区对应的容器化应用有4个,用户接入量相关参数指示这4个容器化应用中用户接入量的归一化参数中最大为85%,如果此时规定的第一阈值为80%,则可以为微服务扩张一个容器化应用,使用户接入量最大的容器化应用主动将一部分用户接入业务交给新扩张出来的容器化应用,从而降低了任务最繁重的容器化应用的负载。In this embodiment, the preset indicator may also include a highest service indicator in each containerized application corresponding to the micro service. For example, if there are 4 containerized applications corresponding to a certain serving cell, the user access amount related parameter indicates that the maximum of the normalized parameters of the user access amount in the four containerized applications is 85%, if specified at this time. The first threshold is 80%, which can expand a containerized application for the microservices, and enable the containerized application with the largest user access to actively transfer some of the user access services to the newly expanded containerized application, thereby reducing the task most. The load of heavy containerized applications.
为了提高对容器化应用的弹缩控制的准确性,可以为应用的弹缩设置多种预设指标,结合所述用户数据中的多种预设指标的变化情况,为所述微服务扩张或者收缩一个或多个容器化应用。例如,可以设置收缩一个容器化应用的条件为:小区用户接入量小于40%且小区接入失败率小于20%。也就是说,只有当这两个条件同时满足时,才会收缩一个容器化应用。本实施例根据不同用户数据之间的关联关系,编排多种用户数据之间的粘滞关系,配置基于多类型用户数据的联合弹缩策略,从而可以结合多种因素进行容器化应用的弹缩控制。In order to improve the accuracy of the retraction control of the containerized application, a plurality of preset indicators may be set for the retraction of the application, and the microservices may be expanded or combined with changes in the plurality of preset indicators in the user data. Shrink one or more containerized applications. For example, the condition for shrinking a containerized application may be set as follows: the cell user access amount is less than 40% and the cell access failure rate is less than 20%. That is, a containerized application is only shrunk when both conditions are met. In this embodiment, according to the relationship between different user data, a sticky relationship between multiple user data is arranged, and a joint scaling strategy based on multiple types of user data is configured, so that the containerized application can be contracted in combination with various factors. control.
可以理解的,不同的微服务、不同的应用场景、不同的调控需求,可能需要提取用户数据的不同部分来形成不同的预设指标。为了得到相应的预设指标,在本公开的一个实施例中,在根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用之前,还可包括:It can be understood that different microservices, different application scenarios, and different control requirements may need to extract different parts of user data to form different preset indicators. In order to obtain the corresponding preset indicator, in an embodiment of the present disclosure, before the at least one containerized application is expanded or contracted for the micro service according to a change of the preset indicator in the user data, the method may further include :
从所述用户数据中筛选出所需的关键数据;在本实施例中,具体需要哪些关键数据可以由用户预选配置;Filtering the required key data from the user data; in this embodiment, which key data is specifically required to be pre-selected by the user;
对所述关键数据进行数据处理以获得所述预设指标。Data processing is performed on the key data to obtain the preset indicator.
为了获得所需的用户数据,在本实施例中,在步骤S11从微服务对应的容器化应用中采集相应的用户数据之前,本公开实施例提供的PaaS平台容器化应用的弹缩方法还可包括:In order to obtain the required user data, in the embodiment, before the corresponding user data is collected from the containerized application corresponding to the micro service in step S11, the scaling method of the PaaS platform containerized application provided by the embodiment of the present disclosure may also be used. include:
配置所述用户数据的采集参数,所述采集参数包括以下一种或几种:取样间隔、样本数、弹缩门限、弹缩惩罚时间。其中,取样间隔表示间隔多久采集一次用户数据,样本数表示采集多少样本数开始对预设指标的变化情况 进行判断,弹缩门限可以分为弹缩扩张门限以及弹缩收缩门限,弹缩扩张门限表示预设指标超过该门限即扩张一个容器化应用,弹缩收缩门限表示预设指标超过该门限即减少一个容器化应用。弹缩惩罚时间表示在经过一次容器化应用的弹缩变化后的一段时间内,如果预设指标再有波动变化则暂不进行容器化应用的扩张或收缩,等到这段时间过去以后再进行相应的弹缩调控,从而防止容器化应用过于频繁的扩张或收缩,影响系统稳定性。The collection parameter of the user data is configured, and the collection parameter includes one or more of the following: a sampling interval, a sample number, a contraction threshold, and a contraction penalty time. The sampling interval indicates how often the user data is collected, and the number of samples indicates how many samples are collected to start the change of the preset index. Judging, the contraction threshold can be divided into a contraction expansion threshold and a contraction contraction threshold. The contraction expansion threshold indicates that the preset index exceeds the threshold to expand a containerized application, and the contraction contraction threshold indicates that the preset index exceeds the threshold and decreases. A containerized application. The contraction penalty time indicates that the expansion or contraction of the containerization application is not performed for a period of time after the change of the contraction of the containerization application, and the corresponding expansion of the containerization application is not performed. The regulation of the contraction prevents the expansion or contraction of the containerized application from being too frequent and affects the stability of the system.
下面通过示例性实施例对本公开提供的PaaS平台容器化应用的弹缩方法进行详细说明。The method of projecting the PaaS platform containerization application provided by the present disclosure will be described in detail below by way of exemplary embodiments.
图2为本公开提供的PaaS平台容器化应用的弹缩方法的数据流向示意图,图3为图2所示的实施例的PaaS平台容器化应用的弹缩方法的流程图。结合图2和图3,本实施例的PaaS平台容器化应用的弹缩方法可包括如下步骤:2 is a schematic diagram of data flow of a method for capturing a containerized application of the PaaS platform provided by the present disclosure, and FIG. 3 is a flowchart of a method for scaling a containerized application of the PaaS platform of the embodiment shown in FIG. 2 and FIG. 3, the method for shrinking the container application of the PaaS platform of the present embodiment may include the following steps:
S201:PaaS平台提供部署容器化应用的docker基础镜像,镜像中提供了定制化打印模块,应用可以按照约定格式将用户数据打印到容器的标准输出。S201: The PaaS platform provides a docker base image for deploying containerized applications. The image provides a customized print module, and the application can print user data to the standard output of the container according to the agreed format.
S202:修改Docker的配置文件,将驱动方式配置为tcp输出,这样可以将用户数据重定向到userkpi-forwarder(用户数据代理模块)。userkpi-forwarder主要用来增加用户数据的归属信息,比如增加微服务名称及ID信息,并向后端输出。S202: Modify the Docker configuration file and configure the driver mode as tcp output, so that the user data can be redirected to the userkpi-forwarder (user data agent module). Userkpi-forwarder is mainly used to increase the attribution information of user data, such as adding micro service name and ID information, and outputting to the back end.
S203:用户数据代理模块将用户数据输出到kafka(分布式发布订阅系统),并在kafka中创建用户数据专用的消息队列,供后端消费者进行订阅。Kafka在这里不仅作为消息队列,还因为其本身的消息持久化机制,可以避免数据风暴导致的数据丢失。S203: The user data proxy module outputs the user data to the kafka (distributed publish and subscribe system), and creates a message queue dedicated to the user data in the kafka for the backend consumer to subscribe. Kafka is not only used as a message queue, but also because of its own message persistence mechanism, which can avoid data loss caused by data storms.
S204:logstash-indexer从kafka订阅用户数据,并按照固定格式存入elasticsearch数据库。elasticsearch中的用户数据是PaaS弹缩模块的数据源。S204: The logstash-indexer subscribes to the user data from kafka and stores it in the elasticsearch database in a fixed format. User data in elasticsearch is the data source for the PaaS bombing module.
S205:scaler(弹缩模块)根据用户数据的特征,如用户数据名称,微服务ID等,从elasticsearch数据库中读取数据,根据预先配置的算法计算用户数据当前平均值。 S205: The scaler reads data from the elasticsearch database according to characteristics of the user data, such as user data name, micro service ID, etc., and calculates a current average value of the user data according to a pre-configured algorithm.
S206:scaler(弹缩模块)对当前用户数据实际值和弹缩门限值进行比较,发起弹缩判决。用户数据实际值高于弹性扩展门限,则通知deployer(PaaS部署模块),对微服务进行弹性扩展。用户数据实际值低于弹性收缩门限,则通知deployer(PaaS部署模块),对微服务进行弹性收缩。S206: The scaler compares the current user data actual value and the zoom threshold to initiate a contraction decision. If the actual value of the user data is higher than the elastic extension threshold, the deployer (PaaS deployment module) is notified to flexibly extend the microservice. If the actual value of the user data is lower than the elastic shrinkage threshold, notify the deployer (PaaS deployment module) to elastically shrink the microservice.
相应的,如图4所示,本公开的实施例还提供一种PaaS平台容器化应用的弹缩装置,包括:Correspondingly, as shown in FIG. 4, an embodiment of the present disclosure further provides a retracting device for a containerized application of a PaaS platform, including:
采集单元41,设置为从微服务对应的容器化应用中采集相应的用户数据;The collecting
弹缩单元42,设置为根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。The
本公开实施例提供的PaaS平台容器化应用的弹缩装置,能够从微服务对应的容器化应用中采集相应的用户数据,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用,这样即可较为全面地反映出容器化应用的服务对象的业务量,并针对该业务量的变化提供最适合的资源,从而避免了平台资源浪费或不足的问题,有效提高了平台资源的利用效率。The captive device of the containerized application of the PaaS platform provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, and according to the change of the preset indicator in the user data, the micro The service expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste or insufficient platform resources. The problem effectively improves the utilization efficiency of platform resources.
在本实施例中,采集单元41可包括:In this embodiment, the collecting
转发模块,设置为当所述容器化应用向对应容器输出用户数据时,将所述用户数据转发到网络端口;a forwarding module, configured to forward the user data to a network port when the containerized application outputs user data to the corresponding container;
添加模块,设置为根据所述容器化应用的归属情况,为所述用户数据添加标签;Adding a module, configured to add a label to the user data according to the attribution of the containerized application;
存储模块,设置为将添加了标签的所述用户数据进行存储。A storage module configured to store the user data to which the tag is added.
在本实施例中,弹缩单元42可包括:In this embodiment, the
比较模块,设置为比较所述用户数据中的预设指标与第一阈值、第二阈值的大小关系;a comparison module, configured to compare a size relationship between the preset indicator in the user data and the first threshold and the second threshold;
扩张模块,设置为在所述预设指标大于所述第一阈值的情况下,为所述微服务扩张至少一个容器化应用;An expansion module, configured to expand at least one containerized application for the microservice if the preset indicator is greater than the first threshold;
收缩模块,设置为在所述预设指标小于所述第二阈值的情况下,为所述 微服务收缩至少一个容器化应用,其中,所述第一阈值大于所述第二阈值。a shrinking module, configured to be in a case where the preset index is less than the second threshold The microservice shrinks at least one containerized application, wherein the first threshold is greater than the second threshold.
在本实施例中,所述预设指标可以包括所述微服务对应的各个容器化应用的平均业务指标,或者所述微服务对应的各个容器化应用中的最高业务指标。In this embodiment, the preset indicator may include an average service indicator of each containerized application corresponding to the micro service, or a highest service indicator in each containerized application corresponding to the micro service.
在本实施例中,所述弹缩单元可以设置为结合所述用户数据中的多种预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。In this embodiment, the pinching unit may be configured to expand or shrink at least one containerized application for the microservice in combination with a change of a plurality of preset indicators in the user data.
本公开实施例提供的PaaS平台容器化应用的弹缩装置还可包括:The retracting device of the container application of the PaaS platform provided by the embodiment of the present disclosure may further include:
筛选单元,设置为在所述根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用之前,从所述用户数据中筛选出所需的关键数据;a screening unit, configured to filter out required key data from the user data before expanding or shrinking the at least one containerized application according to the change of the preset indicator in the user data ;
处理单元,设置为对所述关键数据进行数据处理以获得所述预设指标。And a processing unit configured to perform data processing on the key data to obtain the preset indicator.
本公开实施例提供的PaaS平台容器化应用的弹缩装置还可包括配置单元,设置为在从微服务对应的容器化应用中采集相应的用户数据之前,配置所述用户数据的采集参数,所述采集参数包括以下至少一种:取样间隔、样本数、弹缩门限、弹缩惩罚时间。The retracting device of the PaaS platform container application provided by the embodiment of the present disclosure may further include a configuration unit configured to configure the collection parameter of the user data before collecting corresponding user data from the containerized application corresponding to the micro service. The acquisition parameters include at least one of the following: a sampling interval, a number of samples, a contraction threshold, and a penalty time.
本公开实施例还提供一种通信网元,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如下步骤:从微服务对应的容器化应用中采集相应的用户数据;根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用。Embodiments of the present disclosure also provide a communication network element, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being implemented by the processor The following steps are: collecting corresponding user data from the containerized application corresponding to the micro service; expanding or shrinking at least one containerized application for the micro service according to the change of the preset indicator in the user data.
本公开实施例还提供了一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现以上描述的方法。Embodiments of the present disclosure also provide a computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the methods described above.
在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。 The term "comprises", "comprises" or any other variants thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements listed, or elements that are inherent to such a process, method, article, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and functional blocks/units of the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components work together. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer readable medium, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules or other data. Sex, removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer. Moreover, it is well known to those skilled in the art that communication media typically includes computer readable instructions, data structures, program modules, or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. .
以上仅为本公开的示例性实施例,并非因此限制本公开的专利范围,凡是利用本公开说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本公开的专利保护范围内。The above is only an exemplary embodiment of the present disclosure, and is not intended to limit the scope of the disclosure of the present disclosure, and the equivalent structure or equivalent process transformations made by the present disclosure and the contents of the drawings, or directly or indirectly applied to other related technologies. The scope of the invention is included in the scope of patent protection of the present disclosure.
通过本公开实施例提供的PaaS平台容器化应用的弹缩方法及装置,能够从微服务对应的容器化应用中采集相应的用户数据,根据所述用户数据中的预设指标的变化情况,为所述微服务扩张或者收缩至少一个容器化应用,这样即可较为全面地反映出容器化应用的服务对象的业务量,并针对该业务量的变化提供最适合的资源,从而避免了平台资源浪费或不足的问题,有效提高了平台资源的利用效率。因此本公开具有工业实用性。 The method and device for shrinking the PaaS platform containerized application provided by the embodiment of the present disclosure can collect corresponding user data from the containerized application corresponding to the micro service, according to the change of the preset indicator in the user data, The microservice expands or shrinks at least one containerized application, so that the service volume of the service object of the containerized application can be more comprehensively reflected, and the most suitable resource is provided for the change of the traffic volume, thereby avoiding waste of platform resources. Or insufficient problems, effectively improving the utilization efficiency of platform resources. The present disclosure therefore has industrial applicability.
Claims (13)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611237223.5 | 2016-12-28 | ||
| CN201611237223.5A CN108259522A (en) | 2016-12-28 | 2016-12-28 | A kind of bullet contracting method and device of PaaS platform containerization application |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018121210A1 true WO2018121210A1 (en) | 2018-07-05 |
Family
ID=62706993
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2017/115049 Ceased WO2018121210A1 (en) | 2016-12-28 | 2017-12-07 | Elastic scaling method and device for containerized application on paas platform |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108259522A (en) |
| WO (1) | WO2018121210A1 (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110634030A (en) * | 2019-09-24 | 2019-12-31 | 阿里巴巴集团控股有限公司 | Application service index mining method, device and equipment |
| CN110881030A (en) * | 2019-10-25 | 2020-03-13 | 北京明朝万达科技股份有限公司 | Logstack-based method and device for recording operation logs of web service administrator |
| CN113485830A (en) * | 2021-07-01 | 2021-10-08 | 广东电网有限责任公司 | Micro-service automatic capacity expansion method for power grid monitoring system |
| US12405832B2 (en) | 2023-02-15 | 2025-09-02 | International Business Machines Corporation | Dynamic reconfiguration of microservice test environment |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110489225A (en) * | 2018-05-15 | 2019-11-22 | 中国移动通信集团浙江有限公司 | A kind of service expansion method, device and equipment based on message queue |
| CN110971623B (en) * | 2018-09-28 | 2023-02-17 | 中兴通讯股份有限公司 | Micro-service instance elastic scaling method and device and storage medium |
| CN112543127A (en) * | 2019-09-23 | 2021-03-23 | 北京轻享科技有限公司 | Monitoring method and device of micro-service architecture |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103605575A (en) * | 2013-11-18 | 2014-02-26 | 深圳市远行科技有限公司 | Cloud Foundry platform application scheduling system and Cloud Foundry platform application scheduling method |
| US20140244716A1 (en) * | 2013-02-26 | 2014-08-28 | Red Hat, Inc. | Shared Application Store for a Platform-as-a-Service (PaaS) System |
| CN104468756A (en) * | 2014-11-27 | 2015-03-25 | 中国联合网络通信集团有限公司 | Method and device for achieving load distribution in PaaS platform |
-
2016
- 2016-12-28 CN CN201611237223.5A patent/CN108259522A/en active Pending
-
2017
- 2017-12-07 WO PCT/CN2017/115049 patent/WO2018121210A1/en not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140244716A1 (en) * | 2013-02-26 | 2014-08-28 | Red Hat, Inc. | Shared Application Store for a Platform-as-a-Service (PaaS) System |
| CN103605575A (en) * | 2013-11-18 | 2014-02-26 | 深圳市远行科技有限公司 | Cloud Foundry platform application scheduling system and Cloud Foundry platform application scheduling method |
| CN104468756A (en) * | 2014-11-27 | 2015-03-25 | 中国联合网络通信集团有限公司 | Method and device for achieving load distribution in PaaS platform |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110634030A (en) * | 2019-09-24 | 2019-12-31 | 阿里巴巴集团控股有限公司 | Application service index mining method, device and equipment |
| CN110634030B (en) * | 2019-09-24 | 2024-03-22 | 先进新星技术(新加坡)控股有限公司 | Method, device and equipment for mining service indexes of applications |
| CN110881030A (en) * | 2019-10-25 | 2020-03-13 | 北京明朝万达科技股份有限公司 | Logstack-based method and device for recording operation logs of web service administrator |
| CN113485830A (en) * | 2021-07-01 | 2021-10-08 | 广东电网有限责任公司 | Micro-service automatic capacity expansion method for power grid monitoring system |
| US12405832B2 (en) | 2023-02-15 | 2025-09-02 | International Business Machines Corporation | Dynamic reconfiguration of microservice test environment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108259522A (en) | 2018-07-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2018121210A1 (en) | Elastic scaling method and device for containerized application on paas platform | |
| CN102521218A (en) | File combining method and file combining device | |
| EP3349130A1 (en) | Data compression method and storage system | |
| CN107168802A (en) | The merging method and device of a kind of cloud storage small file | |
| CN110008020A (en) | EMS memory management process, device, electronic equipment and computer readable storage medium | |
| CN109388615A (en) | Task processing method and system based on Spark | |
| CN104123942B (en) | A kind of audio recognition method and system | |
| CN110716813A (en) | Data stream processing method and device, readable storage medium and processor | |
| US20230097087A1 (en) | Image detection method based on neural network model, electronic device, and storage medium | |
| CN108446110A (en) | Lua scenario generation methods, device, terminal and computer-readable medium | |
| CN106126216B (en) | One kind acceleration starting-up method based on android system and its system | |
| CN113873052B (en) | Domain name resolution method, device and equipment of Kubernetes cluster | |
| CN110019544B (en) | Data query method and system | |
| CN115460215A (en) | Edge gateway extension method, system, device, equipment and medium | |
| WO2018188405A1 (en) | Method and device for allocating cloud application resources | |
| CN111131512B (en) | Equipment information processing method and device, storage medium and processor | |
| CN110532457B (en) | Method and system for acquiring network segment ID | |
| CN112488462A (en) | Unified pushing method, device and medium for workflow data | |
| US11579678B2 (en) | Software switch and method therein | |
| CN116204311A (en) | Pod cluster capacity expansion and contraction method and device, computer equipment and storage medium | |
| CN105068709B (en) | A kind of document handling method and device | |
| CN113885969A (en) | Embedded device, embedded software loading method and storage medium | |
| CN114945020A (en) | Cloud-edge collaborative data access method and system based on cloud platform | |
| US20250193274A1 (en) | Event-based optimal faas connection method and device in a distributed edge cloud environment | |
| CN116108492B (en) | Laterally expandable data leakage prevention system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 17887854 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 17887854 Country of ref document: EP Kind code of ref document: A1 |