CN115480930A - Configuration method and device of application service and electronic equipment - Google Patents

Configuration method and device of application service and electronic equipment Download PDF

Info

Publication number
CN115480930A
CN115480930A CN202210911870.9A CN202210911870A CN115480930A CN 115480930 A CN115480930 A CN 115480930A CN 202210911870 A CN202210911870 A CN 202210911870A CN 115480930 A CN115480930 A CN 115480930A
Authority
CN
China
Prior art keywords
message
preset
partition
backlog
application service
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
CN202210911870.9A
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.)
Tianyi Cloud Technology Co Ltd
Original Assignee
Tianyi Cloud 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 Tianyi Cloud Technology Co Ltd filed Critical Tianyi Cloud Technology Co Ltd
Priority to CN202210911870.9A priority Critical patent/CN115480930A/en
Publication of CN115480930A publication Critical patent/CN115480930A/en
Pending legal-status Critical Current

Links

Images

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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1727Details of free space management performed by the file system
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a configuration method and a configuration device of application service and electronic equipment, which are applied to an application system, wherein the method comprises the following steps: acquiring message backlog data of each partition of a message queue according to a preset period; calculating message backlog data of the message queue based on the message backlog data of each partition, and comparing the message backlog data of the message queue with a preset backlog threshold value to determine whether the message backlog occurs in the current period according to the comparison result; and if the times of message backlog in the preset capacity expansion time period exceed a first preset time threshold, expanding the application service quantity in the application system, wherein the preset capacity expansion time period is greater than a preset period. The technical scheme provided by the invention improves the accuracy of judging the occurrence of the message backlog condition.

Description

