CN116954898A - Memory overflow processing method, device and apparatus and computer readable storage medium - Google Patents

Memory overflow processing method, device and apparatus and computer readable storage medium Download PDF

Info

Publication number
CN116954898A
CN116954898A CN202310896239.0A CN202310896239A CN116954898A CN 116954898 A CN116954898 A CN 116954898A CN 202310896239 A CN202310896239 A CN 202310896239A CN 116954898 A CN116954898 A CN 116954898A
Authority
CN
China
Prior art keywords
memory
back pressure
water line
books
broker
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
CN202310896239.0A
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.)
China Mobile Communications Group Co Ltd
China Mobile Group Jiangsu Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Jiangsu 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 Group Jiangsu Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202310896239.0A priority Critical patent/CN116954898A/en
Publication of CN116954898A publication Critical patent/CN116954898A/en
Pending legal-status Critical Current

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/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a memory overflow processing method, equipment and device and a computer readable storage medium, and belongs to the technical field of infrastructure. The method comprises the following steps: the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly; when the memory utilization rate of the Books is larger than the high memory water line threshold value, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books; and after the Zookeeper monitors the write operation of the back pressure information, sending a speed limit notification to a computing node Broker so as to control the Broker to reduce the sending speed. According to the method, the sending speed of the Broker is adjusted according to the comparison result of the memory utilization rate of the Books and the corresponding memory water line threshold value, and the purpose of avoiding memory overflow of the Books is achieved.

Description

