CN111917586A - Container bandwidth adjusting method, server and storage medium - Google Patents

Container bandwidth adjusting method, server and storage medium Download PDF

Info

Publication number
CN111917586A
CN111917586A CN202010790218.7A CN202010790218A CN111917586A CN 111917586 A CN111917586 A CN 111917586A CN 202010790218 A CN202010790218 A CN 202010790218A CN 111917586 A CN111917586 A CN 111917586A
Authority
CN
China
Prior art keywords
bandwidth
container
target
application
configuration file
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.)
Pending
Application number
CN202010790218.7A
Other languages
Chinese (zh)
Inventor
刘梦馨
朱彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Ling Skylark Technology Co ltd
Original Assignee
Beijing Ling Skylark Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Ling Skylark Technology Co ltd filed Critical Beijing Ling Skylark Technology Co ltd
Priority to CN202010790218.7A priority Critical patent/CN111917586A/en
Publication of CN111917586A publication Critical patent/CN111917586A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The application provides a container bandwidth adjusting method, a server and a storage medium, wherein the method comprises the following steps: the control server acquires an input editing operation aiming at a container set of a target application, adjusts bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set according to the editing operation, the target application server calls an application service interface in the control server to acquire the configuration file of the container set of the target application, acquires bandwidth indication information of the target container corresponding to the target application in the configuration file, the bandwidth indication information is used for indicating a bandwidth parameter of the target container, and adjusts the bandwidth of the target container according to the bandwidth parameter of the target container. By adjusting the bandwidth indication information of the target container in the configuration file of the container set and adjusting the bandwidth of the target container according to the configuration file, the control on the network bandwidth is enhanced, the container bandwidth can be flexibly set according to the service requirement, and the fine-grained adjustment of a single container is realized.

Description

