CN116893865B - Micro-service example adjusting method and device, electronic equipment and readable storage medium - Google Patents

Micro-service example adjusting method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116893865B
CN116893865B CN202311162108.6A CN202311162108A CN116893865B CN 116893865 B CN116893865 B CN 116893865B CN 202311162108 A CN202311162108 A CN 202311162108A CN 116893865 B CN116893865 B CN 116893865B
Authority
CN
China
Prior art keywords
micro
service
moment
instance
time
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.)
Active
Application number
CN202311162108.6A
Other languages
Chinese (zh)
Other versions
CN116893865A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202311162108.6A priority Critical patent/CN116893865B/en
Publication of CN116893865A publication Critical patent/CN116893865A/en
Application granted granted Critical
Publication of CN116893865B publication Critical patent/CN116893865B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • G06N3/0442Recurrent networks, e.g. Hopfield networks characterised by memory or gating, e.g. long short-term memory [LSTM] or gated recurrent units [GRU]
    • 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/45583Memory management, e.g. access or allocation
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a micro-service example adjusting method, a micro-service example adjusting device, electronic equipment and a readable storage medium, and belongs to the technical field of data processing, wherein the method comprises the following steps: acquiring performance information of each instance in all instances, connection information of the whole application service and calling relations among a plurality of micro services at a first moment; calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services; inputting the performance information of each micro-service at the first moment into a preset LSTM model to obtain the number of instances of each micro-service at the second moment; according to the number of instances of each micro-service at the second moment, adjusting the number of instances of all the micro-services; the calling relation between the processing function used in the preset LSTM model and the plurality of micro-services is related to the performance information of each micro-service at the first moment. The micro service instance is automatically adjusted, and the micro service instance adjustment efficiency is improved.

Description