Memory overflow processing method, device and apparatus and computer readable storage medium
Technical Field
The present application relates to the field of infrastructure technologies, and in particular, to a memory overflow processing method, apparatus, device, and computer readable storage medium.
Background
In a business support system, a cloud native messaging system framework (Pulsar, a system framework) is typically used to provide the capability of a business processing platform for business support flow computing. The single Pulsar cluster is mainly composed of the following parts: the producer is responsible for sending information; the consumer is responsible for consuming the information; a computing node Broker is responsible for message forwarding and load balancing between a producer and a consumer; bookkeper, which is composed of one or more storage nodes and is responsible for the persistent storage of the message; the management node Zookeeper is responsible for configuration and coordination tasks of the cluster level.
In the related art, a service support system creates a producer and a consumer by using a client, wherein the producer converts an offline ticket into a ticket message and writes the ticket message into a queue, and the consumer subscribes to the queue to read the ticket message, so that the service support system establishes real-time communication with a Broker and transmits data.
In the case of burst flood peak flow, in order to increase the number of messages processed per second and throughput of ticket messages, the number of concurrent clients and the number of concurrent broadcasters need to be horizontally expanded, and then, the concurrent broadcasters continuously send read-write requests to the bookies in the Bookkeeper component. However, the memory capacity of the Books is limited, and a large number of read-write operations can lead to a sharp rise of the memory utilization rate of the Books, so that the situation of insufficient memory of the direct memory is easy to occur, and finally, the process is caused to exit abnormally, so that the service support system connected to the Pulsar cluster cannot work normally.
Disclosure of Invention
The application mainly aims to provide a memory overflow processing method, equipment, a device and a computer readable storage medium, which aim to solve the technical problem of abnormal exit of a process during burst flood peak flow.
In order to achieve the above object, the present application provides a memory overflow processing method, which includes the following steps:
the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly;
when the memory utilization rate of the Books is larger than the high memory water line threshold value, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books;
and after the Zookeeper monitors the write operation of the back pressure information, sending a speed limit notification to a computing node Broker so as to control the Broker to reduce the sending speed.
Optionally, the high memory water line threshold includes a first memory water line threshold and a second memory water line threshold, the first memory water line threshold is greater than the second memory water line threshold, and when the memory usage of the cookie is greater than the high memory water line threshold, the step of writing back pressure information into the process subdirectory of the management node Zookeeper by the cookie includes:
when the memory utilization rate of the Books is larger than the first memory water line threshold, writing stop information into a process subdirectory of a management node Zookeeper by the Books;
after the Zookeeper monitors the write operation of the stop information, a stop notification is sent to a computing node Broker to control the Broker to stop sending;
and when the memory utilization rate of the Books is greater than the second memory water line threshold value, executing the step of writing back pressure information into a process subdirectory of the management node Zookeeper by the Books.
Optionally, after the Zookeeper monitors the writing operation of the back pressure information, sending a speed limit notification to a computing node Broker to control the Broker to reduce the sending speed, the method includes:
the cookie receives a low-memory water line threshold value sent by the back pressure assembly;
when the memory utilization rate of the Books is smaller than the low memory water line threshold value, deleting the back pressure information in the process subdirectory of the Zookeeper by the Books;
and after the Zookeeper monitors the deleting operation of the back pressure information, sending a speed limit release notification to the Broker so as to control the recovery sending speed of the Broker.
Optionally, when the memory usage of the cookie is smaller than the low memory water line threshold, before the step of deleting the backpressure information in the process subdirectory of the Zookeeper, the method includes:
when detecting that the transmitting speed of the Broker is reduced, synchronizing a storage log in a memory to a disk by the cookie;
and after the synchronization completion is detected, cleaning the storage log in the memory.
Optionally, the step of receiving the high memory water line threshold value sent by the back pressure component by the storage node cookie includes:
the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly and the configuration attribute of the back pressure mechanism;
when the memory usage rate of the cookie is greater than the high memory water line threshold, the step of writing back pressure information into the process subdirectory of the management node Zookeeper by the cookie includes:
and when the memory utilization rate of the Books is greater than the high memory water line threshold and the configuration attribute meets a preset condition, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books.
Optionally, after the Zookeeper monitors the writing operation of the back pressure information, sending a speed limit notification to a computing node Broker to control the Broker to reduce the sending speed, the method includes:
the cookie judges the state of a back pressure mechanism and the result of the back pressure mechanism according to the memory utilization rate and the high memory water line threshold value;
counting the processing time spent by the memory usage rate falling to the high memory water line threshold value, and detecting the real-time sending speed of the Broker;
and writing the state of the back pressure mechanism, the result of the back pressure mechanism, the processing time length and the real-time sending speed into a memory overflow log of the Zookeeper.
Optionally, after the step of writing the backpressure mechanism state, the backpressure mechanism result, the processing time length and the real-time sending speed into the memory overflow log of the Zookeeper, the method includes:
after the Broker receives a query instruction of a RestAPI interface, the memory overflow log is called from the Zookeeper;
and converting the memory overflow log into a monitoring trend graph, and providing the monitoring trend graph based on the RestAPI interface.
In addition, in order to achieve the above object, the present application further provides a memory overflow processing device, which includes:
the cookie is used for receiving the high-memory water line threshold value sent by the back pressure assembly;
the Books are used for writing back pressure information into a process subdirectory of the management node Zookeeper when the memory utilization rate of the Books is larger than the high memory water line threshold value;
and the Zookeeper is used for sending a speed limit notice to a computing node Broker after monitoring the write operation of the back pressure information so as to control the Broker to reduce the sending speed.
In addition, in order to achieve the above object, the present application further provides a memory overflow processing device, including: the memory overflow processing device comprises a memory, a processor and a memory overflow processing program which is stored in the memory and can run on the processor, wherein the memory overflow processing program is configured to realize the steps of the memory overflow processing method.
In addition, in order to achieve the above object, the present application further provides a computer readable storage medium, on which a memory overflow processing program is stored, the memory overflow processing program implementing the steps of the memory overflow processing method when executed by a processor.
In one technical scheme provided by the application, when the flood peak flow is suddenly generated, a back pressure mechanism is adopted to compare the memory usage rate with the high memory water line threshold value, and then the sending speed of the Broker is adjusted according to the comparison result, so that the memory usage rate of the abnormal Boookie is reduced to be within a normal range, memory overflow is avoided, and normal operation of the process is ensured. Moreover, counter-pressure measures are timely taken for the abnormal Books, so that the influence on other Books service nodes in the Books cluster can be reduced, and the phenomenon that the whole Pulsar cluster is unavailable due to abnormal exit of other nodes due to writing pressure is avoided.
Drawings
FIG. 1 is a flowchart illustrating a memory overflow processing method according to a first embodiment of the present application;
FIG. 2 is a signaling flow chart of a first embodiment of a memory overflow handling method according to the present application;
FIG. 3 is a flowchart illustrating a memory overflow handling method according to a second embodiment of the present application;
FIG. 4 is a flowchart illustrating a memory overflow processing method according to a third embodiment of the present application;
FIG. 5 is a signaling flow chart of a third embodiment of a memory overflow handling method according to the present application;
FIG. 6 is a flowchart illustrating a memory overflow handling method according to a fourth embodiment of the present application;
FIG. 7 is a flowchart illustrating a memory overflow handling method according to a fifth embodiment of the present application;
fig. 8 is a schematic structural diagram of a memory overflow processing device in a hardware running environment according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In the case of burst flood peak flow, in order to increase the number of messages processed per second and throughput of ticket messages, the number of concurrent clients and the number of concurrent broadcasters need to be horizontally expanded, and then, the concurrent broadcasters continuously send read-write requests to the bookies in the Bookkeeper component. However, the memory capacity of the Books is limited, and a large number of read-write operations can lead to a sharp rise in the memory utilization rate of the Books, so that the situation of insufficient memory (direct memory Out Of Memory, direct memory OOM) of the direct memory is easy to occur, and finally, the process is abnormally exited.
In addition, the Broker continuously sends read-write requests to the Books in the Bookkeper, and when the Books cannot finish corresponding storage operation, the Bookkeper cannot process new read-write requests any more, which can cause a bottleneck in data communication between the Broker and the Bookkeper.
In order to solve the problems, the method compares the memory utilization rate of the Books with the corresponding memory water line threshold value, adjusts the sending speed of the Broker according to the comparison result, and aims to maintain the memory utilization rate of the Books within a normal range and avoid the situation of memory overflow.
In order that the above-described aspects may be better understood, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
Referring to fig. 1, fig. 1 is a schematic flow chart of a first embodiment of a memory overflow processing method according to the present application.
In this embodiment, the memory overflow processing method includes:
step S11: the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly;
in a single Pulsar cluster, the following parts are included: a computing node Broker is responsible for message forwarding and load balancing between a producer and a consumer; bookeuper consists of one or more storage node Books and is responsible for the persistent storage of the message; the management node Zookeeper is responsible for configuration and coordination tasks of the cluster level.
It can be understood that the present solution adopts a back pressure mechanism to monitor and optimize the memory usage of the cookie, and sets a high memory water line threshold in the back pressure component in advance, such as 80% of the overall memory capacity, and once the current memory usage exceeds the threshold, there is a risk of memory overflow.
Optionally, referring to fig. 2, a cookie service is started on the planned host, and after the back pressure component detects that the cookie is in a starting state, the high memory water line threshold is sent, and accordingly, the cookie receives the high memory water line threshold.
Step S12: when the memory utilization rate of the Books is larger than the high memory water line threshold value, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books;
it can be understood that a Broker is started on the planned host, communication is established with a cookie, and the cookie receives a request of a Broker read-write message. The basic processing flow aiming at the message writing request is that the Books write information into the memory, then the information in the memory is stored into the disk in a lasting manner at regular time and quantity, and then the information in the memory is cleaned; the basic processing flow aiming at the message reading request is that the Books directly read related information from a memory or a disk and then send the related information to a Broker. In this scheme, taking the processing of a write message request as an example, a memory overflow processing method is provided, and in addition, if there is a risk of memory overflow during the processing of a read message request, similar processing may be performed based on the principle of this scheme, and this embodiment is not limited specifically.
Optionally, the cookie acquires process information in real time in the process of communicating with the Broker, so as to determine the current memory usage rate, that is, the proportion of the physical memory currently being used to the total available memory. And then comparing the memory utilization rate with a high memory water line threshold value, if the memory utilization rate is larger than the high memory water line threshold value, the memory utilization degree of the Books at the current moment is too high, and the Books are in an unhealthy state and face the high risk of memory overflow, so that a back pressure mechanism is needed.
Or, the current memory usage rate and the message request sending rate are obtained, and then the predicted memory usage rate in a certain period of time in the future is calculated, if the predicted memory usage rate is greater than the high memory water line threshold value, a back pressure mechanism is adopted in advance, so that the rapid increase of the flow in a short time is avoided, and the response of the back pressure mechanism is not timely.
Further, the back pressure mechanism is that the Books generate back pressure information, and the back pressure information is written into a sub-directory of a/Books process under a/back pressure directory of the Zookeeper so that the subsequent Zookeeper adopts a corresponding back pressure strategy.
Step S13: and after the Zookeeper monitors the write operation of the back pressure information, sending a speed limit notification to a computing node Broker so as to control the Broker to reduce the sending speed.
It can be understood that the Zookeeper is provided with a watch mechanism, which is equivalent to a trigger, and any operation of adding, deleting and checking can trigger the watch so as to monitor the change condition of the stored data.
Optionally, when the cookie writes back pressure information into the process subdirectory, the Zookeeper monitors the state change of the process subdirectory, that is, captures a corresponding writing operation, and at this time, the Zookeeper sends a speed limit notification to all the broaders to control all the broaders to reduce the sending speed.
Alternatively, because the cookies are independent of each other, it may happen that the cookie 1 memory usage is 90% and the cookie 2 memory usage is 30%, only a back pressure mechanism is needed for the former. Therefore, the Bookie writes the back pressure information into the process subdirectory and writes the own identification number, correspondingly, the subsequent broader determines first, sends the Bookie of the identification number to the broader of the writing information request, and then sends the speed limit notice in a targeted manner so as to control the specific broader to reduce the sending speed.
Further, after the Broker receives the speed limit notification, the memory cleaning speed in the cookie is obtained, and then the sending speed is adjusted to be lower than the memory cleaning speed, so that the writing speed of the memory is ensured to be smaller than the cleaning speed, and only then the use rate of the memory is continuously reduced.
Step A: the cookie judges the state of a back pressure mechanism and the result of the back pressure mechanism according to the memory utilization rate and the high memory water line threshold value;
and (B) step (B): counting the processing time spent by the memory usage rate falling to the high memory water line threshold value, and detecting the real-time sending speed of the Broker;
step C: and writing the state of the back pressure mechanism, the result of the back pressure mechanism, the processing time length and the real-time sending speed into a memory overflow log of the Zookeeper.
It will be appreciated that in order to facilitate management by the operation and maintenance personnel, a corresponding record of the Pulsar cluster situation is required.
Optionally, the cookie determines the state of the back pressure mechanism and the result of the back pressure mechanism according to the comparison between the memory usage and the high memory water line threshold and the change of the memory usage, if the state of the back pressure mechanism is on, the result of the back pressure mechanism is successful. In addition, the cookie counts the processing time spent by the memory usage to drop to the high memory water line threshold, and the real-time transmission speed of the Broker.
Further, after the operation is finished, the multidimensional index record is written into a memory overflow log of the Zookeeper so as to be read at any time later.
Step D: after the Broker receives a query instruction of a RestAPI interface, the memory overflow log is called from the Zookeeper;
step E: and converting the memory overflow log into a monitoring trend graph, and providing the monitoring trend graph based on the RestAPI interface.
Optionally, the cookie provides a RestAPI interface to the outside, and the operator calls data through the RestAPI interface. Correspondingly, after the Broker receives the inquiry instruction of the RestAPI interface, the memory overflow log is called from the Zookeeper, and then the memory overflow log is converted into a monitoring trend chart through Prometheus and Grafana, and the monitoring trend chart is displayed in a graphical mode. Finally, a monitoring trend chart is provided for the outside through a RestAPI interface so as to display the process and the result of optimizing the Books memory and provide the function of warning notification, and the content can also be notified to operation and maintenance personnel in a short message or mail mode so as to facilitate operation and maintenance management.
In one technical scheme provided in this embodiment, when the flood peak flow is bursty, a back pressure mechanism is adopted to compare the memory usage rate with the high memory water line threshold value, and then the sending speed of the Broker is adjusted according to the comparison result, so that the memory usage rate of the abnormal Boookie is reduced to be within a normal range, memory overflow is avoided, and normal operation of the process is ensured. Moreover, counter-pressure measures are timely taken for the abnormal Books, so that the influence on other Books service nodes in the Books cluster can be reduced, and the phenomenon that the whole Pulsar cluster is unavailable due to abnormal exit of other nodes due to writing pressure is avoided.
Further, referring to fig. 3, a second embodiment of the memory overflow processing method of the present application is provided. Based on the embodiment shown in fig. 1, the high memory water line threshold includes a first memory water line threshold and a second memory water line threshold, the first memory water line threshold is greater than the second memory water line threshold, and when the memory usage of the cookie is greater than the high memory water line threshold, the step of writing back pressure information into the process subdirectory of the management node Zookeeper by the cookie includes:
step S21: when the memory utilization rate of the Books is larger than the first memory water line threshold, writing stop information into a process subdirectory of a management node Zookeeper by the Books;
step S22: after the Zookeeper monitors the write operation of the stop information, a stop notification is sent to a computing node Broker to control the Broker to stop sending;
step S23: and when the memory utilization rate of the Books is greater than the second memory water line threshold value, executing the step of writing back pressure information into a process subdirectory of the management node Zookeeper by the Books.
It will be appreciated that the high memory line threshold is preset in the counter-pressure assembly and is divided into a first memory line threshold and a second memory line threshold from large to small, e.g. 95%, 80%.
Optionally, when the memory usage of the cookie is greater than the first memory water line threshold, this indicates that the emergency is high, if the Broker still sends a request, the cookie may overflow the memory in a short time, and in this case, the stopping process needs to be directly adopted.
Further, the Books generate stop information, and the stop information is written into a sub-directory of a process of the Books under a/backup directory of the Zookeeper so that the subsequent Zookeeper can take a corresponding stop strategy.
Still further, the Zookeeper listens to the state change of the process subdirectory, i.e. captures the write operation of the stop information, after which the Zookeeper sends a stop notification to all or a specific Broker to control the Broker to stop sending requests.
In addition, when the memory usage rate of the cookie is greater than the second memory water line threshold, the emergency degree is lower, so that only the speed-down processing is needed, and therefore, the cookie writes back pressure information into the process subdirectory of the Zookeeper, and the subsequent steps are the same as those of the first embodiment, and are not repeated here.
In one technical scheme provided in this embodiment, the first memory water line threshold and the second memory water line threshold are divided, and the processing stop and the back pressure processing are respectively corresponding to each other, so that in a subsequent operation process, a proper processing mode is adopted according to the actual situation of the utilization rate of the cookie memory, and the processing speed and the memory state are reasonably balanced.
Further, referring to fig. 4, a third embodiment of the memory overflow processing method of the present application is provided. Based on the embodiment shown in fig. 1, after the Zookeeper monitors the writing operation of the back pressure information, the step of sending a speed limit notification to a computing node Broker to control the Broker to reduce the sending speed includes:
step S31: the cookie receives a low-memory water line threshold value sent by the back pressure assembly;
it will be appreciated that during peak traffic bursts, the transmission speed of the Broker is limited to avoid memory overflow, and after that, the transmission speed of the Broker needs to be recovered to increase the number of messages processed per second and throughput of the messages.
Optionally, a low memory water line threshold, such as 50% of the overall memory capacity, is preset in the backpressure component, and once the current memory usage is below the threshold, it is indicated that the memory is in a healthy state, and there is no risk of memory overflow.
Optionally, referring to fig. 5, after the backpressure component detects that the cookie enters the speed limit state, a low memory water line threshold is sent, and accordingly, the cookie receives the low memory water line threshold.
Step S32: when the memory utilization rate of the Books is smaller than the low memory water line threshold value, deleting the back pressure information in the process subdirectory of the Zookeeper by the Books;
step S33: and after the Zookeeper monitors the deleting operation of the back pressure information, sending a speed limit release notification to the Broker so as to control the recovery sending speed of the Broker.
Optionally, the cookie determines a current memory usage rate according to the process information, and/or determines an expected memory usage rate according to the current memory usage rate and the message request sending rate. If the memory usage rate is smaller than the low memory water line threshold, the memory usage of the Books at the current moment is in a healthy state.
Further, the Books determine the sub-directory of the Books process under the Zookeeper/backpressure directory, and delete the back pressure information therein.
Further, when the cookie deletes the back pressure information, the Zookeeper monitors the state change of the process subdirectory, that is, captures the corresponding deletion operation, and at this time, the Zookeeper sends a speed limit release notification to all or a specific Broker to control the Broker to resume the sending speed.
In one technical scheme provided in this embodiment, after limiting the sending speed of the Broker, the memory usage rate is compared with the low memory water line threshold, and the sending speed of the Broker is adjusted according to the comparison result, so that the cookie writes in the message again according to the normal speed, thereby improving the number of messages processed per second and throughput of the message. And in the whole flow, a back pressure mechanism is dynamically started or closed by taking a real-time memory water line of the Books as a reference, so that the flow of the client is flexibly limited, and the burst flood peak flow is effectively treated.
Further, referring to fig. 6, a fourth embodiment of the memory overflow processing method of the present application is provided. Based on the embodiment shown in fig. 4, when the memory usage of the cookie is smaller than the low memory water line threshold, before the step of deleting the backpressure information in the process subdirectory of the Zookeeper, the method includes:
step S41: when detecting that the transmitting speed of the Broker is reduced, synchronizing a storage log in a memory to a disk by the cookie;
step S42: and after the synchronization completion is detected, cleaning the storage log in the memory.
It will be appreciated that in general, the cookie will write information into journ and hedger storage logs, then brush the logs into the disk in a timed and quantitative manner, and clean the information in the memory to realize persistent storage. In order to reduce the risk of memory overflow and shorten the processing time of a compression mechanism, the scheme adopts forced disc brushing and cleaning.
Optionally, once the sending speed of the Broker is detected to be reduced, the cookie immediately starts a memory garbage collection thread, and synchronizes journ and hedger storage logs in the memory to the disk.
Further, after the synchronization operation is detected to be completed, the Books start the memory garbage collection thread again, clear all journ and ledger storage logs in the memory, and release the storage space so as to write new information.
It should be noted that in the related art, the memory garbage collection thread is usually started when the memory usage rate of the cookie reaches a peak value, so after the log is brushed, a large amount of data is cached in the memory, and when the memory garbage collection thread is started again, garbage collection is stopped, a large amount of time is consumed, which negatively affects long connection between the cookie and the Zookeeper service, and causes connection timeout and abnormal exit of the cookie service process due to heartbeat failure.
In the scheme, when the transmission speed of the Broker is detected to be reduced, the memory garbage collection thread is forcedly started to brush the disc and clean the memory garbage, so that the condition that the connection Zookeeper service is overtime due to overlong memory garbage collection time is avoided, and the stability of the request processing is ensured.
In the technical scheme provided by the embodiment, the brushing and cleaning are not performed in a timed and quantitative mode any more, but the brushing and cleaning time is triggered according to the relation between the memory use rate of the Books and the low memory water line threshold value, so that the granularity of the Books service management memory is finer.
Further, referring to fig. 7, a fifth embodiment of the memory overflow processing method of the present application is provided. Based on the embodiment shown in fig. 1, the step of receiving, by the storage node cookie, the high memory water line threshold sent by the backpressure component includes:
step S51: the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly and the configuration attribute of the back pressure mechanism;
when the memory usage rate of the cookie is greater than the high memory water line threshold, the step of writing back pressure information into the process subdirectory of the management node Zookeeper by the cookie includes:
step S52: and when the memory utilization rate of the Books is greater than the high memory water line threshold and the configuration attribute meets a preset condition, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books.
It can be understood that the configuration attribute of the back pressure mechanism refers to other configuration attributes, such as the number of connections between the cookie and the Broker, the current transmission speed of the Broker, and the like, which can determine whether to use the back pressure mechanism, besides the memory usage of the cookie, and the embodiment is not limited specifically.
Optionally, the cookie receives not only the high memory water line threshold sent by the backpressure component, but also the configuration properties of the backpressure mechanism. And then judging whether a back pressure mechanism is adopted, namely judging whether the memory utilization rate of the Books is larger than a high memory water line threshold value or not, and judging whether the configuration attribute meets preset conditions or not, wherein corresponding back pressure measures are adopted only when the two conditions are met at the same time, namely writing back pressure information into a process subdirectory of the Zookeeper by the Books.
In the technical scheme provided by the embodiment, not only the memory utilization rate of the Books is considered, but also the connection number between the Books and the Broker, the current sending speed of the Broker and other configuration attributes are considered, and the application scene of the back pressure mechanism is comprehensively judged from multiple aspects, so that the accurate control is realized.
The embodiment of the application provides a memory overflow processing device, which comprises:
the cookie is used for receiving the high-memory water line threshold value sent by the back pressure assembly;
the Books are used for writing back pressure information into a process subdirectory of the management node Zookeeper when the memory utilization rate of the Books is larger than the high memory water line threshold value;
and the Zookeeper is used for sending a speed limit notice to a computing node Broker after monitoring the write operation of the back pressure information so as to control the Broker to reduce the sending speed.
Since the embodiments of the apparatus portion and the embodiments of the method portion correspond to each other, the embodiments of the apparatus portion are referred to the description of the embodiments of the method portion, and are not repeated herein.
Referring to fig. 8, fig. 8 is a schematic diagram of a memory overflow processing device in a hardware running environment according to an embodiment of the present application.
As shown in fig. 8, the memory overflow processing device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 8 is not limiting of the memory overflow handling device and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 8, an operating system, a data storage module, a network communication module, a user interface module, and a memory overflow handler may be included in the memory 1005 as one type of storage medium.
In the memory overflow handling device shown in fig. 8, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the memory overflow processing device of the present application may be disposed in the memory overflow processing device, where the memory overflow processing device invokes a memory overflow processing program stored in the memory 1005 through the processor 1001, and executes the memory overflow processing method provided by the embodiment of the present application.
An embodiment of the present application provides a computer readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the steps in any embodiment of the foregoing memory overflow processing method.
Since the embodiments of the computer readable storage medium portion and the embodiments of the method portion correspond to each other, the embodiments of the computer readable storage medium portion are referred to the description of the embodiments of the method portion, 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 system 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 system. 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 system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. The memory overflow processing method is characterized by comprising the following steps of:
the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly;
when the memory utilization rate of the Books is larger than the high memory water line threshold value, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books;
and after the Zookeeper monitors the write operation of the back pressure information, sending a speed limit notification to a computing node Broker so as to control the Broker to reduce the sending speed.
2. The memory overflow handling method of claim 1 wherein the high memory water line threshold comprises a first memory water line threshold and a second memory water line threshold, the first memory water line threshold being greater than the second memory water line threshold, the step of writing back pressure information into a process subdirectory of a management node Zookeeper by the cookie when the memory usage of the cookie is greater than the high memory water line threshold comprising:
when the memory utilization rate of the Books is larger than the first memory water line threshold, writing stop information into a process subdirectory of a management node Zookeeper by the Books;
after the Zookeeper monitors the write operation of the stop information, a stop notification is sent to a computing node Broker to control the Broker to stop sending;
and when the memory utilization rate of the Books is greater than the second memory water line threshold value, executing the step of writing back pressure information into a process subdirectory of the management node Zookeeper by the Books.
3. The memory overflow processing method as claimed in claim 1, wherein after the step of sending a speed limit notification to a computing node Broker to control the Broker to reduce the sending speed after the step of monitoring the writing operation of the back pressure information, the method comprises:
the cookie receives a low-memory water line threshold value sent by the back pressure assembly;
when the memory utilization rate of the Books is smaller than the low memory water line threshold value, deleting the back pressure information in the process subdirectory of the Zookeeper by the Books;
and after the Zookeeper monitors the deleting operation of the back pressure information, sending a speed limit release notification to the Broker so as to control the recovery sending speed of the Broker.
4. The memory overflow processing method as claimed in claim 3, wherein, before the step of deleting the backpressure information in the process subdirectory of the Zookeeper, the memory usage of the cookie is smaller than the low memory water line threshold, the method comprises:
when detecting that the transmitting speed of the Broker is reduced, synchronizing a storage log in a memory to a disk by the cookie;
and after the synchronization completion is detected, cleaning the storage log in the memory.
5. The memory overflow handling method as claimed in claim 1, wherein the step of the storage node cookie receiving the high memory water line threshold sent by the backpressure component comprises:
the storage node Books receive the high-memory water line threshold value sent by the back pressure assembly and the configuration attribute of the back pressure mechanism;
when the memory usage rate of the cookie is greater than the high memory water line threshold, the step of writing back pressure information into the process subdirectory of the management node Zookeeper by the cookie includes:
and when the memory utilization rate of the Books is greater than the high memory water line threshold and the configuration attribute meets a preset condition, writing back pressure information into a process subdirectory of a management node Zookeeper by the Books.
6. The memory overflow processing method as claimed in claim 1, wherein after the step of sending a speed limit notification to a computing node Broker to control the Broker to reduce the sending speed after the step of monitoring the writing operation of the back pressure information, the method comprises:
the cookie judges the state of a back pressure mechanism and the result of the back pressure mechanism according to the memory utilization rate and the high memory water line threshold value;
counting the processing time spent by the memory usage rate falling to the high memory water line threshold value, and detecting the real-time sending speed of the Broker;
and writing the state of the back pressure mechanism, the result of the back pressure mechanism, the processing time length and the real-time sending speed into a memory overflow log of the Zookeeper.
7. The memory overflow processing method as claimed in claim 6, wherein after the step of writing the back pressure mechanism state, the back pressure mechanism result, the processing time length and the real-time sending speed into the memory overflow log of the Zookeeper, the method comprises:
after the Broker receives a query instruction of a RestAPI interface, the memory overflow log is called from the Zookeeper;
and converting the memory overflow log into a monitoring trend graph, and providing the monitoring trend graph based on the RestAPI interface.
8. A memory overflow handling device, the device comprising:
the cookie is used for receiving the high-memory water line threshold value sent by the back pressure assembly;
the Books are used for writing back pressure information into a process subdirectory of the management node Zookeeper when the memory utilization rate of the Books is larger than the high memory water line threshold value;
and the Zookeeper is used for sending a speed limit notice to a computing node Broker after monitoring the write operation of the back pressure information so as to control the Broker to reduce the sending speed.
9. A memory overflow handling device, the device comprising: a memory, a processor and a memory overflow handling program stored on the memory and executable on the processor, the memory overflow handling program being configured to implement the steps of the memory overflow handling method of any of claims 1 to 7.
10. A computer readable storage medium, wherein a memory overflow handling program is stored on the computer readable storage medium, which when executed by a processor implements the steps of the memory overflow handling method according to any of claims 1 to 7.
CN202310896239.0A 2023-07-20 2023-07-20 Memory overflow processing method, device and apparatus and computer readable storage medium Pending CN116954898A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310896239.0A CN116954898A (en) 2023-07-20 2023-07-20 Memory overflow processing method, device and apparatus and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310896239.0A CN116954898A (en) 2023-07-20 2023-07-20 Memory overflow processing method, device and apparatus and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116954898A true CN116954898A (en) 2023-10-27