Container bandwidth adjusting method, server and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method for adjusting a container bandwidth, a server, and a storage medium.
Background
Kubernets is an open source application for managing containerization on multiple hosts in a cloud platform, and its goal is to make it simple and efficient to deploy containerized applications. In Kubernetes, containers have the characteristics of light weight and easy creation, a plurality of containers are usually operated on one object server, and all the containers share the network bandwidth of the physical server, so that the network bandwidth of each container needs to be effectively controlled in order to ensure the response time and the overall stability of the service.
The solution provided at present is to configure a bandwidth plugin in a Container Network Interface (CNI), configure fixed uplink and downlink bandwidths in a configuration file of the bandwidth plugin, and call a transmission control (Traffic control, TC) module under Linux to adjust a Container bandwidth according to the content of the configuration file when the Container is created, where the Container bandwidth includes the uplink bandwidth and the downlink bandwidth.
However, in actual use, different services have different bandwidth requirements and priorities, and the bandwidth of a container can only be adjusted through a uniform configuration file in the adjustment process of the bandwidth of the container, and fine-grained adjustment of the bandwidth of a single container cannot be realized.
Disclosure of Invention
The present application is directed to provide a container bandwidth adjusting method, a server, and a storage medium, to fine-grained adjust the bandwidth of a single container, in order to overcome the above-mentioned shortcomings in the prior art.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a method for adjusting a container bandwidth, which is applied to a control server, and the method includes:
acquiring an input editing operation aiming at a container set of a target application;
according to the editing operation, adjusting bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set;
the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting a target application server to adjust the bandwidth of the target container, and the target container runs on the target application server.
Optionally, the adjusting, according to the editing operation, bandwidth indication information of a target container corresponding to the target application in the description file of the container set includes:
changing the transmission rate of the target container in the configuration file according to the editing operation;
and adjusting the bandwidth indication information of the target container in the configuration file according to the transmission rate.
Optionally, the target application is any one of the following applications:
newly created applications, deleted applications, applications with changed access priority, applications with abnormal access; the application with abnormal access is an application with access times within a preset time period being greater than or equal to preset times.
Optionally, the configuration file includes any one of the following files:
the description file, the security dictionary, the first configuration file and the second configuration file of the container set; wherein the first configuration file is stored in a configuration storage service of the control server, and the second configuration file is stored in an external device.
In a second aspect, another embodiment of the present application provides a method for adjusting a container bandwidth, which is applied to a target application server, and the method includes:
calling an application service interface in a control server to acquire a configuration file of a container set of a target application;
acquiring bandwidth indication information of a target container corresponding to the target application in the configuration file, wherein the bandwidth indication information is used for indicating bandwidth parameters of the target container;
and adjusting the bandwidth of the target container according to the bandwidth parameter.
Optionally, the bandwidth parameter includes an uplink bandwidth parameter, and the adjusting the bandwidth of the target container according to the bandwidth parameter includes:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
and adjusting the uplink bandwidth of the target network card according to the uplink bandwidth parameter, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
Optionally, the bandwidth parameter includes a downlink bandwidth parameter, and the adjusting the bandwidth of the target container according to the bandwidth parameter includes:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
redirecting downlink data from the target network card to a kernel module in the target application server through a preset classifier;
and adjusting the downlink bandwidth of the kernel module according to the downlink bandwidth parameter, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
In a third aspect, another embodiment of the present application provides an apparatus for adjusting a bandwidth of a container, where the apparatus includes:
the acquisition module is used for acquiring the input editing operation of the container set aiming at the target application;
the processing module is used for adjusting the bandwidth indication information of a target container corresponding to the target application in the configuration file of the container set according to the editing operation;
the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting a target application server to adjust the bandwidth of the target container, and the target container runs on the target application server.
Optionally, the processing module is specifically configured to:
changing the transmission rate of the target container in the configuration file according to the editing operation;
and adjusting the bandwidth indication information of the target container in the configuration file according to the transmission rate.
Optionally, the target application is any one of the following applications:
newly created applications, deleted applications, applications with changed access priority, applications with abnormal access; the application with abnormal access is an application with access times within a preset time period being greater than or equal to preset times.
Optionally, the configuration file includes any one of the following files:
the description file, the security dictionary, the first configuration file and the second configuration file of the container set; wherein the first configuration file is stored in a configuration storage service of the control server, and the second configuration file is stored in an external device.
In a fourth aspect, another embodiment of the present application provides an apparatus for adjusting a bandwidth of a container, where the apparatus includes:
the processing module is used for calling an application service interface in the control server to acquire a configuration file of a container set of the target application;
an obtaining module, configured to obtain bandwidth indication information of a target container corresponding to the target application in the configuration file, where the bandwidth indication information is used to indicate a bandwidth parameter of the target container;
the processing module is further configured to adjust the bandwidth of the target container according to the bandwidth parameter.
Optionally, the bandwidth parameter includes an uplink bandwidth parameter, and the processing module is specifically configured to:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
and adjusting the uplink bandwidth of the target network card according to the uplink bandwidth parameter, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
Optionally, the bandwidth parameter includes a downlink bandwidth parameter, and the processing module is specifically configured to:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
redirecting downlink data from the target network card to a kernel module in the target application server through a preset classifier;
and adjusting the downlink bandwidth of the kernel module according to the downlink bandwidth parameter, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
In a fifth aspect, another embodiment of the present application provides a server, including: a processor, a memory and a bus, the memory storing a computer program executable by the processor, the processor and the memory communicating via the bus when the server is running, the processor executing the computer program to perform the method according to any of the first aspect.
In a sixth aspect, another embodiment of the present application provides a server, including: a processor, a memory and a bus, wherein the memory stores a computer program executable by the processor, the processor and the memory communicate with each other via the bus when the server runs, and the processor executes the computer program to perform the method according to any one of the second aspect.
In a seventh aspect, another embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the method according to any one of the first and second aspects.
The application provides a method for adjusting container bandwidth, a server and a storage medium, wherein the method for adjusting the container bandwidth comprises the following steps: the control server acquires an input editing operation aiming at a container set of a target application, and adjusts bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set according to the editing operation, wherein the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting the target application server to adjust the bandwidth of the target container, the target container runs on the target application server, the target application server calls an application service interface in the control server to acquire the configuration file of the container set of the target application, the bandwidth indication information of the target container corresponding to the target application in the configuration file is acquired, the bandwidth indication information is used for indicating the bandwidth parameter of the target container, and the bandwidth of the target container is adjusted according to the bandwidth parameter of the target container. The application has the following beneficial effects: by adjusting the bandwidth indication information of the target container in the configuration file of the container set and adjusting the bandwidth of the target container according to the configuration file, the control on the network bandwidth is enhanced, the container bandwidth can be flexibly set according to the service requirement, and the fine-grained adjustment of a single container is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic diagram illustrating an architecture of a container bandwidth adjustment system provided in an embodiment of the present application;
fig. 2 is a first flowchart illustrating a method for adjusting a container bandwidth according to an embodiment of the present application;
fig. 3 shows a second flowchart of a method for adjusting a container bandwidth according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a third method for adjusting a container bandwidth according to an embodiment of the present application;
fig. 5 is a first schematic structural diagram illustrating a device for adjusting a container bandwidth according to an embodiment of the present application;
fig. 6 shows a schematic structural diagram ii of a device for adjusting a container bandwidth according to an embodiment of the present application;
FIG. 7 is a first schematic structural diagram of a server provided in an embodiment of the present application;
fig. 8 shows a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
Before the technical scheme of the application is introduced, the technical terms related to the application are explained firstly:
kubernetes: the K8s is an open-source application for managing containerization on multiple hosts in a cloud platform, and Kubernets aims to make the application for deploying containerization simple and efficiently provide a mechanism for application deployment, planning, updating and maintenance.
A container: and the environment for running the application program encapsulates the relevant information required by the application program.
Pod: is a combination of containers, referred to herein as a container collection, for one or more applications.
The control of the container bandwidth can be realized through a bandwidth plug-in the prior art, but the control has great defects in flexibility and is difficult to apply in a practical environment, and the defects include the following points:
first, only control can be performed through a unified configuration file, each container cannot be controlled individually, and different services in actual use have different bandwidth requirements and priorities, so that the existing method cannot flexibly control the container bandwidth.
The second, current approach is to create a bandwidth rule when creating a container, and the bandwidth cannot be adjusted after creating the container, so that it cannot meet the requirement of dynamically adjusting the container bandwidth.
Thirdly, the configuration files are distributed on each server, so that the configuration files cannot be modified in a uniform manner, and once the bandwidth needs to be adjusted, the workload is very heavy.
Based on this, the embodiment of the present application provides a method for adjusting a container bandwidth, which adjusts bandwidth indication information of a container in a configuration file of a container set, and adjusts a bandwidth of a target container according to the configuration file, thereby enhancing control over a network bandwidth, flexibly setting a container bandwidth according to a service requirement, and implementing fine-grained adjustment on a single container; the bandwidth of the container can be dynamically adjusted according to actual requirements after the container is created; only the bandwidth indication information of the target container in the configuration file of the container set needs to be adjusted, so that the workload is reduced; meanwhile, the bandwidth of the container can be dynamically adjusted under the condition of not stopping the container service according to the change of the running condition, so that more flexible bandwidth control is realized.
Fig. 1 shows an architecture schematic diagram of a container bandwidth adjustment system provided in an embodiment of the present application, and as shown in fig. 1, the container bandwidth adjustment system includes: the system comprises a control server 100 and at least one application server 200, wherein the control server 100 is a control node in Kubernets, and the at least one application server 200 is a working node in Kubernets. An API (Application Programming Interface) service Server runs on the Application Server 200, and a container of an Application runs on at least one Application Server 200. Each application server 200 may run a plurality of containers (i.e., Pod) of the application program, and the containers of the application programs may have a corresponding relationship with the application server 200, that is, when downlink data is sent by a client of a certain application program, it actually accesses the container corresponding to the application program on the application server 200.
The API Server provides HTTP Rest interfaces such as adding, deleting, checking and watch of various resource objects in Kubernets, and is a data bus and a data center of the whole system. In practical applications, sending a resource creation or deletion request to the APIServer of Kubernetes may create a container for an application on the application server 200 or delete a corresponding container.
In addition, in the present application, each application server 200 may further be configured with a Container Network Interface (CNI) plug-in, and the CNI plug-in may also be configured with a bandwidth plug-in.
The following describes in detail a method for adjusting a container bandwidth according to an embodiment of the present application, with reference to the content described in the system for adjusting a container bandwidth shown in fig. 1.
Fig. 2 is a schematic flowchart illustrating a first flow chart of a method for adjusting a container bandwidth according to an embodiment of the present application, where as shown in fig. 2, the method for adjusting the container bandwidth includes:
s101, the control server obtains the input editing operation of the container set aiming at the target application.
S102, the control server adjusts bandwidth indication information of a target container corresponding to the target application in the configuration file of the container set according to the editing operation.
Wherein a container set, Pod, is a combination of containers for one or more applications. The configuration file of the container set comprises bandwidth indication information of each container in the Pod, and the bandwidth indication information is used for bandwidth parameters of the container.
Specifically, when the container bandwidth of the target application needs to be adjusted, the developer may input an editing operation on the container set of the target application on the control server side to adjust the bandwidth indication information of the target container in the configuration file of the container set, that is, the control server adjusts the bandwidth indication information of the target container in the description file of the container set according to the input editing operation on the container set of the target application, where the bandwidth indication information is used to request the target application server to adjust the bandwidth of the target container, and the target container runs on the target application server.
Optionally, the configuration file includes any one of the following files:
the method comprises the steps of describing a container set, a security dictionary, a first configuration file and a second configuration file; wherein the first configuration file is stored in a configuration storage service of the control server, and the second configuration file is stored in the external device.
Wherein, the container set has a description file, and the bandwidth indication information of the target container can be adjusted in the description file of the container set.
The secure dictionary represents declaration in the form of a secure dictionary, wherein a secure dictionary is a resource type for storing authentication information required by a workload, sensitive information of a key, and the like.
The configuration storage service may be a service for centrally storing and managing application configurations, for example, zookeeper, etcd, that is, the first configuration file may store bandwidth indication information of the container, and the bandwidth indication information of the target container may be adjusted by adjusting the bandwidth indication information of the target container in the first configuration file.
The external device may be a device other than the control server, and the bandwidth indication information of the target container in the second configuration file stored in the external device may be adjusted by the downlink data.
Illustratively, the bandwidth indication information may be in the form of a bandwidth annotation and/or a bandwidth tag.
Wherein the bandwidth annotation indicates that the bandwidth of the target container is declared in an annotated manner; the bandwidth label indicates that the bandwidth of the target container is declared in a label manner. That is, the bandwidth of the target container may be declared in the description file, the security dictionary, the first configuration file, and the second configuration file of the container set in the form of a bandwidth annotation and/or a bandwidth tag, respectively.
Optionally, the target application is any one of the following applications:
newly created applications, deleted applications, applications with changed access priority, applications with abnormal access; the application with abnormal access is the application with the access frequency greater than or equal to the preset frequency in the preset time period.
The bandwidth of the target application server is limited, and the target application server runs a plurality of containers to compete for bandwidth resources, so that when the target application is a newly created application, the default container bandwidth of the application can be increased so that a user can smoothly access the application.
Similarly, when the target application is a deleted application, in order to enable the user to smoothly access other applications corresponding to the target application server, the container bandwidth of the deleted application may be set to 0, so that more bandwidth may be left for the containers of the other applications.
The application with the changed access priority refers to that according to actual requirements, the current access priority of the application is changed compared with the historical access priority, for example, the historical access priority of the application A is higher than that of the application B, and in order to enable a user to smoothly access the application A, the container bandwidth allocated to the application A is larger than that of the application B; and as the number of users of the application B is more and more, the number of users of the application A is less and less, which shows that the current access priority of the application A is lower than that of the application B, and in order to enable users to smoothly access the application B, the container bandwidth which can be allocated to the application A is smaller than that of the application B, so that the bandwidth is isolated according to the access priority of the application.
The application with abnormal access is the application with the access times larger than or equal to the preset times in the preset time period, and in some cases, when the external traffic sharply increases, that is, the application is attacked by malicious external attacks, in order to avoid such a situation of frequently requesting the application, the container bandwidth of the application can be reduced.
Optionally, step S102 specifically includes:
and S1021, changing the transmission rate of the target container in the description file according to the editing operation.
And S1022, adjusting the bandwidth indication information of the target container in the description file according to the transmission rate.
The initial transmission rate of the target container is stored in the description file, the transmission rate of the target container in the description file can be changed according to editing operation, and then bandwidth indicating information of the target container is adjusted and obtained according to a preset conversion relation between the transmission rate and the bandwidth, wherein the bandwidth indicating information is used for indicating the bandwidth parameters of the target container.
The transmission rate of the target container includes an uplink transmission rate (english name: Ingress) and a downlink transmission rate (english name: Egress). The uplink transmission rate is also referred to as an upload rate, and the downlink transmission rate is also referred to as a download rate.
The following linux program is an example of a description file for a container set:
apiVersion:v1
kind:Pod
metadata:
name:qos
namespace:ls1
annotations:
ovn.kubernetes.io/ingress_rate:"3"
ovn.kubernetes.io/egress_rate:"1"
spec:
containers:
-name:qos
image:nginx:alpine
therefore, the bandwidth indication information of the target container is embodied in the description file in the form of bandwidth annotation, and the transmission Rate of the target container is changed by adding a customized option of an uplink transmission Rate ovn.
S103, the target application server calls an application service interface in the control server to acquire a configuration file of the container set of the target application.
When a user accesses the network through a client of the target application, the user actually accesses the target container on the target application server.
The application service interface is APIServer in the embodiment of fig. 1. The target application Server calls an API Server in the control Server to monitor and acquire the configuration file of the container set.
Optionally, the target application server may call the application service interface through the bandwidth plug-in to obtain a configuration file of the container set of the target application.
S104, the target application server obtains bandwidth indication information of a target container corresponding to the target application in the configuration file.
S105, the target application server adjusts the bandwidth of the target container according to the bandwidth parameter of the target container.
After the target application server obtains the configuration file, bandwidth indicating information of the target container can be inquired and determined in the configuration file, the bandwidth indicating information is used for indicating the bandwidth parameter of the target container, and then the bandwidth of the target container can be adjusted according to the bandwidth parameter of the target container.
Optionally, after monitoring the configuration file, the target application server may obtain bandwidth indication information of the target container in the configuration file through the bandwidth plug-in.
The method for adjusting the bandwidth of the container provided by the embodiment comprises the following steps: the control server acquires an input editing operation aiming at a container set of a target application, and adjusts bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set according to the editing operation, wherein the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting the target application server to adjust the bandwidth of the target container, the target container runs on the target application server, the target application server calls an application service interface in the control server to acquire the configuration file of the container set of the target application, the bandwidth indication information of the target container corresponding to the target application in the configuration file is acquired, the bandwidth indication information is used for indicating the bandwidth parameter of the target container, and the bandwidth of the target container is adjusted according to the bandwidth parameter of the target container. The application has the following beneficial effects: by adjusting the bandwidth indication information of the target container in the configuration file of the container set and adjusting the bandwidth of the target container according to the configuration file, the control on the network bandwidth is enhanced, the container bandwidth can be flexibly set according to the service requirement, and the fine-grained adjustment of a single container is realized.
Illustratively, the bandwidth parameter includes an upstream bandwidth parameter, and adjusting the bandwidth of the target container according to the bandwidth parameter includes the steps shown in fig. 3. Fig. 3 shows a second flowchart of the method for adjusting the bandwidth of the container according to the embodiment of the present application, and as shown in fig. 3, the adjusting, by the target application server, the bandwidth of the target container according to the bandwidth parameter specifically includes:
s201, the target application server determines a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card.
The target application server is provided with a plurality of network cards, the plurality of containers running on the target application server and the plurality of network cards have corresponding relations, and the network cards are used for receiving relevant data of the corresponding containers from external equipment, such as response data of the target application.
The preset corresponding relationship between the container and the network card can be stored in the target application server in a table form, and the target application server inquires the corresponding relationship to determine the target network card corresponding to the target container.
It should be noted that the network card on the target application server may be a virtual network card or an entity network card, which is not limited in this embodiment.
S202, the target application server adjusts the uplink bandwidth of the target network card according to the uplink bandwidth parameters, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
And when the target application server receives the configuration file of the container set, adjusting the uplink bandwidth of the target network card according to the uplink bandwidth information, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
The following linux program is an example of setting the upstream bandwidth of the target network card:
tcqd add dev { container network card }
root handle 1: tbf rate { ingress Bandwidth } burst { ingress Bandwidth }
latency 50ms
Therefore, according to the preset conversion relation between the transmission rate and the bandwidth, the uplink bandwidth parameter is converted into the uplink transmission rate, then a Transmission Control (TC) command under linux is adopted to add a queue rule (qdisc) to the target network card and set the queue rule as a bandwidth control algorithm (token packet filter, tbf), a TC module addition rate parameter and a burst rate burst parameter of the linux kernel are called, and the TC module sets the uplink transmission rate of the target network card according to the uplink transmission rate, so that the adjustment of the bandwidth of the target network card is realized.
The burst rate burst refers to a rate allowed to exceed a rate in a short time, and in general, the burst rate burst and the rate may be set to be the same, that is, the burst rate burst and the rate are adjusted according to an uplink transmission rate; latency refers to the maximum waiting time after the rate of the data packet is limited by the bandwidth control, and the data packet which is not processed is discarded after the maximum waiting time.
The method for adjusting the bandwidth of the container provided by the embodiment comprises the following steps: and determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card, and adjusting the uplink bandwidth of the target network card according to the uplink bandwidth parameter, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container. Therefore, the control on the uplink network bandwidth is enhanced, the uplink bandwidth of the container can be flexibly set according to the service requirement, and the fine-grained adjustment on the uplink bandwidth of a single container is realized.
Illustratively, the bandwidth parameter includes a downlink bandwidth parameter, and adjusting the bandwidth of the target container according to the bandwidth parameter includes the steps shown in fig. 4. Fig. 4 is a schematic flowchart illustrating a third flow chart of a method for adjusting a container bandwidth provided in an embodiment of the present application, where as shown in fig. 4, a target application server adjusts a bandwidth of a target container according to a bandwidth parameter, and specifically includes:
s301, the target application server determines a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card.
The implementation process of step S301 is similar to that of step S201, and is not described herein again.
S302, the target application server redirects the received downlink data from the target network card to a kernel module in the target application server through a preset classifier.
S303, the target application server adjusts the downlink bandwidth of the kernel module according to the downlink bandwidth parameter, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
Redirection means redirecting the received downlink data to other locations by various methods, where the kernel module is a special kernel device (english name: Intermediate Functional Block) on the target application server.
Specifically, the target application server may redirect the downlink data from the target network card to the kernel module in the target application server through the preset classifier, that is, when the user sends the downlink data through the client of the target application, the kernel module in the target application server sends the downlink data to the other device. And then, the downlink bandwidth of the kernel module is adjusted according to the downlink bandwidth parameters, so that the adjustment of the downlink bandwidth of the target container is realized.
The following linux program is an example of setting the downstream bandwidth of the kernel module:
# redirect downstream data to ifb0
tcqdisc add dev { container network card } ingress handle ffff:
tc filter add dev { container network card } parent ffff protocolippo 0u32 match u 3200 flowidffff action miscorrected dev if 0
# setting Filter
tc filter add dev ifb0 parent 1:0prio 5protocol ip u32
# set the egr bandwidth
tc class add dev ifb0 parent 1:0class id 1:1tbf rate { resources bandwidth } burst { resources bandwidth }
Therefore, the downlink bandwidth parameters are converted into the downlink transmission rate according to the preset conversion relation between the transmission rate and the bandwidth, then a TC module is adopted to add a classifier handle to the target network card, the identification of the handle is set to fff, the downlink data are redirected onto the kernel module ifb, then a filter ip is added onto the kernel module, the filter ip can further send all the intercepted downlink data to the kernel module ifb, and then the downlink transmission rate of the kernel module ifb is changed according to the downlink transmission rate, so that the adjustment of the downlink bandwidth of the kernel module ifb is realized, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
Optionally, the downstream data includes a downstream network request.
The method for adjusting the bandwidth of the container provided by the embodiment comprises the following steps: determining a target network card of a target container on the target application server according to a preset corresponding relation between the container and the network card, redirecting received downlink data from the target network card to a kernel module in the target application server through a preset classifier, and adjusting downlink bandwidth of the kernel module according to downlink bandwidth parameters, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container. Therefore, the control on the downlink network bandwidth is enhanced, the downlink bandwidth of the container can be flexibly set according to the service requirement, and the fine-grained adjustment on the downlink bandwidth of a single container is realized.
Fig. 5 is a schematic structural diagram of a container bandwidth adjusting apparatus provided in an embodiment of the present application, where the container bandwidth adjusting apparatus 50 may be integrated in the server shown in fig. 7. As shown in fig. 5, the apparatus 50 for adjusting the bandwidth of the container includes:
an obtaining module 501, configured to obtain an input editing operation for a container set of a target application;
a processing module 502, configured to adjust bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set according to the editing operation;
the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting a target application server to adjust the bandwidth of the target container, and the target container runs on the target application server.
Optionally, the processing module 502 is specifically configured to:
changing the transmission rate of the target container in the configuration file according to the editing operation;
and adjusting the bandwidth indication information of the target container in the configuration file according to the transmission rate.
Optionally, the target application is any one of the following applications:
newly created applications, deleted applications, applications with changed access priority, applications with abnormal access; the application with abnormal access is an application with access times within a preset time period being greater than or equal to preset times.
Optionally, the configuration file includes any one of the following files:
the description file, the security dictionary, the first configuration file and the second configuration file of the container set; wherein the first configuration file is stored in a configuration storage service of the control server, and the second configuration file is stored in an external device.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Fig. 6 is a schematic structural diagram of a second apparatus for adjusting container bandwidth according to an embodiment of the present application, where the apparatus 60 for adjusting container bandwidth may be integrated in the server shown in fig. 8. As shown in fig. 6, the apparatus 60 for adjusting the bandwidth of the container includes:
a processing module 601, configured to invoke an application service interface in a control server to obtain a configuration file of a container set of a target application;
an obtaining module 602, configured to obtain bandwidth indication information of a target container corresponding to the target application in the configuration file, where the bandwidth indication information is used to indicate a bandwidth parameter of the target container;
the processing module 601 is further configured to adjust the bandwidth of the target container according to the bandwidth parameter.
Optionally, the bandwidth parameter includes an uplink bandwidth parameter, and the processing module 601 is specifically configured to:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
and adjusting the uplink bandwidth of the target network card according to the uplink bandwidth parameter, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
Optionally, the bandwidth parameter includes a downlink bandwidth parameter, and the processing module 601 is specifically configured to:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
redirecting downlink data from the target network card to a kernel module in the target application server through a preset classifier;
and adjusting the downlink bandwidth of the kernel module according to the downlink bandwidth parameter, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Fig. 7 is a schematic structural diagram of a server according to an embodiment of the present application, and as shown in fig. 7, a server 70 includes:
a processor 701, a memory 702 and a bus 703, wherein the memory 702 stores a computer program executable by the processor, and when the server 70 runs, the processor 701 communicates with the memory 702 through the bus, and the processor 701 executes the computer program to execute the method executed by the control server.
Fig. 8 shows a schematic structural diagram of a server provided in the embodiment of the present application, and as shown in fig. 8, the server 80 includes:
a processor 801, a memory 802 and a bus 803, the memory 802 storing computer programs executable by the processor 801, the processor 801 communicating with the memory 802 via the bus 803 when the server 80 is running, the processor 801 executing the computer programs to perform the methods as described above for the target application server.
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs any one of the methods shown in the foregoing embodiment.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to corresponding processes in the method embodiments, and are not described in detail in this application. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical division, and there may be other divisions in actual implementation, and for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.