Micro-service example adjusting method and device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a micro-service example adjusting method and device, electronic equipment and a readable storage medium.
Background
With the popularity of agile development, more and more backend services adopt a distributed microservice architecture. The micro-service architecture has a certain expandable function, and has remarkable improvement on the quality of the whole back-end service. In practical application, most developers still adopt a manual expansion scheme based on experience, and good balance between application performance and server resource utilization is difficult to obtain. The number of micro-service instances allocated to each application is different for different traffic scenarios and idle resource conditions in the total resource. Based on the agile development mode, the software project is divided into a plurality of sub-projects at the initial stage of construction, different business functions can be on line or the adjustment of original application services can exist in each iteration, the reasonable number of the micro-service examples corresponding to the business functions is changed, and each application needs to increase or reduce a certain micro-service example number, so that great challenges are brought to the development of services.
The traditional solution needs to increase the micro service application instance when the service function requirement is high in peak, and automatically reduce the application micro service instance when the service requirement is low so as to save the cost, and dynamically adapt to different resource requirements in different periods, which requires a developer to have a deeper development experience and a skilled service foundation. As can be seen, traditional micro-service instance tuning relies primarily on developer experience, resulting in lower efficiency micro-service instance tuning.
Disclosure of Invention
The embodiment of the application provides a micro-service embodiment adjusting method, a micro-service embodiment adjusting device, electronic equipment and a readable storage medium, which can solve the problem that the traditional micro-service embodiment adjustment depends on experience of a developer, so that the micro-service embodiment adjustment efficiency is lower.
In a first aspect, a method for adjusting a micro service instance is provided, including:
acquiring performance information of each instance in all instances, connection information of the whole application service and calling relations among a plurality of micro services at a first moment;
calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services;
inputting the performance information of each micro-service at the first moment into a preset long-short-period memory time sequence LSTM model to obtain the number of instances of each micro-service at the second moment;
according to the number of the instances of each micro service at the second moment, adjusting the number of the instances of all the micro services;
one application service corresponds to a plurality of micro services, one micro service corresponds to one or more instances, the second moment is the next moment of the first moment, and the calling relation between the processing function used in the preset LSTM model and the plurality of micro services and the performance information of each micro service at the first moment are associated.
Optionally, the acquiring the performance information of each instance in all the instances, the connection information of the whole application service and the calling relationship among the plurality of micro services includes:
obtaining the memory utilization rate, the network delay and the processor utilization rate of each instance in all instances at the first moment through a container composer;
acquiring the connection number and the access number of all the instances in the whole application service at the first moment from the log information of the proxy server;
and counting the call times of each micro-service at the first moment according to call logs among the plurality of micro-services, and constructing a call matrix of the plurality of micro-services at the first moment.
Optionally, the calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services includes:
calculating the average memory utilization rate, the average network delay and the average processor utilization rate of each instance of the micro-service at the first moment;
calculating an operation configuration index of each micro-service instance at the first moment according to the average memory utilization rate, the average network delay, the average processor utilization rate and a preset weight parameter;
Calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service;
calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment;
and constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
Optionally, the calculating the average memory usage, the average network delay, and the average processor usage of each instance of the micro-service at the first time includes:
calculating the average memory usage, average network delay and average processor usage of each instance of the micro-service at the first time by the following formula:
=
=
=
where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,memory usage at time t for the jth instance of the ith microservice,network latency at time t for the jth instance of the ith microservice, Average processor utilization at time t for the jth instance of the ith microservice,average memory usage at time t for the jth instance of the ith microservice,average network delay at time t for the j-th instance of the i-th microservice;
the calculating an operation configuration index of each micro service instance at the first moment according to the average memory usage rate, the average network delay, the average processor usage rate and a preset weight parameter includes:
calculating an operational configuration index for each instance of the micro-service at the first time by the following formula:
= + *
wherein t is the first moment,the index is configured for the operation of each instance of the microservice at the first time,a weight parameter for the memory utilization rate,A weight parameter for network delay,A weight parameter for processor usage.
Optionally, the calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service includes:
calculating the load index of the whole application service at the first moment by the following formula:
=
wherein t is the first moment, The load index at the first moment is served for the whole application,for the number of connections for all instances in the overall application service,for the number of accesses of all instances in the entire application service,for the lowest network latency to be the lowest,for the minimum number of connections to the proxy server,is the minimum number of accesses to the proxy server.
Optionally, the calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment includes:
calculating the performance index of each micro-service at the first moment by the following formula:
=
wherein t is the first moment,performance metrics at the first time for each micro-service,the index is configured for the operation of each instance of the microservice at the first time,and serving the load index of the whole application at the first moment.
Optionally, the inputting the performance information of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment includes:
and inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
Optionally, the preset LSTM model satisfies:
forgetting the processing function of the doorThe method comprises the following steps:
=
wherein t is the first moment,a call matrix for the plurality of micro-services at the first time,for each said microservice a performance matrix at said first moment,a predicted value for the number of instances of the microservice at time t-1,in order to forget the processing function of the doorIs used for the matrix operation weight of the (a),in order to forget the activation function of the door,to forget the offset of the gate function;
updating transfer information functionsThe method comprises the following steps:
=+
=
=
wherein t is the first moment,the transfer information function is updated for time t-1,andin order to update the intermediate function of the transfer information function,in an intermediate function for updating transfer information functionsIs used for the matrix operation weight of the (a),andan offset of an intermediate function for updating the transfer information function;
output gate functionThe method comprises the following steps:
=
wherein t is the first moment,in order to output the gate functionIs used for the matrix operation weight of the (a),an offset for the output gate function;
loss functionThe method comprises the following steps:
wherein t is the first moment,for the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
In a second aspect, a micro service instance adjustment device is provided, including:
The acquisition module is used for acquiring performance information of each instance in all the instances, connection information of the whole application service and calling relations among a plurality of micro-services at a first moment;
the computing module is used for computing the performance information of each micro-service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro-services;
the processing module is used for inputting the performance information of each micro-service at the first moment into a preset long-short-period memory time sequence LSTM model to obtain the number of instances of each micro-service at the second moment;
the adjustment module is used for adjusting the number of the instances of all the micro services according to the number of the instances of each micro service at the second moment;
one application service corresponds to a plurality of micro services, one micro service corresponds to one or more instances, the second moment is the next moment of the first moment, and the calling relation between the processing function used in the preset LSTM model and the plurality of micro services and the performance information of each micro service at the first moment are associated.
Optionally, the acquiring module is specifically configured to:
Obtaining the memory utilization rate, the network delay and the processor utilization rate of each instance in all instances at the first moment through a container composer;
acquiring the connection number and the access number of all the instances in the whole application service at the first moment from the log information of the proxy server;
and counting the call times of each micro-service at the first moment according to call logs among the plurality of micro-services, and constructing a call matrix of the plurality of micro-services at the first moment.
Optionally, the computing module is specifically configured to:
calculating the average memory utilization rate, the average network delay and the average processor utilization rate of each instance of the micro-service at the first moment;
calculating an operation configuration index of each micro-service instance at the first moment according to the average memory utilization rate, the average network delay, the average processor utilization rate and a preset weight parameter;
calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service;
calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment;
And constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
Optionally, the computing module is specifically configured to:
calculating the average memory usage, average network delay and average processor usage of each instance of the micro-service at the first time by the following formula:
=
=
=
where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,memory usage at time t for the jth instance of the ith microservice,network latency at time t for the jth instance of the ith microservice,average processor utilization at time t for the jth instance of the ith microservice,for the ith microserviceAverage memory usage at time t for the jth instance of (c),average network delay at time t for the j-th instance of the i-th microservice;
calculating an operational configuration index for each instance of the micro-service at the first time by the following formula:
= + *
wherein t is the first moment,the index is configured for the operation of each instance of the microservice at the first time,a weight parameter for the memory utilization rate, A weight parameter for network delay,A weight parameter for processor usage.
Optionally, the computing module is specifically configured to:
calculating the load index of the whole application service at the first moment by the following formula:
=
wherein t is the first moment,the load index at the first moment is served for the whole application,for the number of connections for all instances in the overall application service,for the number of accesses of all instances in the entire application service,for the lowest network latency to be the lowest,for the minimum number of connections to the proxy server,is the minimum number of accesses to the proxy server.
Optionally, the computing module is specifically configured to:
calculating the performance index of each micro-service at the first moment by the following formula:
=
wherein t is the first moment,performance metrics at the first time for each micro-service,the index is configured for the operation of each instance of the microservice at the first time,and serving the load index of the whole application at the first moment.
Optionally, the processing module is specifically configured to:
and inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
Optionally, the preset LSTM model satisfies:
forgetting the processing function of the doorThe method comprises the following steps:
=
wherein t is the first moment,a call matrix for the plurality of micro-services at the first time,for each said microservice a performance matrix at said first moment,a predicted value for the number of instances of the microservice at time t-1,in order to forget the processing function of the doorIs used for the matrix operation weight of the (a),in order to forget the activation function of the door,to forget the offset of the gate function;
updating transfer information functionsThe method comprises the following steps:
=+
=
=
wherein t is the first moment,the transfer information function is updated for time t-1,andin order to update the intermediate function of the transfer information function,in an intermediate function for updating transfer information functionsMoment of (2)The weight is calculated by the matrix,andan offset of an intermediate function for updating the transfer information function;
output gate functionThe method comprises the following steps:
=
wherein t is the first moment,in order to output the gate functionIs used for the matrix operation weight of the (a),an offset for the output gate function;
loss functionThe method comprises the following steps:
wherein t is the first moment,for the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
In a third aspect, there is provided an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fourth aspect, there is provided a readable storage medium having stored thereon a program or instructions which when executed by a processor perform the steps of the method according to the first aspect.
In a fifth aspect, there is provided a chip comprising a processor and a communication interface coupled to the processor, the processor being for running a program or instructions to implement the method according to the first aspect or to implement the method according to the second aspect.
In a sixth aspect, there is provided a computer program/program product stored in a storage medium, the program/program product being executable by at least one processor to implement the method according to the first aspect or to implement the method according to the second aspect.
In the embodiment of the application, the performance information of each instance, the connection information of the whole application service and the calling relation among a plurality of micro services are obtained at a first moment, the performance information of each micro service at the first moment is calculated, the performance information of each micro service at the first moment is input into a preset LSTM model, the number of instances of each micro service at a second moment is predicted and obtained, and the calling relation among a plurality of micro services and the calling relation among the processing function used in the preset LSTM model are associated with the performance information of each micro service at the first moment. Therefore, the method provided by the application can automatically and dynamically determine the number of the micro-service instances at each moment, thereby realizing automatic adjustment of the micro-service instances and improving the adjustment efficiency of the micro-service instances.
Drawings
FIG. 1 is a flow chart of a micro-service embodiment adjustment method according to an embodiment of the present application;
FIG. 2 is a second flow chart of a micro-service embodiment adjustment method according to the present application;
FIG. 3 is a block diagram of an application of the micro service embodiment adjustment method according to the embodiment of the present application;
FIG. 4 is a schematic diagram of an LSTM model structure provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a micro service embodiment adjusting device according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
The terms "first," "second," and the like, herein, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the "first" and "second" distinguishing between objects generally are not limited in number to the extent that the first object may, for example, be one or more. Furthermore, "and/or" in the present application means at least one of the connected objects. For example, "a or B" encompasses three schemes, scheme one: including a and excluding B; scheme II: including B and excluding a; scheme III: both a and B. The character "/" generally indicates that the context-dependent object is an "or" relationship.
The micro-service example adjustment method provided by the embodiment of the application is described in detail below through some embodiments and application scenes thereof with reference to the accompanying drawings.
Referring to fig. 1, an embodiment of the present application provides a micro service example adjustment method, including:
step 101: at a first moment, acquiring performance information of each instance in all instances, connection information of the whole application service and calling relations among a plurality of micro services.
Step 102: and calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services.
Step 103: and inputting the performance information of each micro-service at the first moment into a preset LSTM model to obtain the number of instances of each micro-service at the second moment.
Step 104: and adjusting the number of instances of all the micro services according to the number of instances of each micro service at the second moment.
One application service corresponds to a plurality of micro services, one micro service corresponds to one or more instances, a second time is the next time of the first time, and a calling relation between a processing function used in a preset Long Short-Term Memory (LSTM) model and the plurality of micro services is associated with performance information of each micro service at the first time.
It should be noted that, the application service refers to a specific application service function to be implemented by the system, one application service corresponds to a plurality of micro services, the application service function is implemented by a plurality of micro services together, one micro service corresponds to one or more instances, each micro service is implemented by one or more instances, which may also be referred to as a virtual server pod, or a virtual machine pod, and the embodiment of the present application is not limited to this specific description.
The first time and the second time are adjacent time according to time sequence, namely, the scheme of the embodiment of the application carries out calculation processing based on each item of information acquired at the first time to acquire the number of instances at the next time, namely, the second time, and adjusts the micro-service instance according to the acquired number of instances at the second time; by repeating the steps 101-104, the automatic adjustment of the number of micro-service instances in the system can be realized.
It can be understood that the solution of the embodiment of the present application may be performed periodically, i.e. may be performed at time T (i.e. the first time is time T) within the period T, so as to predict the number of instances of the micro-service at time t+1 (i.e. the second time is time T); the period T can be flexibly adjusted by a developer according to actual service requirements so as to meet the actual requirements of different services.
In the embodiment of the application, the performance information of each instance, the connection information of the whole application service and the calling relation among a plurality of micro services are obtained at a first moment, the performance information of each micro service at the first moment is calculated, the performance information of each micro service at the first moment is input into a preset LSTM model, the number of instances of each micro service at a second moment is predicted and obtained, and the calling relation among a plurality of micro services and the calling relation among the processing function used in the preset LSTM model are associated with the performance information of each micro service at the first moment. Therefore, the method provided by the application can automatically and dynamically determine the number of the micro-service instances at each moment, thereby realizing automatic adjustment of the micro-service instances and improving the adjustment efficiency of the micro-service instances.
Optionally, acquiring performance information of each instance in all the instances, connection information of the whole application service, and call relations among the plurality of micro services includes:
(1) Memory usage, network latency, and processor usage at a first time for each of all instances are obtained by a container orchestrator.
The performance information of each instance specifically includes: memory usage, network latency, and processor usage, wherein processor usage may include, in particular, central processor (Central Processing Unit, CPU) usage and/or graphics processor (Graphics Processing Unit, GPU) usage.
The container composer may specifically be a k8s (kubernetes) container composer.
(2) The connection number and the access number of all the instances in the whole application service at the first moment are obtained from the log information of the proxy server.
The proxy server may specifically be a proxy web server (World Wide Web Server), for example: proxy web server nminix.
(3) And counting the calling times of each micro service at the first moment according to the calling logs among the plurality of micro services, and constructing a calling matrix of the plurality of micro services at the first moment.
And constructing a call matrix according to the counted call times, wherein the LSTM model is mainly used for follow-up processing, and the matrix is constructed so as to facilitate the input of the model.
Optionally, calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services includes:
(1) The average memory usage, average network latency, and average processor usage for each instance of the microservice at the first time instant are calculated.
When calculating the running configuration index of the virtual machine pod, although a plurality of examples exist in the micro service, the load balancing mechanism generally uses a polling mode or a weight mode, and the request traffic distributed by each example can be basically regarded as the same, so that the average memory usage rate, the average network delay and the average processor usage rate are calculated.
(2) And calculating the operation configuration index of each micro-service instance at the first moment according to the average memory usage rate, the average network delay, the average processor usage rate and the preset weight parameter.
It should be noted that, for the case that the processor usage includes the CPU usage and the GPU usage, both may have different weight parameters, and the preset weight parameters of each item of data are determined according to specific application items, for example, the CPU usage is more important for office applications, the GPU usage and the memory usage are more important for drawing applications, the network delay is more important for game applications, and the weights may be moderately adjusted according to these types.
(3) And calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service.
And calculating the load index of the whole service at the first moment through the connection number and the interface access number. The proxy web server nminix has a load balancing mode, and can distribute load balancing to each pod service.
(4) And calculating the performance index of each micro service at the first moment according to the running configuration index of each micro service instance at the first moment and the load index of the whole application service at the first moment.
Wherein the performance index is inversely proportional to the operating configuration index and directly proportional to the load index.
(5) And constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
And constructing a performance matrix according to the calculated performance indexes, wherein the LSTM model is mainly used for subsequent processing, and the matrix is constructed so as to facilitate the input of the model.
Optionally, calculating an average memory usage, an average network latency, and an average processor usage for each instance of the micro-service at the first time instant includes:
the average memory usage, average network latency, and average processor usage for each instance of the micro-service at the first time instant are calculated by the following formulas:
=
=
=
where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,memory usage at time t for the jth instance of the ith microservice,network latency at time t for the jth instance of the ith microservice,average processor utilization at time t for the jth instance of the ith microservice,average memory usage at time t for the jth instance of the ith microservice, The average network delay at time t for the j-th instance of the i-th microservice.
Specifically, for the case where the processor usage includes CPU usage and GPU usage, the formula may include:
=
=
wherein,average CPU utilization at time t for the jth instance of the ith microservice,average GPU utilization at time t for the j-th instance of the i-th micro-service.
Calculating an operation configuration index of each micro-service instance at a first moment according to the average memory usage rate, the average network delay, the average processor usage rate and the preset weight parameter, wherein the operation configuration index comprises the following steps:
the running configuration index at the first time for each instance of the micro-service is calculated by the following formula:
= + *
wherein t is the first moment of time,the index is configured for the operation of each instance of the microservice at a first time,a weight parameter for the memory utilization rate,A weight parameter for network delay,A weight parameter for processor usage.
In particular for processor useThe rate includes CPU usage rate and GPU usage rate, and is specifically classified into weight parameters of CPU usage rateAnd weight parameters for GPU usage
Accordingly, the formula may be:
= + * + + *
optionally, calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service includes:
Calculating the load index of the whole application service at the first moment by the following formula:
=
wherein t is the first moment of time,the load index at said first moment is served for the whole application,for the number of connections for all instances in the overall application service,for the number of accesses of all instances in the entire application service,for the lowest network latency to be the lowest,for the minimum number of connections to the proxy server,is the minimum number of accesses to the proxy server.
Optionally, calculating the performance index of each micro service at the first moment according to the running configuration index of each micro service instance at the first moment and the load index of the whole application service at the first moment includes:
the performance index of each microservice at the first moment is calculated by the following formula:
=
wherein t is the first moment of time,for each microservice performance index at a first time,the index is configured for the operation of each instance of the microservice at a first time,servicing the load of the entire application at a first timeAn index.
Optionally, inputting the performance information of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment, including:
and inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
Specifically, the scheduling matrix and the performance matrix may be combined to obtain a combined matrix, and then the combined matrix is input into the LSTM model.
The preset LSTM model is based on the existing LSTM model, functions in the model are improved, and optionally, the preset LSTM model meets the following conditions:
forgetting the processing function of the doorThe method comprises the following steps:
=
wherein t is the first moment of time,a call matrix at a first time for a plurality of micro-services,for each microservice a performance matrix at a first time,a predicted value for the number of instances of the microservice at time t-1,in order to forget the processing function of the doorIs used for the matrix operation weight of the (a),in order to forget the activation function of the door,to forget the offset of the gate function.
Updating transfer information functionsThe method comprises the following steps:
=+
=
=
wherein t is the first moment of time,the transfer information function is updated for time t-1,andin order to update the intermediate function of the transfer information function,in an intermediate function for updating transfer information functionsIs used for the matrix operation weight of the (a),andan offset of the intermediate function for updating the transfer information function.
Output gate functionThe method comprises the following steps:
=
wherein t is the first moment of time,in order to output the gate functionIs used for the matrix operation weight of the (a),to output the offset of the gate function.
Loss function The method comprises the following steps:
wherein t is the first moment of time,for the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
The following describes the technical scheme of the present application with reference to fig. 2, 3 and 4:
referring to fig. 2, the overall flow of the micro service example adjustment method according to the embodiment of the present application is shown in the figure:
step1, periodically acquiring performance information of a single virtual server pod through a timing detection module, and calling relations among the micro services and the connection number of the whole application service. The timing tasks are designed in the backend service by a Spring Cloud integrated quantiz timing task framework, as shown in fig. 3.
Step1.1, obtaining CPU usage of each virtual server pod at time t by k8s container orchestratorUtilization rate of GPUMemory utilizationAnd network latency
Step1.2, obtain log information in proxy web server Nginx, and extract connection number of all virtual servers at time T in T periodNumber of accesses
Step1.3, obtaining an interface call log among the micro services, matching the call relation among the micro services through regularization, and counting the call times at the moment T in the T period.
Above-mentioned……For the identification of the micro-service,……for the number of calls, for example:representing micro servicesAnd microservicesThe calling times between are as follows
Construction of call matrices for microservicesIs that
=
Step2, calculating the performance information of each micro-service t momentWhich is provided withIn (a)Representing the ith microservice.
Step2.1, calculating the running configuration index of the virtual machine pod, and though a plurality of instances exist in the micro service, through a load balancing mechanism, generally through a polling mode or a weight mode, the request traffic allocated to each instance can be basically seen as the same. The utilization index of CPU is
=
Wherein the method comprises the steps ofRepresenting the CPU utilization of the ith microservice in the jth instance server at time t. The utilization index of the GPU obtained by the same method is
=
Wherein the method comprises the steps ofRepresenting the usage of the GPU at time t in the jth instance server by the ith microservice. The index of the memory utilization rate is
=
Wherein the method comprises the steps ofMemory utilization at time t in the jth instance server on behalf of the ith microserviceAnd (5) utilization rate. The network delay index is
=
Wherein the method comprises the steps ofRepresenting the network delay of the ith microservice at time t in the jth instance server. The running configuration index of the virtual machine pod is as follows
= + * + + *
Wherein the method comprises the steps ofThe weight parameters of the CPU, the GPU, the memory and the network delay are determined according to specific application items, the CPU utilization rate is more important for office applications, the GPU utilization rate and the memory utilization rate are more important for drawing applications, the network delay is more important for game applications, and the weight can be moderately adjusted according to the types.
Step2.2, number of connectionsNumber of interface accessesAnd calculating the load index of the whole service at the moment t. The proxy web server nminix has a load balancing mode, and can distribute load balancing to each pod service. Load index of whole serviceIs that
=
Wherein,representing the lowest latency under the network line,for the number of connections for all instances in the overall application service,for the number of accesses of all instances in the entire application service,the minimum number of connections configured for proxy web server nminx,the minimum number of accesses configured for proxy web server nminx. The load index of the service is a piecewise function, and when the connection number and the interface access number are smaller than the basic connection number and the interface access number, the bottleneck of the load is caused by the lowest network delay, and the load index can be expressed as the lowest delay under the network private line. When the connection number and the interface access number are larger than the basic value, the lowest time delay under the network special line is related, and the load performance is positive to the connection number and the interface access numberRatio, and fit logarithmic function characteristics.
Step2.3, calculating a performance index through the running configuration index of the virtual machine pod and the load index of the micro service,
=
the performance index is inversely proportional to the configuration index, directly proportional to the load index, and the performance matrix is
=
Wherein the method comprises the steps ofPerformance index at time t for the nth microservice.
Step3, constructing an LSTM long-term memory time sequence model, and predicting an instance number matrix of each micro service at the time t+1 as shown in fig. 4.
Step3.1, call matrix for combined microservicesAnd a performance matrixFor input as a long-short term memory time sequence model|With the number of instances of each micro-service at time tIs output as a target. Number of instances of microservicesThe matrix is
=
Wherein the method comprises the steps ofThe number of instances at time t for the nth microservice.
According to the micro-service example adjusting method provided by the embodiment of the application, the execution main body can be the micro-service example adjusting device. In the embodiment of the present application, a method for executing micro-service instance adjustment by using the micro-service instance adjustment device is taken as an example, and the micro-service instance adjustment device provided by the embodiment of the present application is described.
Referring to fig. 5, there is provided a micro service example adjusting apparatus including:
an obtaining module 501, configured to obtain, at a first moment, performance information of each instance in all instances, connection information of an entire application service, and a calling relationship between a plurality of micro services;
a calculating module 502, configured to calculate performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the entire application service, and a calling relationship among the plurality of micro services;
A processing module 503, configured to input performance information of each micro service at the first moment into a preset long-short-period memory time sequence LSTM model, to obtain the number of instances of each micro service at the second moment;
an adjustment module 504, configured to adjust the number of instances of all the micro services according to the number of instances of each micro service at the second moment;
one application service corresponds to a plurality of micro services, one micro service corresponds to one or more instances, the second moment is the next moment of the first moment, and the calling relation between the processing function used in the preset LSTM model and the plurality of micro services and the performance information of each micro service at the first moment are associated.
Optionally, the acquiring module is specifically configured to:
obtaining the memory utilization rate, the network delay and the processor utilization rate of each instance in all instances at the first moment through a container composer;
acquiring the connection number and the access number of all the instances in the whole application service at the first moment from the log information of the proxy server;
and counting the call times of each micro-service at the first moment according to call logs among the plurality of micro-services, and constructing a call matrix of the plurality of micro-services at the first moment.
Optionally, the computing module is specifically configured to:
calculating the average memory utilization rate, the average network delay and the average processor utilization rate of each instance of the micro-service at the first moment;
calculating an operation configuration index of each micro-service instance at the first moment according to the average memory utilization rate, the average network delay, the average processor utilization rate and a preset weight parameter;
calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service;
calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment;
and constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
Optionally, the computing module is specifically configured to:
calculating the average memory usage, average network delay and average processor usage of each instance of the micro-service at the first time by the following formula:
=
=
=
Where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,memory usage at time t for the jth instance of the ith microservice,network latency at time t for the jth instance of the ith microservice,average processor utilization at time t for the jth instance of the ith microservice,average memory usage at time t for the jth instance of the ith microservice,average network delay at time t for the j-th instance of the i-th microservice;
calculating an operational configuration index for each instance of the micro-service at the first time by the following formula:
= + *
wherein t is the first moment,the index is configured for the operation of each instance of the microservice at the first time,a weight parameter for the memory utilization rate,A weight parameter for network delay,A weight parameter for processor usage.
Optionally, the computing module is specifically configured to:
calculating the load index of the whole application service at the first moment by the following formula:
=
wherein t is the first moment,the load index at the first moment is served for the whole application, For the number of connections for all instances in the overall application service,for the number of accesses of all instances in the entire application service,for the lowest network latency to be the lowest,for the minimum number of connections to the proxy server,is the minimum number of accesses to the proxy server.
Optionally, the computing module is specifically configured to:
calculating the performance index of each micro-service at the first moment by the following formula:
=
wherein t is the first moment,performance metrics at the first time for each micro-service,the index is configured for the operation of each instance of the microservice at the first time,and serving the load index of the whole application at the first moment.
Optionally, the processing module is specifically configured to:
and inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
Optionally, the preset LSTM model satisfies:
forgetting the processing function of the doorThe method comprises the following steps:
=
wherein t is the first moment,a call matrix for the plurality of micro-services at the first time,for each said microservice a performance matrix at said first moment, A predicted value for the number of instances of the microservice at time t-1,in order to forget the processing function of the doorIs used for the matrix operation weight of the (a),in order to forget the activation function of the door,to forget the offset of the gate function;
updating transfer information functionsThe method comprises the following steps:
=+
=
=
wherein t is the first moment,the transfer information function is updated for time t-1,andin order to update the intermediate function of the transfer information function,in an intermediate function for updating transfer information functionsIs used for the matrix operation weight of the (a),andan offset of an intermediate function for updating the transfer information function;
output gate functionThe method comprises the following steps:
=
wherein t is the first moment,in order to output the gate functionIs used for the matrix operation weight of the (a),an offset for the output gate function;
loss functionThe method comprises the following steps:
wherein t is the first moment,for the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
The micro-service example adjusting device in the embodiment of the application can be an electronic device, such as an electronic device with an operating system, or can be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, terminals may include, but are not limited to, the types of terminals 11 listed above, other devices may be servers, network attached storage (Network Attached Storage, NAS), etc., and embodiments of the application are not specifically limited.
The micro-service example adjusting device provided by the embodiment of the application can realize each process realized by the method embodiment and achieve the same technical effect, and is not repeated here for avoiding repetition.
Referring to fig. 6, an embodiment of the present application provides an electronic device 600, including: at least one processor 601, a memory 602, a user interface 603 and at least one network interface 604. The various components in the electronic device 600 are coupled together by a bus system 605.
It is to be appreciated that the bus system 605 is employed to enable connected communications between these components. The bus system 605 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration the various buses are labeled as bus system 605 in fig. 6.
The user interface 603 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, a trackball, a touch pad, or a touch screen, etc.).
It is to be appreciated that the memory 602 in embodiments of the application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), and Direct memory bus RAM (DRRAM). The memory 602 described in embodiments of the application is intended to comprise, without being limited to, these and any other suitable types of memory.
In some implementations, the memory 602 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and application programs 6022.
The operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. Applications 6022 include various applications such as media players, browsers, etc. for implementing various application services. The program for implementing the method of the embodiment of the present invention may be included in the application 6022.
In an embodiment of the present invention, the electronic device 600 may further include: a program stored on the memory 602 and executable on the processor 601, which when executed by the processor 601, implements the steps of the method provided by embodiments of the present invention.
The method disclosed in the above embodiment of the present invention may be applied to the processor 601 or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 601 or instructions in the form of software. The processor 601 may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a computer readable storage medium well known in the art such as random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, and the like. The computer readable storage medium is located in the memory 602, and the processor 601 reads information in the memory 602 and performs the steps of the above method in combination with its hardware. In particular, the computer readable storage medium has a computer program stored thereon.
It is to be understood that the embodiments of the application described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more ASICs, DSPs, digital Signal Processing Devices (DSPDs), programmable logic devices (Programmable Logic Device, PLDs), FPGAs, general purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
Wherein the processor is a processor in the terminal described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc. In some examples, the readable storage medium may be a non-transitory readable storage medium.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the method, and can achieve the same technical effects, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, or the like.
The embodiments of the present application further provide a computer program/program product stored in a storage medium, where the computer program/program product is executed by at least one processor to implement each process of the above method embodiments, and achieve the same technical effects, and are not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the description of the embodiments above, it will be apparent to those skilled in the art that the above-described example methods may be implemented by means of a computer software product plus a necessary general purpose hardware platform, but may also be implemented by hardware. The computer software product is stored on a storage medium (such as ROM, RAM, magnetic disk, optical disk, etc.) and includes instructions for causing a terminal or network side device to perform the methods according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms of embodiments may be made by those of ordinary skill in the art without departing from the spirit of the application and the scope of the claims, which fall within the protection of the present application.