Configuration method and device of application service and electronic equipment
Technical Field
The invention relates to the field of software development, in particular to a configuration method and device of an application service and electronic equipment.
Background
The message queue is an important component in a distributed system, mainly solves the problems of application coupling, asynchronous messages, flow cut-off and the like, realizes a high-performance, high-availability, scalable and final consistency architecture, and is an indispensable middleware of a large-scale distributed system. The message queue is generally divided into a plurality of theme partitions, and the partitions can improve the scalability and horizontal expansion capability of the message queue. In a distributed system, a container is used as a medium-light-weight virtualization technology, an application program and a running dependent environment thereof are packaged and encapsulated into a standardized and strongly-transplanted mirror image, a running environment with process isolation and resource limitation is provided through a container engine, decoupling of the application, an operating system and bottom hardware is realized, and the whole body is used as an application service for realizing a certain function, is packaged at one time and runs everywhere. As shown in fig. 1, when the application service is consuming, a plurality of threads are set in the application service to respectively consume corresponding to each topic partition of the message queue, if the application service is too late to consume and process due to a large increase of messages, the messages in the message queue are overstocked, and if the messages are not processed in time, the application system may be failed or delayed. In the prior art, for the problem, if the message queue has a message backlog, the capacity needs to be expanded for the application service, but in the prior art, the criteria for judging the message backlog and the message shortage are still set as a threshold value for comparison, and how to implement the capacity expansion scheme for the application service does not have a specific standard, so that the solution to the problem is not satisfactory. Therefore, it is necessary to research a configuration method of an application service so as to accurately cope with the situation of message backlog.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for configuring an application service, and an electronic device, so as to improve accuracy of determining occurrence of a message backlog condition.
According to a first aspect, an embodiment of the present invention provides a configuration method of an application service, which is applied to an application system, and the method includes: acquiring message backlog data of each partition of a message queue according to a preset period; calculating message backlog data of a message queue based on the message backlog data of each partition, and comparing the message backlog data of the message queue with a preset backlog threshold value to determine whether message backlog occurs in the current period according to a comparison result; and if the times of message backlog in a preset expansion time period exceed a first preset time threshold, expanding the application service quantity in the application system, wherein the preset expansion time period is greater than the preset period.
Optionally, the obtaining of the message backlog data of each partition of the message queue according to the preset period includes: acquiring offset zone bits consumed by each partition currently and offset zone bits of messages issued by each partition in the current period; and acquiring the message backlog data of each partition based on the difference value of the offset zone bit of the message issued by each partition and the currently consumed offset zone bit.
Optionally, the expanding the number of application services in the application system includes: calculating a first candidate capacity expansion quantity based on the ratio of the sum of the data of the message backlogs of the partitions to the consumption capacity of the single application service; calculating the difference between the partition quantity and the existing application service quantity to obtain a second candidate capacity expansion quantity; determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service; and expanding the number of the application services in the application system according to the expanded number of the application services.
Optionally, the method further comprises: counting the message quantity pulled from the message queue according to the preset period; determining whether application service resource redundancy occurs or not based on a difference value between a preset capacity reduction threshold value and the message quantity pulled from the message queue; and if the times of application service resource redundancy in the preset capacity reduction time period exceed a second preset time threshold, reducing the number of application services in the application system, wherein the preset capacity reduction time period is longer than the preset period.
According to a second aspect, an embodiment of the present invention provides an apparatus for configuring an application service, where the apparatus is applied to an application system, and the apparatus includes: the message backlog data acquisition module is used for acquiring the message backlog data of each partition of the message queue according to a preset period; the backlog partition determining module is used for calculating message backlog data of the message queue based on the message backlog data of each partition, comparing the message backlog data of the message queue with a preset backlog threshold value and determining whether the message backlog occurs in the current period according to the comparison result; and the capacity expansion module is used for expanding the application service quantity in the application system if the times of message backlog in a preset capacity expansion time period exceed a first preset time threshold, wherein the preset capacity expansion time period is greater than the preset period.
Optionally, the message backlog data obtaining module includes: the offset acquisition module is used for acquiring offset zone bits consumed by each partition at present and offset zone bits of messages issued by each partition in the present period; and the message backlog data calculation module is used for acquiring the message backlog data of each partition based on the difference value between the offset zone bit of the message issued by each partition and the currently consumed offset zone bit.
Optionally, the capacity expansion module includes: the first capacity expansion calculation module is used for calculating a first candidate capacity expansion quantity based on the ratio of the sum of the message backlog data of each partition to the consumption capacity of a single application service; the second capacity expansion calculation module is used for calculating the difference between the partition number and the existing application service number to obtain a second candidate capacity expansion number; the expansion calculation module is used for determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service; and the capacity expansion execution module is used for expanding the application service quantity in the application system according to the expansion quantity of the application service.
Optionally, the apparatus further comprises: the pull message quantity counting module is used for counting the message quantity pulled from the message queue according to the preset period; the resource redundancy judging module is used for determining whether application service resource redundancy occurs or not based on the difference value between a preset capacity reduction threshold value and the message quantity pulled from the message queue; and the capacity reduction module is used for reducing the number of the application services in the application system if the number of times of the application service resource redundancy in a preset capacity reduction time period exceeds a second preset number threshold, wherein the preset capacity reduction time period is greater than the preset period.
According to a third aspect, embodiments of the present invention provide an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively coupled to each other, the memory having stored therein computer instructions, and the processor performing the method of the first aspect, or any one of the optional embodiments of the first aspect, by executing the computer instructions.
According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions for causing a computer to thereby perform the method of the first aspect, or any one of the optional implementation manners of the first aspect.
The technical scheme provided by the application has the following advantages:
according to the technical scheme, the message backlog data of each partition of the message queue are counted periodically, the message backlog data of the whole message queue are calculated by utilizing the message backlog data of each partition, and then whether the message backlog condition occurs in the current period or not is judged according to the size relation between the message backlog data of the message queue and a preset backlog threshold value. And then, judging the times of the message backlog occurring in each statistical period within a period of time, and if the times of the message backlog occurring exceed a first preset time threshold, considering that the message backlog occurs in the message queue, so that the number of application services in an application system needs to be expanded, and the accuracy of judging whether the message queue actually has the message backlog is improved.
In addition, if the message queue is determined to have the message backlog, in an embodiment, a ratio of the whole message backlog data of the message queue to the consumption capacity of a single application service is calculated to obtain a first candidate capacity expansion quantity, a difference between the partition quantity and the existing application service quantity is also calculated to obtain a second candidate capacity expansion quantity, and the smaller value of the first candidate capacity expansion quantity and the second candidate capacity expansion quantity is taken as the final capacity expansion quantity. The problem of message backlog is solved by allocating the least resources for the application system, and the accurate configuration of the application service is further realized.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and not to be construed as limiting the invention in any way, and in which:
FIG. 1 shows a flow diagram of a prior art application service configuration;
FIG. 2 is a diagram illustrating steps of a method for configuring an application service according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating a method for configuring an application service according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating an apparatus for configuring an application service according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
Referring to fig. 2 and fig. 3, in an embodiment, a method for configuring an application service includes the following steps:
step S101: and acquiring the message backlog data of each partition of the message queue according to a preset period.
Step S102: and calculating the message backlog data of the message queue based on the message backlog data of each partition, comparing the message backlog data of the message queue with a preset backlog threshold value, and determining whether the message backlog occurs in the current period according to the comparison result.
Step S103: and if the times of message backlog in the preset capacity expansion time period exceed a first preset time threshold, expanding the application service quantity in the application system, wherein the preset capacity expansion time period is greater than a preset period.
Specifically, the embodiment monitors the message queue through the timed task, obtains the message backlog data of each partition of the message queue according to the preset period, performs summation operation by using the message backlog data of each partition to obtain the message backlog data of the whole message queue, compares the message backlog data of the whole message queue with the preset backlog threshold, and determines that the message backlog occurs in the current period when the message backlog data of the whole message queue exceeds the preset backlog threshold. In addition, in this embodiment, a preset capacity expansion time period is further set as an effective period of the capacity expansion policy, where the preset capacity expansion time period is greater than the preset period, and in the preset capacity expansion time period, if the number of times that the message backlog appears in each monitoring period is determined to exceed a first preset number threshold, it is determined that the message backlog condition of the message queue needs to be alleviated, so that the capacity expansion policy is started to increase the number of application services. Based on the method, the accuracy of judging whether the message queue really has the message backlog is improved through the independent judgment of each monitoring period and the joint judgment of a plurality of monitoring periods. Specifically, the expression for determining whether capacity expansion is required is as follows:
Figure BDA0003772751090000061
in the formula, L i The backlog data of the ith partition, J the partition number of the message queue, N a preset backlog threshold, count () the number of times of message backlogs in the calculation condition, M a first preset number threshold to be exceeded during capacity expansion, and t a preset capacity expansion time period.
Specifically, in an embodiment, the step S101 specifically includes the following steps:
the method comprises the following steps: and acquiring the currently consumed offset zone bit of each partition and the offset zone bit of the message issued by each partition in the current period.
Step two: and acquiring the message backlog data of each partition based on the difference value of the offset zone bit of the message issued by each partition and the currently consumed offset zone bit.
Specifically, a predetermined thread in the application service is used as a consumer to consume a message from a partition corresponding to the message queue, and after each consumption, the partition needs to start from where to determine the next consumption, so that the offset flag bit offset of the current consumption is changed to inform the consumer which specific position of the partition to start consumption next time. Each time a message publisher publishes a message to a respective partition in the message queue, the message publisher also updates a newly generated offset flag, i.e., the message's offset flag. Based on this, in this embodiment, the messages that are not consumed by each partition are obtained by calculating the difference between the offset flag bit of the message issued by each partition and the offset flag bit consumed currently, and each message that is not consumed by analysis is used as message backlog data to accurately measure the message backlog condition.
Specifically, in an embodiment, the step S103 specifically includes the following steps:
step three: a first candidate expansion amount is calculated based on a ratio of a sum of the partition message backlog data to a single application service consumption capacity.
Step four: and calculating the difference between the partition quantity and the existing application service quantity to obtain a second candidate capacity expansion quantity.
Step five: and determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service.
Step six: and expanding the number of the application services in the application system according to the expanded number of the application services.
Specifically, in order to further implement accurate capacity expansion, the problem of message backlog can be solved under the condition of increasing the minimum computing resources, in this embodiment, when the application service needs to be expanded, capacity expansion and optimization are performed according to the following two ways:
firstly, the sum of the message backlog data of each partition is calculated to obtain the message backlog data of the whole message queue, then the ratio of the message backlog data of the message queue to the consumption capacity of a single application service (the number of messages consumed by the single application service in a monitoring period) is calculated, and the first candidate capacity expansion quantity is calculated. Then, in another way, the difference between the partition number and the existing application service number is calculated to obtain a second candidate capacity expansion number. And finally, determining the smaller value as the expansion quantity of the application service, thereby solving the problem of message overstock under the condition of increasing the minimum computing resources, avoiding resource waste and realizing accurate capacity expansion.
Specifically, in an embodiment, the configuration method of an application service provided in the embodiment of the present invention further includes the following steps:
step seven: and counting the message quantity pulled from the message queue according to a preset period.
Step eight: and determining whether application service resource redundancy occurs or not based on a difference value between a preset capacity reduction threshold value and the message quantity pulled from the message queue.
Step nine: and if the times of application service resource redundancy in the preset capacity reduction time period exceed a second preset time threshold, reducing the number of application services in the application system, wherein the preset capacity reduction time period is greater than a preset period.
Specifically, in this embodiment, a capacity reduction determination policy is further provided for a case where the number of application services is large, so as to further improve the configuration accuracy of the application services. The specific capacity reduction strategy is as follows:
and similarly, monitoring the message quantity pulled by the application service from the whole message queue in a preset period, calculating the difference value between the preset capacity reduction threshold value and the message quantity pulled from the message queue, and if the difference value is greater than zero, representing that the message pulled by the application service from the whole message queue in the current monitoring period is less, so that the redundancy of application service resources occurs, and the message pulling can be completed only by a small amount of application service. Therefore, the frequency of application service resource redundancy occurring in each monitoring period is further judged to exceed the second preset frequency threshold value in the preset capacity reduction time period, and if the frequency of application service resource redundancy occurring in each monitoring period exceeds the second preset frequency threshold value, a capacity reduction strategy is executed, so that the accuracy of configuration of application services is further improved. Specifically, the capacity reduction policy decision expression is as follows:
[Count(X-Y>0)>Z] t
in the formula, X is a capacity reduction threshold for pulling the message data volume, Y is the message volume pulled from the message queue each time, count () is the number of times of calculating the occurrence of the redundancy of the application service resource, Z is a second preset number threshold, and t is a preset capacity reduction time period.
Based on the method, when the application system judges that the capacity expansion and reduction are needed, the application system calls the capacity expansion and reduction request API of the container engine, and the container engine responds to the capacity expansion and reduction request to complete the capacity expansion and reduction of the specified service.
Through the steps, according to the technical scheme provided by the application, the message backlog data of each partition of the message queue are periodically counted, the message backlog data of the whole message queue are calculated by utilizing the message backlog data of each partition, and then whether the message backlog condition occurs in the current period or not is judged according to the size relation between the message backlog data of the message queue and the preset backlog threshold value. And then, judging the times of the message backlog occurring in each statistical period within a period of time, and if the times of the message backlog occurring exceed a first preset time threshold, considering that the message backlog occurs in the message queue, so that the number of application services in an application system needs to be expanded, and the accuracy of judging whether the message queue actually has the message backlog is improved.
In addition, if the message queue is determined to have the message backlog, in an embodiment, a ratio of the whole message backlog data of the message queue to the consumption capacity of a single application service is calculated to obtain a first candidate capacity expansion quantity, a difference between the partition quantity and the existing application service quantity is also calculated to obtain a second candidate capacity expansion quantity, and the smaller value of the first candidate capacity expansion quantity and the second candidate capacity expansion quantity is taken as the final capacity expansion quantity. The problem of message backlog is solved by allocating minimum resources of the application system, accurate configuration of the application service is further realized, the elastic expansion and contraction capacity of the application service is realized by reasonably analyzing strategies by utilizing the data, and the system can be ensured to run smoothly and stably for the system with obvious peak period of business.
As shown in fig. 4, this embodiment further provides a configuration apparatus of an application service, which is applied to an application system, and the apparatus includes:
the message backlog data acquiring module 101 is configured to acquire message backlog data of each partition of the message queue according to a preset period. For details, refer to the related description of step S101 in the above method embodiment, and no further description is provided here.
The backlog partition determining module 102 is configured to calculate message backlog data of the message queue based on the message backlog data of each partition, and compare the message backlog data of the message queue with a preset backlog threshold, so as to determine whether a message backlog occurs in a current period according to a comparison result. For details, refer to the related description of step S102 in the above method embodiment, and details are not repeated herein.
The capacity expansion module 103 is configured to expand the number of application services in the application system if the number of times of message backlog occurrence in a preset capacity expansion time period exceeds a first preset number threshold, where the preset capacity expansion time period is greater than a preset period. For details, refer to the related description of step S103 in the above method embodiment, and no further description is provided here.
Specifically, in an embodiment, the message backlog data obtaining module 101 includes:
and the offset acquisition module is used for acquiring the offset zone bits consumed by the partitions currently and the offset zone bits of the messages issued by the partitions in the current period. For details, refer to the related description of step one in the above method embodiments, and details are not repeated herein.
And the message backlog data calculation module is used for acquiring the message backlog data of each partition based on the difference value between the offset zone bit of the message issued by each partition and the currently consumed offset zone bit. For details, refer to the related description of step two in the above method embodiments, and details are not repeated herein.
Specifically, in an embodiment, the capacity expansion module includes:
and the first capacity expansion calculation module is used for calculating a first candidate capacity expansion quantity based on the ratio of the sum of the message backlog data of each partition to the consumption capacity of a single application service. For details, refer to the related description of step three in the above method embodiments, and no further description is provided herein.
And the second capacity expansion calculation module is used for calculating the difference between the partition number and the existing application service number to obtain a second candidate capacity expansion number. For details, refer to the description related to step four in the above method embodiments, and no further description is provided herein.
And the expansion calculation module is used for determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service. For details, refer to the description related to step five in the above method embodiments, and no further description is provided herein.
And the capacity expansion execution module is used for expanding the application service quantity in the application system according to the expansion quantity of the application service. For details, refer to the related description of step six in the above method embodiments, and no further description is provided herein.
Specifically, in an embodiment, an apparatus for configuring an application service provided in an embodiment of the present invention further includes:
and the pull message quantity counting module is used for counting the message quantity pulled from the message queue according to a preset period. For details, refer to the related description of step seven in the above method embodiments, and details are not repeated herein.
And the resource redundancy judging module is used for determining whether the application service resource redundancy exists or not based on the difference value between the preset capacity reduction threshold value and the message quantity pulled from the message queue. For details, refer to the description related to step eight in the above method embodiments, and no further description is provided herein.
And the capacity reduction module is used for reducing the number of the application services in the application system if the times of the application service resource redundancy in the preset capacity reduction time period exceed a second preset time threshold, wherein the preset capacity reduction time period is longer than a preset period. For details, refer to the related description of step nine in the above method embodiments, and no further description is provided herein.
The configuration device of the application service provided in the embodiment of the present invention is configured to execute the configuration method of the application service provided in the above embodiment, and the implementation manner and the principle thereof are the same, and details are referred to the related description of the above method embodiment and are not described again.
Through the cooperative cooperation of the above components, the technical scheme provided by the application periodically counts the message backlog data of each partition of the message queue, calculates the message backlog data of the whole message queue by using the message backlog data of each partition, and then judges whether the message backlog condition occurs in the current period according to the size relationship between the message backlog data of the message queue and the preset backlog threshold. And then, judging the times of the message backlog occurring in each statistical period within a period of time, and if the times of the message backlog occurring exceed a first preset time threshold, considering that the message backlog occurs in the message queue, so that the number of application services in an application system needs to be expanded, and the accuracy of judging whether the message queue actually has the message backlog is improved.
In addition, if the message queue is determined to have the message backlog, in an embodiment, a ratio of the whole message backlog data of the message queue to the consumption capacity of a single application service is calculated to obtain a first candidate capacity expansion quantity, a difference between the partition quantity and the existing application service quantity is also calculated to obtain a second candidate capacity expansion quantity, and the smaller value of the first candidate capacity expansion quantity and the second candidate capacity expansion quantity is taken as the final capacity expansion quantity. The problem of message backlog is solved by allocating minimum resources for the application system, accurate configuration of the application service is further realized, reasonable strategy analysis is carried out by utilizing the data, the elastic capacity expansion and contraction of the application service is realized, and the system with obvious peak period of business can be ensured to run smoothly and stably.
Fig. 5 shows an electronic device according to an embodiment of the present invention, where the device includes a processor 901 and a memory 902, which may be connected via a bus or in another manner, and fig. 5 illustrates an example of a connection via a bus.
Processor 901 may be a Central Processing Unit (CPU). The Processor 901 may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, or combinations thereof.
The memory 902, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the methods in the above-described method embodiments. The processor 901 executes various functional applications and data processing of the processor by executing non-transitory software programs, instructions and modules stored in the memory 902, that is, implements the methods in the above-described method embodiments.
The memory 902 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created by the processor 901, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 902 may optionally include memory located remotely from the processor 901, which may be connected to the processor 901 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One or more modules are stored in the memory 902, which when executed by the processor 901 performs the methods in the above-described method embodiments.
The specific details of the electronic device may be understood by referring to the corresponding related descriptions and effects in the above method embodiments, and are not described herein again.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, and the implemented program can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A configuration method of an application service is applied to an application system, and the method comprises the following steps:
acquiring message backlog data of each partition of a message queue according to a preset period;
calculating message backlog data of the message queue based on the message backlog data of each partition, and comparing the message backlog data of the message queue with a preset backlog threshold value to determine whether the message backlog occurs in the current period according to the comparison result;
and if the times of message backlog in a preset capacity expansion time period exceed a first preset time threshold, expanding the application service quantity in the application system, wherein the preset capacity expansion time period is greater than the preset period.
2. The method according to claim 1, wherein the obtaining of the message backlog data of each partition of the message queue according to the preset period comprises:
acquiring an offset zone bit consumed by each partition currently and an offset zone bit of a message issued by each partition in a current period;
and acquiring the message backlog data of each partition based on the difference value of the offset zone bit of the message issued by each partition and the currently consumed offset zone bit.
3. The method of claim 1, wherein expanding the number of application services within the application system comprises:
calculating a first candidate capacity expansion quantity based on the ratio of the sum of the data of the message backlogs of the partitions to the consumption capacity of the single application service;
calculating the difference between the partition quantity and the existing application service quantity to obtain a second candidate capacity expansion quantity;
determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service;
and expanding the number of the application services in the application system according to the expanded number of the application services.
4. The method of claim 1, further comprising:
counting the message quantity pulled from the message queue according to the preset period;
determining whether application service resource redundancy occurs or not based on a difference value between a preset capacity reduction threshold value and the message quantity pulled from the message queue;
and if the times of application service resource redundancy in a preset capacity reduction time period exceed a second preset time threshold, reducing the number of application services in the application system, wherein the preset capacity reduction time period is greater than the preset period.
5. An apparatus for configuring an application service, applied to an application system, the apparatus comprising:
the message backlog data acquisition module is used for acquiring the message backlog data of each partition of the message queue according to a preset period;
the backlog partition determining module is used for calculating message backlog data of the message queue based on the message backlog data of each partition, comparing the message backlog data of the message queue with a preset backlog threshold value and determining whether message backlog occurs in the current period according to a comparison result;
and the capacity expansion module is used for expanding the application service quantity in the application system if the times of message backlog in a preset capacity expansion time period exceed a first preset time threshold, wherein the preset capacity expansion time period is greater than the preset period.
6. The apparatus of claim 5, wherein the message backlog data acquisition module comprises:
the offset acquisition module is used for acquiring offset zone bits consumed by each partition currently and offset zone bits of messages issued by each partition in the current period;
and the message backlog data calculation module is used for acquiring the message backlog data of each partition based on the difference value between the offset zone bit of the message issued by each partition and the currently consumed offset zone bit.
7. The apparatus of claim 5, wherein the capacity expansion module comprises:
the first capacity expansion calculation module is used for calculating a first candidate capacity expansion quantity based on the ratio of the sum of the message backlog data of each partition to the consumption capacity of a single application service;
the second capacity expansion calculation module is used for calculating the difference between the partition number and the existing application service number to obtain a second candidate capacity expansion number;
the expansion calculation module is used for determining the smaller value of the first candidate expansion quantity and the second candidate expansion quantity as the expansion quantity of the application service;
and the capacity expansion execution module is used for expanding the application service quantity in the application system according to the expansion quantity of the application service.
8. The apparatus of claim 5, further comprising:
the pull message quantity counting module is used for counting the message quantity pulled from the message queue according to the preset period;
the resource redundancy judging module is used for determining whether application service resource redundancy occurs or not based on the difference value between a preset capacity reduction threshold value and the message quantity pulled from the message queue;
and the capacity reduction module is used for reducing the number of the application services in the application system if the times of application service resource redundancy in a preset capacity reduction time period exceed a second preset time threshold, wherein the preset capacity reduction time period is longer than the preset period.
9. An electronic device, comprising:
a memory and a processor communicatively coupled to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the method of any of claims 1-4.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to thereby perform the method of any one of claims 1-4.
CN202210911870.9A 2022-07-29 2022-07-29 Configuration method and device of application service and electronic equipment Pending CN115480930A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210911870.9A CN115480930A (en) 2022-07-29 2022-07-29 Configuration method and device of application service and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210911870.9A CN115480930A (en) 2022-07-29 2022-07-29 Configuration method and device of application service and electronic equipment

Publications (1)

Publication Number Publication Date
CN115480930A true CN115480930A (en) 2022-12-16

Family

ID=84422703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210911870.9A Pending CN115480930A (en) 2022-07-29 2022-07-29 Configuration method and device of application service and electronic equipment

Country Status (1)

Country Link
CN (1) CN115480930A (en)

Similar Documents

Publication Publication Date Title
CN111522636B (en) Application container adjusting method, application container adjusting system, computer readable medium and terminal device
US20150295970A1 (en) Method and device for augmenting and releasing capacity of computing resources in real-time stream computing system
CN107562512B (en) Method, device and system for migrating virtual machine
US20230169351A1 (en) Distributed training method based on end-to-end adaption, and device
US20140359126A1 (en) Workload partitioning among heterogeneous processing nodes
US20120297216A1 (en) Dynamically selecting active polling or timed waits
CN108574645B (en) Queue scheduling method and device
CN103412786A (en) High performance server architecture system and data processing method thereof
CN108134814B (en) Service data processing method and device
CN107070709B (en) NFV (network function virtualization) implementation method based on bottom NUMA (non uniform memory Access) perception
CN111966289A (en) Partition optimization method and system based on Kafka cluster
US9547576B2 (en) Multi-core processor system and control method
WO2016202153A1 (en) Gpu resource allocation method and system
CN111418187A (en) Scalable statistics and analysis mechanism in cloud networks
CN110096339B (en) System load-based capacity expansion and contraction configuration recommendation system and method
CN114816709A (en) Task scheduling method, device, server and readable storage medium
CN111158904A (en) Task scheduling method, device, server and medium
CN113778644A (en) Task processing method, device, equipment and storage medium
CN111858656A (en) Static data query method and device based on distributed architecture
CN115480930A (en) Configuration method and device of application service and electronic equipment
CN112817687A (en) Data synchronization method and device
CN112099937A (en) Resource management method and device
CN111158896A (en) Distributed process scheduling method and system
CN116227599A (en) Inference model optimization method and device, electronic equipment and storage medium
CN112506808B (en) Test task execution method, computing device, computing system and storage medium

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