Claims (10)

1. A method for adjusting container bandwidth is applied to a control server, and comprises the following steps:
acquiring an input editing operation aiming at a container set of a target application;
according to the editing operation, adjusting bandwidth indication information of a target container corresponding to the target application in a configuration file of the container set;
the bandwidth indication information is used for indicating a bandwidth parameter of the target container, the bandwidth indication information is used for requesting a target application server to adjust the bandwidth of the target container, and the target container runs on the target application server.
2. The method according to claim 1, wherein the adjusting, according to the editing operation, bandwidth indication information of a target container corresponding to the target application in a description file of the container set includes:
changing the transmission rate of the target container in the configuration file according to the editing operation;
and adjusting the bandwidth indication information of the target container in the configuration file according to the transmission rate.
3. The method according to claim 1 or 2, wherein the target application is any one of the following applications:
newly created applications, deleted applications, applications with changed access priority, applications with abnormal access; the application with abnormal access is an application with access times within a preset time period being greater than or equal to preset times.
4. The method of claim 1, wherein the configuration file comprises any one of the following files:
the description file, the security dictionary, the first configuration file and the second configuration file of the container set; wherein the first configuration file is stored in a configuration storage service of the control server, and the second configuration file is stored in an external device.
5. A method for adjusting container bandwidth is applied to a target application server, and the method comprises the following steps:
calling an application service interface in a control server to acquire a configuration file of a container set of a target application;
acquiring bandwidth indication information of a target container corresponding to the target application in the configuration file, wherein the bandwidth indication information is used for indicating bandwidth parameters of the target container;
and adjusting the bandwidth of the target container according to the bandwidth parameter.
6. The method of claim 5, wherein the bandwidth parameter comprises an uplink bandwidth parameter, and wherein the adjusting the bandwidth of the target container according to the bandwidth parameter comprises:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
and adjusting the uplink bandwidth of the target network card according to the uplink bandwidth parameter, wherein the uplink bandwidth of the target network card is the uplink bandwidth of the target container.
7. The method according to claim 5 or 6, wherein the bandwidth parameter comprises a downlink bandwidth parameter, and the adjusting the bandwidth of the target container according to the bandwidth parameter comprises:
determining a target network card of the target container on the target application server according to a preset corresponding relation between the container and the network card;
redirecting the received downlink data from the target network card to a kernel module in the target application server through a preset classifier;
and adjusting the downlink bandwidth of the kernel module according to the downlink bandwidth parameter, wherein the downlink bandwidth of the kernel module is the downlink bandwidth of the target container.
8. A server, comprising: a processor, a memory and a bus, the memory storing a computer program executable by the processor, the processor and the memory communicating via the bus when the server is running, the processor executing the computer program to perform the method of any of claims 1-4.
9. A server, comprising: a processor, a memory and a bus, the memory storing a computer program executable by the processor, the processor and the memory communicating via the bus when the server is running, the processor executing the computer program to perform the method of any of claims 5-7.
10. A storage medium, comprising: the storage medium has stored thereon a computer program which, when executed by a processor, performs the method of any of claims 1-7.
CN202010790218.7A 2020-08-07 2020-08-07 Container bandwidth adjusting method, server and storage medium Pending CN111917586A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010790218.7A CN111917586A (en) 2020-08-07 2020-08-07 Container bandwidth adjusting method, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010790218.7A CN111917586A (en) 2020-08-07 2020-08-07 Container bandwidth adjusting method, server and storage medium