Claims (16)

1. A method for micro-service instance adjustment, comprising:
acquiring performance information of each instance in all instances, connection information of the whole application service and calling relations among a plurality of micro services at a first moment;
Calculating the performance information of each micro service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro services;
inputting the performance information of each micro-service at the first moment into a preset LSTM model to obtain the number of instances of each micro-service at the second moment;
according to the number of the instances of each micro service at the second moment, adjusting the number of the instances of all the micro services;
wherein, one application service corresponds to a plurality of micro services, one micro service corresponds to one or a plurality of instances, the second moment is the next moment of the first moment, and the calling relation between the processing function used in the preset LSTM model and the plurality of micro services and the performance information of each micro service at the first moment are associated;
the obtaining the performance information of each instance in all the instances, the connection information of the whole application service and the calling relation among the plurality of micro services comprises the following steps:
obtaining the memory utilization rate, the network delay and the processor utilization rate of each instance in all instances at the first moment through a container composer;
Acquiring the connection number and the access number of all the instances in the whole application service at the first moment from the log information of the proxy server;
and counting the call times of each micro-service at the first moment according to call logs among the plurality of micro-services, and constructing a call matrix of the plurality of micro-services at the first moment.
2. The method according to claim 1, wherein calculating the performance information of each micro-service at the first time according to the performance information of each instance, the connection information of the entire application service, and the call relation among the plurality of micro-services comprises:
calculating the average memory utilization rate, the average network delay and the average processor utilization rate of each instance of the micro-service at the first moment;
calculating an operation configuration index of each micro-service instance at the first moment according to the average memory utilization rate, the average network delay, the average processor utilization rate and a preset weight parameter;
calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service;
Calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment;
and constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
the calculating the average memory usage, the average network delay and the average processor usage of each instance of the micro-service at the first time includes:
calculating the average memory usage, average network delay and average processor usage of each instance of the micro-service at the first time by the following formula:
where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,/>Memory utilization at time t for the jth instance of the ith microservice, d t,i Network delay at time t for the jth instance of the ith microservice, +.>Average processor utilization at time t for the jth instance of the ith microservice,/ >Average memory usage at time t for the jth instance of the ith microservice,/>Average network delay at time t for the j-th instance of the i-th microservice;
the calculating an operation configuration index of each micro service instance at the first moment according to the average memory usage rate, the average network delay, the average processor usage rate and a preset weight parameter includes:
calculating an operational configuration index for each instance of the micro-service at the first time by the following formula:
wherein t is the first moment,and configuring indexes for the operation of each micro-service instance at the first moment, wherein gamma is a weight parameter of memory utilization rate, delta is a weight parameter of network delay, and epsilon is a weight parameter of processor utilization rate.
4. The method according to claim 2, wherein calculating the load index of the entire application service at the first moment according to the connection number and the access number of all the instances in the entire application service includes:
calculating the load index of the whole application service at the first moment by the following formula:
wherein t is the first time, p t Serving the load index, c, of the whole application at the first moment t Connection number v for all instances in the whole application service t Is saidThe number of accesses to all instances in the overall application service,for lowest network latency->For the minimum number of connections of the proxy server, +.>Is the minimum number of accesses to the proxy server.
5. The method of claim 2, wherein calculating the performance index of each micro-service at the first time according to the running configuration index of the instance of each micro-service at the first time and the load index of the whole application service at the first time comprises:
calculating the performance index of each micro-service at the first moment by the following formula:
wherein t is the first time, d t,i Performance metrics at the first time for each micro-service,configuring an index, p, for each instance of the microservice running at the first time t And serving the load index of the whole application at the first moment.
6. The method of claim 2, wherein inputting the performance information of each micro-service at the first time into a preset LSTM model to obtain the number of instances of each micro-service at the second time includes:
And inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
7. The method of claim 6, wherein the preset LSTM model satisfies:
forgetting the processing function f of the door t The method comprises the following steps:
wherein t is the first moment, R t A call matrix, D, for the plurality of micro-services at the first time t For each said microservice a performance matrix at said first moment,predicted value for instance number of micro-service at time t-1, W f To forget R in the processing function of the door t |D t And->Matrix operation weight of (a) and sigma is the activation function of forgetting gate, b f To forget the offset of the gate function;
updating transfer information function C t The method comprises the following steps:
wherein t is the first moment, C t-1 Updating transfer information function, i, for time t-1 t Andto update the intermediate function of the transfer information function, W i R in intermediate function for updating transfer information function t |D t And->Matrix operation weights of b) i And b c An offset of an intermediate function for updating the transfer information function;
output gate functionThe method comprises the following steps:
wherein t is the first moment, W x For outputting R in the gate function t |D t Andmatrix operation weights of b) x An offset for the output gate function;
loss functionThe method comprises the following steps:
wherein t is the first time, x t,n For the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
8. A micro-service instance adjustment apparatus, comprising:
the acquisition module is used for acquiring performance information of each instance in all the instances, connection information of the whole application service and calling relations among a plurality of micro-services at a first moment;
the computing module is used for computing the performance information of each micro-service at the first moment according to the performance information of each instance, the connection information of the whole application service and the calling relation among the plurality of micro-services;
the processing module is used for inputting the performance information of each micro-service at the first moment into a preset LSTM model to obtain the number of instances of each micro-service at the second moment;
the adjustment module is used for adjusting the number of the instances of all the micro services according to the number of the instances of each micro service at the second moment;
wherein, one application service corresponds to a plurality of micro services, one micro service corresponds to one or a plurality of instances, the second moment is the next moment of the first moment, and the calling relation between the processing function used in the preset LSTM model and the plurality of micro services and the performance information of each micro service at the first moment are associated;
The acquisition module is specifically configured to:
obtaining the memory utilization rate, the network delay and the processor utilization rate of each instance in all instances at the first moment through a container composer;
acquiring the connection number and the access number of all the instances in the whole application service at the first moment from the log information of the proxy server;
and counting the call times of each micro-service at the first moment according to call logs among the plurality of micro-services, and constructing a call matrix of the plurality of micro-services at the first moment.
9. The apparatus according to claim 8, wherein the computing module is specifically configured to:
calculating the average memory utilization rate, the average network delay and the average processor utilization rate of each instance of the micro-service at the first moment;
calculating an operation configuration index of each micro-service instance at the first moment according to the average memory utilization rate, the average network delay, the average processor utilization rate and a preset weight parameter;
calculating the load index of the whole application service at the first moment according to the connection number and the access number of all the instances in the whole application service;
Calculating the performance index of each micro-service at the first moment according to the running configuration index of each micro-service instance at the first moment and the load index of the whole application service at the first moment;
and constructing a performance matrix of each micro-service at the first moment according to the performance index of each micro-service at the first moment.
10. The apparatus according to claim 9, wherein the computing module is configured to:
calculating the average memory usage, average network delay and average processor usage of each instance of the micro-service at the first time by the following formula:
where t is the first time, m is the number of instances of each microservice,processor utilization at time t for the jth instance of the ith microservice,/>Memory utilization at time t for the jth instance of the ith microservice, d t,i Network delay at time t for the jth instance of the ith microservice, +.>Average processor utilization at time t for the jth instance of the ith microservice,/>Average memory usage at time t for the jth instance of the ith microservice,/>Average network delay at time t for the j-th instance of the i-th microservice;
Calculating an operational configuration index for each instance of the micro-service at the first time by the following formula:
wherein t is the first moment,configuring an index for the running of each instance of the micro-service at the first moment, wherein gamma is a weight parameter of the memory utilization rate, and delta is a networkAnd the weight parameter and epsilon of the complex delay are weight parameters of the processor utilization rate.
11. The apparatus according to claim 9, wherein the computing module is configured to:
calculating the load index of the whole application service at the first moment by the following formula:
wherein t is the first time, p t Serving the load index, c, of the whole application at the first moment t Connection number v for all instances in the whole application service t For the number of accesses of all instances in the entire application service,for lowest network latency->For the minimum number of connections of the proxy server, +.>Is the minimum number of accesses to the proxy server.
12. The apparatus according to claim 9, wherein the computing module is configured to:
calculating the performance index of each micro-service at the first moment by the following formula:
wherein t is the first time, d t,i Performance metrics at the first time for each micro-service,configuring an index, p, for each instance of the microservice running at the first time t And serving the load index of the whole application at the first moment.
13. The apparatus according to claim 9, wherein the processing module is specifically configured to:
and inputting a calling matrix of the plurality of micro services at the first moment and a performance matrix of each micro service at the first moment into a preset LSTM model to obtain the number of instances of each micro service at the second moment.
14. The apparatus of claim 13, wherein the preset LSTM model satisfies:
forgetting the processing function f of the door t The method comprises the following steps:
wherein t is the first moment, R t A call matrix, D, for the plurality of micro-services at the first time t For each said microservice a performance matrix at said first moment,predicted value for instance number of micro-service at time t-1, W f To forget R in the processing function of the door t |D t And->Matrix operation weight of (a) and sigma is the activation function of forgetting gate, b f To forget the offset of the gate function;
updating transfer information function C t The method comprises the following steps:
wherein t is the first moment, C t-1 Updating transfer information function, i, for time t-1 t Andto update the intermediate function of the transfer information function, W i R in intermediate function for updating transfer information function t |D t And->Matrix operation weights of b) i And b c An offset of an intermediate function for updating the transfer information function;
output gate functionThe method comprises the following steps:
wherein t is the first moment, W x For outputting R in the gate function t |D t Andmatrix operation weights of b) x An offset for the output gate function;
loss functionThe method comprises the following steps:
wherein t is the first time, x t,n For the number of instances of the nth microservice at time t,the number of instances predicted at time t for the nth microservice.
15. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the micro-service instance adaptation method of any one of claims 1 to 7.
16. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the micro service instance adaptation method of any one of claims 1 to 7.
CN202311162108.6A 2023-09-11 2023-09-11 Micro-service example adjusting method and device, electronic equipment and readable storage medium Active CN116893865B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311162108.6A CN116893865B (en) 2023-09-11 2023-09-11 Micro-service example adjusting method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311162108.6A CN116893865B (en) 2023-09-11 2023-09-11 Micro-service example adjusting method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116893865A CN116893865A (en) 2023-10-17
CN116893865B true CN116893865B (en) 2023-12-12