Family

ID=88450634

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310896239.0A Pending CN116954898A (en) 2023-07-20 2023-07-20 Memory overflow processing method, device and apparatus and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116954898A (en)

Similar Documents

Publication Publication Date Title
US10528405B2 (en) Methods, apparatus and computer programs for managing persistence
CN109522287B (en) Monitoring method, system, equipment and medium for distributed file storage cluster
CN110213371B (en) Message consumption method, device, equipment and computer storage medium
US8386611B2 (en) Information system, load control method, load control program and recording medium
US10417062B2 (en) Method and apparatus of unloading out of memory processing flow to user space
CN112165436B (en) Flow control method, device and system
CN111190745A (en) Data processing method and device and computer readable storage medium
CN112650575B (en) Resource scheduling method, device and cloud service system
US20200057714A1 (en) Testing data changes in production systems
CN113285884B (en) Flow control method and system
CN111984495A (en) Big data monitoring method and device and storage medium
CN110674149B (en) Service data processing method and device, computer equipment and storage medium
CN109766198B (en) Stream processing method, device, equipment and computer readable storage medium
CN110534136B (en) Recording method and device
CN111352746B (en) Message flow limiting method and storage medium
CN116954898A (en) Memory overflow processing method, device and apparatus and computer readable storage medium
CN111309442A (en) Method, device, system, medium and equipment for adjusting number of micro-service containers
CN114143263B (en) Method, equipment and medium for limiting current of user request
CN115718732A (en) Disk file management method, device, equipment and storage medium
KR20230055575A (en) Universal large-scale multi-cloud environment monitoring system and method for private and public networks
CN110134547B (en) Middleware-based repeated data deleting method and related device
AU2010273075A1 (en) System and method for multimedia messaging service processing
CN111158899A (en) Data acquisition method, data acquisition device, task management center and task management system
US20180123866A1 (en) Method and apparatus for determining event level of monitoring result
CN110597603A (en) Scheduling method and system of distributed scheduling tasks

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