Publications (1)

Publication Number Publication Date
CN111917586A true CN111917586A (en) 2020-11-10

Family

ID=73283287

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010790218.7A Pending CN111917586A (en) 2020-08-07 2020-08-07 Container bandwidth adjusting method, server and storage medium

Country Status (1)

Country Link
CN (1) CN111917586A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113364622A (en) * 2021-06-04 2021-09-07 中国工商银行股份有限公司 Method, device, equipment and storage medium for cross-region flow control
CN113411230A (en) * 2021-06-09 2021-09-17 广州虎牙科技有限公司 Container-based bandwidth control method and device, distributed system and storage medium
CN113608819A (en) * 2021-06-18 2021-11-05 北京汇钧科技有限公司 Method and device for creating container, electronic equipment and medium
CN113709810A (en) * 2021-08-30 2021-11-26 河南星环众志信息科技有限公司 Method, device and medium for configuring network service quality
CN115134894A (en) * 2021-03-26 2022-09-30 中国联合网络通信集团有限公司 Method for reducing power consumption of terminal, dual-card dual-standby terminal, network side equipment and medium
US11693799B2 (en) 2021-09-20 2023-07-04 Red Hat, Inc. Bandwidth control for input/output channels

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457555A (en) * 2019-06-24 2019-11-15 平安国际智慧城市科技股份有限公司 Collecting method, device and computer equipment, storage medium based on Docker
CN110780914A (en) * 2018-07-31 2020-02-11 中国移动通信集团浙江有限公司 Service publishing method and device
CN111211915A (en) * 2018-11-21 2020-05-29 中国科学院深圳先进技术研究院 Method for adjusting network bandwidth of container, computer device and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110780914A (en) * 2018-07-31 2020-02-11 中国移动通信集团浙江有限公司 Service publishing method and device
CN111211915A (en) * 2018-11-21 2020-05-29 中国科学院深圳先进技术研究院 Method for adjusting network bandwidth of container, computer device and readable storage medium
CN110457555A (en) * 2019-06-24 2019-11-15 平安国际智慧城市科技股份有限公司 Collecting method, device and computer equipment, storage medium based on Docker

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115134894A (en) * 2021-03-26 2022-09-30 中国联合网络通信集团有限公司 Method for reducing power consumption of terminal, dual-card dual-standby terminal, network side equipment and medium
CN113364622A (en) * 2021-06-04 2021-09-07 中国工商银行股份有限公司 Method, device, equipment and storage medium for cross-region flow control
CN113411230A (en) * 2021-06-09 2021-09-17 广州虎牙科技有限公司 Container-based bandwidth control method and device, distributed system and storage medium
CN113608819A (en) * 2021-06-18 2021-11-05 北京汇钧科技有限公司 Method and device for creating container, electronic equipment and medium
CN113709810A (en) * 2021-08-30 2021-11-26 河南星环众志信息科技有限公司 Method, device and medium for configuring network service quality
CN113709810B (en) * 2021-08-30 2024-01-26 河南星环众志信息科技有限公司 Method, equipment and medium for configuring network service quality
US11693799B2 (en) 2021-09-20 2023-07-04 Red Hat, Inc. Bandwidth control for input/output channels