Family

ID=88312460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311162108.6A Active CN116893865B (en) 2023-09-11 2023-09-11 Micro-service example adjusting method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116893865B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199150A (en) * 2020-08-13 2021-01-08 北京航空航天大学 Online application dynamic capacity expansion and contraction method based on micro-service calling dependency perception
CN114650297A (en) * 2022-02-14 2022-06-21 浙江大学 Self-adaptive automatic scaling method and system under multi-micro-service calling environment
CN115391048A (en) * 2022-09-20 2022-11-25 山东乾云启创信息科技股份有限公司 Micro-service instance dynamic horizontal expansion and contraction method and system based on trend prediction
CN115994075A (en) * 2023-02-16 2023-04-21 上海埃林哲软件系统股份有限公司 Unified observable method and system for heterogeneous micro-service system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199150A (en) * 2020-08-13 2021-01-08 北京航空航天大学 Online application dynamic capacity expansion and contraction method based on micro-service calling dependency perception
CN114650297A (en) * 2022-02-14 2022-06-21 浙江大学 Self-adaptive automatic scaling method and system under multi-micro-service calling environment
CN115391048A (en) * 2022-09-20 2022-11-25 山东乾云启创信息科技股份有限公司 Micro-service instance dynamic horizontal expansion and contraction method and system based on trend prediction
CN115994075A (en) * 2023-02-16 2023-04-21 上海埃林哲软件系统股份有限公司 Unified observable method and system for heterogeneous micro-service system