Similar Documents

Publication Publication Date Title
CN111917586A (en) Container bandwidth adjusting method, server and storage medium
US8316125B2 (en) Methods and systems for automated migration of cloud processes to external clouds
JP2021529386A (en) Execution of auxiliary functions on the on-demand network code execution system
US9407730B2 (en) Relay apparatus, relay control method, and recording medium having relay control program recorded therein
US10530833B2 (en) Identity service management in limited connectivity environments
CN109361733B (en) Service quality control method and device
US20190037027A1 (en) Server connection capacity management
KR102308269B1 (en) Transmission of control data in proxy-based network communications
CN109495542B (en) Load distribution method based on performance monitoring and terminal equipment
US20100306767A1 (en) Methods and systems for automated scaling of cloud computing systems
CN109375933B (en) Method and equipment for upgrading client
US10719349B2 (en) Peripheral device sharing for virtual machines
US10997538B1 (en) Resource management
CN107948097B (en) Bandwidth adjusting method and equipment
WO2020199686A1 (en) Method and system for providing edge service, and computing device
KR20170060118A (en) Managing classified network streams
US11616686B1 (en) Cluster management
CN113709810A (en) Method, device and medium for configuring network service quality
US9124587B2 (en) Information processing system and control method thereof
US9363199B1 (en) Bandwidth management for data services operating on a local network
US11444998B2 (en) Bit rate reduction processing method for data file, and server
CN106941522B (en) Lightweight distributed computing platform and data processing method thereof
CN111800441B (en) Data processing method, system, device, user side server, user side and management and control server
CN113312168A (en) Page access method and electronic equipment
CN106209680B (en) Information processing apparatus and information processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20201110