Also Published As

Publication number Publication date
CN116893865A (en) 2023-10-17

Similar Documents

Publication Publication Date Title
Huang et al. When backpressure meets predictive scheduling
Chiang et al. Profit optimization in SLA-aware cloud services with a finite capacity queuing model
US10719366B1 (en) Dynamic and selective hardware acceleration
WO2017027171A1 (en) System and method for balancing computation with communication in parallel learning
US8606905B1 (en) Automated determination of system scalability and scalability constraint factors
CN109272348B (en) Method and device for determining number of active users, storage medium and electronic equipment
CN113822456A (en) Service combination optimization deployment method based on deep reinforcement learning in cloud and mist mixed environment
Li et al. Cost-aware automatic scaling and workload-aware replica management for edge-cloud environment
CN112835698A (en) Heterogeneous cluster-based dynamic load balancing method for request classification processing
CN111858034A (en) Resource management method, system, device and medium
Chang et al. Reward-based Markov chain analysis adaptive global resource management for inter-cloud computing
CN110347477B (en) Service self-adaptive deployment method and device in cloud environment
CN116893865B (en) Micro-service example adjusting method and device, electronic equipment and readable storage medium
Sood Function points‐based resource prediction in cloud computing
CN113254191A (en) Method, electronic device and computer program product for running applications
Fan et al. Knative autoscaler optimize based on double exponential smoothing
CN112156453B (en) Example adaptive adjustment method, apparatus, computer readable storage medium and device
CN115858147A (en) Cost modeling method and device
CN108933834A (en) A kind of dispatching method and dispatching device
Ambati et al. Modeling and analyzing waiting policies for cloud-enabled schedulers
Chunlin et al. Multi-queue scheduling of heterogeneous jobs in hybrid geo-distributed cloud environment
Zohrati et al. Flexible approach to schedule tasks in cloud‐computing environments
CN113592263A (en) Resource return increment prediction method and device based on dynamic resource return increase ratio
CN114020469A (en) Edge node-based multi-task learning method, device, medium and equipment
CN113672200A (en) Microservice processing method and device, storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant