CN116991582A - Reserved memory self-adaptive configuration method, device, equipment and storage medium - Google Patents

Reserved memory self-adaptive configuration method, device, equipment and storage medium Download PDF

Info

Publication number
CN116991582A
CN116991582A CN202310964762.2A CN202310964762A CN116991582A CN 116991582 A CN116991582 A CN 116991582A CN 202310964762 A CN202310964762 A CN 202310964762A CN 116991582 A CN116991582 A CN 116991582A
Authority
CN
China
Prior art keywords
reserved memory
memory
configuration
target
determining
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
CN202310964762.2A
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 Merchants Bank Co Ltd
Original Assignee
China Merchants Bank 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 Merchants Bank Co Ltd filed Critical China Merchants Bank Co Ltd
Priority to CN202310964762.2A priority Critical patent/CN116991582A/en
Publication of CN116991582A publication Critical patent/CN116991582A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/073Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a memory management context, e.g. virtual memory or cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The invention belongs to the technical field of memory management, and discloses a reserved memory self-adaptive configuration method, device, equipment and storage medium. The method comprises the following steps: determining a target reserved memory and a target reserved memory configuration strategy according to the current scene; when the effective reserved memory does not accord with the target reserved memory, determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy; and when the reserved memory needs to be optimized, adjusting the effective reserved memory according to the target reserved memory. Through the method, the size of the kdump reserved memory is intelligently determined and adjusted according to different application scenes and use requirements, the self-adaptive configuration of the kdump reserved memory is realized, personalized requirements are met, the memory utilization rate is improved as much as possible on the premise that the kdump function is ensured to be available, and therefore optimal performance of the system is realized, and the reliability and stability of the system are improved.

Description

Reserved memory self-adaptive configuration method, device, equipment and storage medium
Technical Field
The present invention relates to the field of memory management technologies, and in particular, to a method, an apparatus, a device, and a storage medium for adaptive configuration of reserved memory.
Background
Kdump is a kernel crash dump mechanism of Linux operating systems, and can automatically dump memory data when a crash occurs in the system, so that the cause of the crash can be debugged, analyzed and determined later, and has been widely used.
Enabling kdump requires reserving a certain amount of memory for dedicated use, the required size being related to the amount of physical memory. The existing kdump reserved memory configuration method is configured by adjusting a system starting parameter crashkernel, but the strategy is too simple to realize optimal configuration, if the configuration value is not proper, the reserved memory configuration is too small, so that fault dump failure can be caused, the kdump mechanism is invalid, if the reserved memory configuration is too large, precious memory space can be wasted, insufficient application memory is caused, and the reliability and stability of the system are affected.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a reserved memory self-adaptive configuration method, device, equipment and storage medium, and aims to solve the technical problem that the traditional reserved memory configuration method in the prior art adopts static configuration and cannot realize optimal configuration in different scenes.
In order to achieve the above object, the present invention provides a method for adaptively configuring reserved memory, which includes the following steps:
determining a target reserved memory and a target reserved memory configuration strategy according to the current scene;
when the effective reserved memory does not accord with the target reserved memory, determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy;
and when the reserved memory needs to be optimized, adjusting the effective reserved memory according to the target reserved memory.
Optionally, the determining, according to the current scenario, the target reserved memory and the target reserved memory configuration policy includes:
determining the target reserved memory according to the current scene and the current physical memory;
and determining the target reserved memory configuration strategy in a preset reserved memory configuration strategy according to the current scene, wherein the preset reserved memory configuration strategy at least comprises a reserved memory optimization strategy, a reserved memory difference optimization strategy and a reserved memory maintenance strategy.
Optionally, the determining the target reserved memory according to the current scene and the current physical memory includes:
acquiring a first corresponding relation between a current physical memory and an additional memory;
determining an additional memory according to the current physical memory and the first corresponding relation;
acquiring a second corresponding relation among the initial memory, the additional memory and the initial reserved memory;
determining an initial reserved memory according to the initial memory, the additional memory and the second corresponding relation;
determining a third corresponding relation between the initial reserved memory and the target reserved memory according to the current scene;
and obtaining the target reserved memory according to the corresponding relation between the initial reserved memory and the third corresponding relation.
Optionally, the determining, according to the current scenario, the target reserved memory configuration policy in a preset reserved memory configuration policy includes:
when the current scene accords with a preset important scene, determining that the target reserved memory configuration strategy is a reserved memory optimization strategy;
when the current scene accords with a preset common scene, determining that the target reserved memory configuration strategy is a reserved memory difference value optimization strategy;
and when the current scene accords with a preset restarting scene, determining the target reserved memory configuration strategy as a reserved memory maintenance strategy.
Optionally, the determining whether the reserved memory needs to be optimized according to the target reserved memory configuration policy includes:
when the target reserved memory allocation policy is the reserved memory optimization policy, determining that reserved memory needs to be optimized;
when the target reserved memory allocation policy is the reserved memory difference optimization policy, determining a reserved memory difference according to the effective reserved memory and the target reserved memory, and when the reserved memory difference is greater than a preset difference threshold, determining that the reserved memory needs to be optimized;
and when the target reserved memory configuration strategy is the reserved memory maintenance strategy, determining that the reserved memory does not need to be optimized.
Optionally, the method for adaptively configuring reserved memory further includes:
recording configuration decision information and obtaining a configuration result;
analyzing the target reserved memory configuration strategy according to the configuration result, the configuration decision information and the current scene to obtain analysis data;
and optimizing the target reserved memory configuration strategy according to the analysis data.
Optionally, before determining the target reserved memory and the target reserved memory configuration policy according to the current scenario, the method further includes:
acquiring system configuration and state indexes, wherein the system configuration at least comprises a server type, a CPU architecture, the number of CPUs, the number of physical memories, an operating system version, a kernel version, an application process and the effective reserved memory, and the state indexes at least comprise a current physical memory, a current available memory, an available memory proportion, a memory change state and a memory dump condition;
and determining the current scene according to the system configuration and the state index.
In addition, in order to achieve the above object, the present invention further provides a reserved memory adaptive configuration device, where the reserved memory adaptive configuration device includes:
the strategy module is used for determining a target reserved memory and a target reserved memory configuration strategy according to the current scene;
the configuration module is used for determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy when the effective reserved memory does not accord with the target reserved memory;
the configuration module is further configured to adjust the effective reserved memory according to the target reserved memory when the reserved memory needs to be optimized.
In addition, in order to achieve the above object, the present invention further provides a reserved memory adaptive configuration device, where the reserved memory adaptive configuration device includes: the system comprises a memory, a processor and a reserved memory self-adaption configuration program stored on the memory and capable of running on the processor, wherein the reserved memory self-adaption configuration program is configured to realize the steps of the reserved memory self-adaption configuration method.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where a reserved memory adaptive configuration program is stored, where the reserved memory adaptive configuration program, when executed by a processor, implements the steps of the reserved memory adaptive configuration method as described above.
According to the invention, a target reserved memory and a target reserved memory configuration strategy are determined according to the current scene, when the effective reserved memory does not accord with the target reserved memory, whether the reserved memory needs to be optimized or not is determined according to the target reserved memory configuration strategy, and when the reserved memory needs to be optimized, the effective reserved memory is adjusted according to the target reserved memory. Compared with the traditional memory reservation configuration method which adopts static configuration, the optimal configuration in different scenes can not be realized, the method and the device can intelligently determine and adjust the size of the kdump reserved memory according to different application scenes and use requirements and by combining the actual physical memory of the system and the currently available memory, realize the self-adaptive configuration of the kdump reserved memory, meet the personalized requirements, and improve the utilization rate of the memory as much as possible on the premise of ensuring the availability of the kdump function, thereby realizing the optimal performance expression of the system and improving the reliability and stability of the system.
Drawings
FIG. 1 is a schematic diagram of a configuration of a reserved memory adaptive configuration device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a memory reservation adaptive configuration method according to the present invention;
FIG. 3 is a schematic overall flow chart of an embodiment of a memory reservation adaptive configuration method according to the present invention;
FIG. 4 is a flowchart illustrating a second embodiment of a memory reservation adaptive configuration method according to the present invention;
fig. 5 is a block diagram of a first embodiment of a reserved memory adaptive configuration device according to the present invention.
The achievement of the objects, functional features and advantages of the present invention 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 invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a reserved memory adaptive configuration device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the reserved memory adaptive configuration device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a client interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The client interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional client 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.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is not limiting of the reserved memory adaptive configuration 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. 1, an operating system, a network communication module, a client interface module, and a reserved memory adaptive configuration program may be included in the memory 1005 as one type of storage medium.
In the reserved memory adaptive configuration device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the client interface 1003 is mainly used for data interaction with clients; the processor 1001 and the memory 1005 in the reserved memory self-adaptive configuration device of the present invention may be disposed in the reserved memory self-adaptive configuration device, where the reserved memory self-adaptive configuration device invokes the reserved memory self-adaptive configuration program stored in the memory 1005 through the processor 1001, and executes the reserved memory self-adaptive configuration method provided by the embodiment of the present invention.
Referring to fig. 2, fig. 2 is a flow chart of a first embodiment of a reserved memory adaptive configuration method according to the present invention.
In this embodiment, the adaptive configuration method for reserved memory includes the following steps:
step S10: and determining the target reserved memory and the target reserved memory configuration strategy according to the current scene.
It should be noted that, the execution body of the embodiment is a computer, which may be a virtual machine or a physical machine, and the computer is provided with a reserved memory self-adaptive configuration program, and the reserved memory is configured by the reserved memory self-adaptive configuration program.
It can be understood that the current scenario refers to the current application scenario, the target reserved memory is the most suitable reserved memory in the current scenario, that is, the optimal configuration of the reserved memory in the current scenario, and the target reserved memory configuration policy is the manner of configuring the reserved memory in the current scenario.
It should be appreciated that, due to different application scenarios, different reserved memory is often required, for example: when the memory increases or decreases, the reserved memory should be changed synchronously, so in this embodiment, the most suitable reserved memory is set for different application scenarios, that is, the calculation modes of the target reserved memory in different application scenarios are different. Since different application scenarios often have different requirements, the configuration requirements of the different scenarios on the reserved memory are different, for example: compared with a web server, when a kernel abnormality occurs in the database server, the database server is more required to locate the fault cause through memory dump generated by kdump, and proper reserved memory configuration is required to be ensured at the moment, so that corresponding reserved memory configuration modes are set for different application scenes. It should be understood that in different scenarios, the different configurations are performed according to the target reserved memory and the corresponding target reserved memory configuration policy, so as to meet the personalized use requirement.
Further, in order to determine the current scene, some data needs to be acquired, and before the step S10, the method further includes: acquiring system configuration and state indexes; and determining the current scene according to the system configuration and the state index.
It should be noted that, the system configuration is related configuration information, and at least includes a server type, a CPU architecture, a CPU number, a physical memory number, an operating system version, a kernel version, an application process, and the effective reserved memory, where the server type is a server type, for example: database servers, web servers, etc., the CPU architecture, i.e., CPU (Central Processing Unit ) vendor, specifies a specification for CPU products belonging to the same family, such as: x86 architecture, ARM (Advanced RISC Machine, advanced reduced instruction set machine) architecture, RISC-V (Reduced Instruction Set Computing-Five, fifth generation reduced instruction set) architecture, and MIPS (Microprocessor without Interlocked Piped Stages, microprocessor without internal interlocking pipeline stage) architecture, the number of CPUs is the number of CPUs configured, for example: the number of physical memories is the number of configured memories, for example, 2, 4 or more: 1, 2 or more, operating system versions, i.e., versions of the operating system currently in use, such as: windows 7, windows 10, etc., kernel version is the currently used kernel version, and application process is the running main application process, which is used for judging the current use, and specific system configuration conditions need to be determined according to actual conditions, and the embodiment is not limited to this.
It may be understood that the status index refers to an associated index, and at least includes a current physical memory, a current available memory, an available memory ratio, a memory change status and a memory dump condition, where the current physical memory is an actual total memory, the current available memory refers to a currently available memory, the available memory ratio is a proportion of the current available memory in the current physical memory, the memory change status refers to a memory use change condition in a period, a period can be set according to an actual condition, the memory dump condition is a size of a memory dump generated recently, and the period can also be set according to an actual condition, and specific status index conditions/values need to be determined according to the actual condition, which is not limited in this embodiment.
In a specific implementation, according to system configuration and state indexes, a current scene is determined, and then a target reserved memory and a target reserved memory configuration mode corresponding to the current scene are determined.
Step S20: and when the effective reserved memory does not accord with the target reserved memory, determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy.
It should be understood that the validation reserve memory refers to a reserve memory that is currently validated, i.e., an actual reserve memory, and if the validation reserve memory is 0, the reserve memory may be considered to be not validated, and if the validation reserve memory is greater than 0, the reserve memory may be considered to be validated. And if the effective reserved memory does not accord with the target reserved memory, the effective reserved memory is not equal to the target reserved memory, and the reserved memory is considered to be not in optimal configuration at the moment, if the effective reserved memory accords with the target reserved memory, the effective reserved memory is equal to the target reserved memory, and the reserved memory is considered to be in optimal configuration at the moment.
It should be noted that, when the reserved memory is in the optimal configuration, the reserved memory does not need to be optimized, and when the reserved memory is not in the optimal configuration, the demands of different scenes on the reserved memory are different, for example: if the operation of adjusting the reserved memory needs to restart the system under the condition of sufficient memory resources, the reserved memory may not be optimized to reduce the influence, so that the configuration mode of the reserved memory in the current scene needs to be further confirmed to determine whether the reserved memory needs to be optimized currently.
In specific implementation, firstly, whether the currently effective reserved memory is in the optimal configuration is judged, and when the reserved memory is not in the optimal configuration, whether the reserved memory needs to be optimized is further judged according to a target reserved memory configuration strategy in the current scene.
Step S30: and when the reserved memory needs to be optimized, adjusting the effective reserved memory according to the target reserved memory.
In a specific implementation, if it is determined that the reserved memory needs to be optimized according to the target reserved memory configuration policy in the current scenario, configuring parameters related to kdump in the system startup item, and adjusting the reserved memory according to the target reserved memory in the current scenario, that is, adjusting the reserved memory to the target reserved memory, so that the reserved memory reaches the optimal configuration, and obtaining the optimization.
Further, after the step S30, the method further includes: recording configuration decision information and obtaining a configuration result; analyzing the target reserved memory configuration strategy according to the configuration result, the configuration decision information and the current scene to obtain analysis data; and optimizing the target reserved memory configuration strategy according to the analysis data.
It will be appreciated that configuration decision information refers to specific operations performed in the reserved memory optimization process, such as: if the effective reserved memory is A and the target reserved memory is B, the configuration decision information is to adjust the reserved memory from A to B. The configuration result refers to the influence condition of the whole system after optimizing the reserved memory, and can be generally divided into positive influence and negative influence, and if the configuration result is negative influence, the current reserved memory configuration strategy needs to be further perfected. The analysis data is the result obtained by analyzing the current target reserved memory configuration strategy so as to optimize the target reserved memory configuration strategy in the current scene.
In a specific implementation, relevant information such as configuration decision information, configuration results and current scenes is collected, and a currently used target reserved memory configuration strategy is analyzed and optimized, so that the method can be applied more efficiently and reliably.
As shown in the overall flow chart of fig. 3, the configuration of the system is detected and status indexes are collected, then a configuration policy (which can be customized and optimized according to the application scenario) is determined, then a suitable kdump reserved memory size is determined according to the configuration and policy, parameters related to kdump in a system start item are configured, configuration decisions and configuration changes are recorded in a related log, and finally information such as configuration items, status indexes, configuration decision processes and results is collected for centralized management and analysis.
In this embodiment, according to the current scenario, a target reserved memory and a target reserved memory configuration policy are determined, when the effective reserved memory does not conform to the target reserved memory, whether the reserved memory needs to be optimized is determined according to the target reserved memory configuration policy, and when the reserved memory needs to be optimized, the effective reserved memory is adjusted according to the target reserved memory. Compared with the traditional memory reservation configuration method which adopts static configuration, the optimal configuration in different scenes can not be realized, the embodiment intelligently determines and adjusts the size of the kdump reserved memory according to different application scenes and use requirements and by combining the actual physical memory and the current available memory of the system, the self-adaptive configuration of the kdump reserved memory is realized, the personalized requirement is met, the memory utilization rate is improved as much as possible on the premise of ensuring the availability of the kdump function, and therefore the optimal performance of the system is realized, and the reliability and stability of the system are improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a second embodiment of a reserved memory adaptive configuration method according to the present invention.
Based on the above embodiment, the step S10 includes:
step S101: and determining the target reserved memory according to the current scene and the current physical memory.
It should be noted that, the size of the reserved memory is related to the current physical memory, and the appropriate reserved memory size is determined according to the total amount of the current physical memory, so that the reserved memory size can be adjusted accordingly when the physical memory size is changed.
Further, the step S101 includes: acquiring a first corresponding relation between a current physical memory and an additional memory; determining an additional memory according to the current physical memory and the first corresponding relation; acquiring a second corresponding relation among the initial memory, the additional memory and the initial reserved memory; determining an initial reserved memory according to the initial memory, the additional memory and the second corresponding relation; determining a third corresponding relation between the initial reserved memory and the target reserved memory according to the current scene; and obtaining the target reserved memory according to the corresponding relation between the initial reserved memory and the third corresponding relation.
It may be understood that, the additional memory refers to the additional required reserved memory determined according to the current physical memory in this embodiment, the initial memory is the required basic reserved memory, usually 160M, and the initial reserved memory is the appropriate reserved memory corresponding to the current physical memory, and the second corresponding relationship is a calculation relation of the initial reserved memory, that is: initial reserved memory=initial memory+additional memory, the first correspondence refers to a calculation relation of additional memory, namely: extra memory= (current physical memory/4 KB) ×2bit, that is to say 2 bits of extra memory are required per 4KB of current physical memory, for example: if the current physical memory is 1TB, the required additional memory is 64M (1 tb=1024 gb=1024×1024×256×4KB,1024×1024×256×2 bit=1024×1024×64 bytes=1024×64 kb=64 MB), and the initial reserved memory is 224MB (160 mb+64mb).
It should be appreciated that the third correspondence, i.e. the calculated relation of the target reserve memory, is: target reserved memory=n×initial reserved memory, where n is a coefficient, and different coefficients may be set according to actual requirements, for example: higher versions of Linux kernels may require more dump space and correspondingly more reserved memory.
In a specific implementation, firstly, calculating an additional memory required under the current physical memory, adding the additional memory and the initial memory to obtain a proper reserved memory (initial reserved memory) under the current physical memory, and determining a calculation coefficient between the initial reserved memory and the target reserved memory according to the current scene on the basis to obtain a final target reserved memory.
Step S102: and determining the target reserved memory configuration strategy in a preset reserved memory configuration strategy according to the current scene, wherein the preset reserved memory configuration strategy at least comprises a reserved memory optimization strategy, a reserved memory difference optimization strategy and a reserved memory maintenance strategy.
It should be noted that, the preset configuration policy of the reserved memory is a preset configuration manner of the reserved memory, and at least includes a reserved memory optimization policy, a reserved memory difference optimization policy, and a reserved memory maintenance policy, and may also be other configuration policies of the reserved memory, which is not limited in this embodiment.
Further, the step S102 includes: when the current scene accords with a preset important scene, determining that the target reserved memory configuration strategy is a reserved memory optimization strategy; when the current scene accords with a preset common scene, determining that the target reserved memory configuration strategy is a reserved memory difference value optimization strategy; and when the current scene accords with a preset restarting scene, determining the target reserved memory configuration strategy as a reserved memory maintenance strategy.
It can be understood that the reserved memory optimization policy refers to a policy that optimizes reserved memory directly, and generally corresponding scenes are important business scenes and emergency scenes, that is, preset important scenes, for example: the configuration has problems, such as that the reserved memory cannot be validated/a memory resource bottleneck is caused, or the physical memory is reduced, but the number of reserved memories is not changed synchronously, so that the reserved memory is insufficient, a complete memory dump cannot be generated, or the database server has a kernel abnormality, etc., which can be set according to actual requirements, and the embodiment is not limited.
It should be understood that the reserved memory difference optimization policy refers to a policy for optimizing reserved memory according to a difference between a target reserved memory and an effective reserved memory, where a scenario generally corresponds to a non-important business scenario and a non-urgent scenario, for example: the physical memory is increased, but the reserved memory is not synchronously reduced, so that memory resource is wasted, or the web server has abnormal kernel, etc., which can be set according to actual requirements, and the embodiment is not limited to this.
It should be noted that, the reserved memory maintenance policy refers to a policy that the reserved memory is not adjusted, and generally corresponds to a scenario in which the reserved memory is not needed/not needed to be adjusted, for example: the preset restart scenario, that is, the condition that the reserved memory needs to restart the system when the memory resource is sufficient, may be other scenarios, and the embodiment does not limit this.
In a specific implementation, a policy corresponding to a current scene is found in a reserved memory optimization policy, a reserved memory difference optimization policy and a reserved memory maintenance policy, and the reserved memory is configured as a target reserved memory configuration policy, and is configured differently according to personalized requirements of different usage scenes so as to meet various requirements.
Further, the determining, according to the target reserved memory configuration policy, whether the reserved memory needs to be optimized includes: when the target reserved memory allocation policy is the reserved memory optimization policy, determining that reserved memory needs to be optimized; when the target reserved memory allocation policy is the reserved memory difference optimization policy, determining a reserved memory difference according to the effective reserved memory and the target reserved memory, and when the reserved memory difference is greater than a preset difference threshold, determining that the reserved memory needs to be optimized; and when the target reserved memory configuration strategy is the reserved memory maintenance strategy, determining that the reserved memory does not need to be optimized.
It can be understood that the target reserved memory configuration policy in this embodiment may be a reserved memory optimization policy, a reserved memory difference optimization policy, and a reserved memory maintenance policy, and specific configurations of different policies are different. If the target reserved memory configuration policy is the reserved memory optimization policy, it is considered that the reserved memory is optimized at this time, that is, the reserved memory needs to be optimized, and the reserved memory is directly optimized, so that step S30 is executed. If the target reserved memory configuration policy is a reserved memory difference optimization policy, whether optimization is required is determined according to a difference between the target reserved memory and the effective reserved memory, the reserved memory difference is a difference between the target reserved memory and the effective reserved memory, the preset difference threshold is a set difference threshold, when the reserved memory difference is greater than the preset difference threshold, the reserved memory is considered to be optimized, that is, the reserved memory is required to be optimized, and step S30 is executed, when the reserved memory difference is less than or equal to the preset difference threshold, the reserved memory is considered to be optimized, that is, the reserved memory is not required to be optimized. If the target reserved memory allocation policy is a reserved memory maintenance policy, it is considered that optimizing the reserved memory is unnecessary at this time, that is, the reserved memory does not need to be optimized.
In a specific implementation, according to a corresponding target reserved memory configuration strategy in the current scene, judging whether the reserved memory is necessary to be optimized, if necessary, optimizing the reserved memory to achieve the optimal configuration, and if not, not adjusting the reserved memory.
In this embodiment, a target reserved memory is determined according to a current scene and a current physical memory; according to the current scene, determining a target reserved memory configuration strategy in a preset reserved memory configuration strategy, wherein the preset reserved memory configuration strategy at least comprises a reserved memory optimization strategy, a reserved memory difference optimization strategy and a reserved memory maintenance strategy. According to different application scenes and use requirements, the embodiment intelligently determines proper reserved memory and corresponding reserved memory configuration strategies according to the actual physical memory of the system, achieves self-adaptive configuration of the kdump reserved memory, meets personalized requirements, improves the memory utilization rate as much as possible on the premise of guaranteeing the usability of the kdump function, and therefore achieves optimal performance of the system and improves the reliability and stability of the system.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium is stored with a reserved memory self-adaptive configuration program, and the reserved memory self-adaptive configuration program realizes the steps of the reserved memory self-adaptive configuration method when being executed by a processor.
Referring to fig. 5, fig. 5 is a block diagram illustrating a first embodiment of a reserved memory adaptive configuration device according to the present invention.
As shown in fig. 5, the reserved memory adaptive configuration device according to the embodiment of the present invention includes:
the policy module 10 is configured to determine the target reserved memory and the target reserved memory configuration policy according to the current scenario.
And the configuration module 20 is configured to determine whether to optimize the reserved memory according to the target reserved memory configuration policy when the effective reserved memory does not conform to the target reserved memory.
The configuration module 20 is further configured to adjust the effective reserved memory according to the target reserved memory when the reserved memory needs to be optimized.
In this embodiment, according to the current scenario, a target reserved memory and a target reserved memory configuration policy are determined, when the effective reserved memory does not conform to the target reserved memory, whether the reserved memory needs to be optimized is determined according to the target reserved memory configuration policy, and when the reserved memory needs to be optimized, the effective reserved memory is adjusted according to the target reserved memory. Compared with the traditional memory reservation configuration method which adopts static configuration, the optimal configuration in different scenes can not be realized, the embodiment intelligently determines and adjusts the size of the kdump reserved memory according to different application scenes and use requirements and by combining the actual physical memory and the current available memory of the system, the self-adaptive configuration of the kdump reserved memory is realized, the personalized requirement is met, the memory utilization rate is improved as much as possible on the premise of ensuring the availability of the kdump function, and therefore the optimal performance of the system is realized, and the reliability and stability of the system are improved.
In an embodiment, the policy module 10 is further configured to determine the target reserved memory according to the current scene and the current physical memory;
and determining the target reserved memory configuration strategy in a preset reserved memory configuration strategy according to the current scene, wherein the preset reserved memory configuration strategy at least comprises a reserved memory optimization strategy, a reserved memory difference optimization strategy and a reserved memory maintenance strategy.
In an embodiment, the policy module 10 is further configured to obtain a first correspondence between the current physical memory and the additional memory;
determining an additional memory according to the current physical memory and the first corresponding relation;
acquiring a second corresponding relation among the initial memory, the additional memory and the initial reserved memory;
determining an initial reserved memory according to the initial memory, the additional memory and the second corresponding relation;
determining a third corresponding relation between the initial reserved memory and the target reserved memory according to the current scene;
and obtaining the target reserved memory according to the corresponding relation between the initial reserved memory and the third corresponding relation.
In an embodiment, the policy module 10 is further configured to determine that the target reserved memory configuration policy is a reserved memory optimization policy when the current scene meets a preset important scene;
when the current scene accords with a preset common scene, determining that the target reserved memory configuration strategy is a reserved memory difference value optimization strategy;
and when the current scene accords with a preset restarting scene, determining the target reserved memory configuration strategy as a reserved memory maintenance strategy.
In an embodiment, the configuration module 20 is further configured to determine that the reserved memory needs to be optimized when the target reserved memory configuration policy is the reserved memory optimization policy;
when the target reserved memory allocation policy is the reserved memory difference optimization policy, determining a reserved memory difference according to the effective reserved memory and the target reserved memory, and when the reserved memory difference is greater than a preset difference threshold, determining that the reserved memory needs to be optimized;
and when the target reserved memory configuration strategy is the reserved memory maintenance strategy, determining that the reserved memory does not need to be optimized.
In an embodiment, the policy module 10 is further configured to obtain a system configuration and a status indicator, where the system configuration at least includes a server type, a CPU architecture, a number of CPUs, a number of physical memories, an operating system version, a kernel version, an application process, and the effective reserved memory, and the status indicator at least includes a current physical memory, a current available memory, a ratio of available memory, a memory change status, and a memory dump condition;
and determining the current scene according to the system configuration and the state index.
In an embodiment, the reserved memory adaptive configuration device further includes:
a management module 30, configured to record configuration decision information and obtain a configuration result;
analyzing the target reserved memory configuration strategy according to the configuration result, the configuration decision information and the current scene to obtain analysis data;
and optimizing the target reserved memory configuration strategy according to the analysis data.
It should be understood that the foregoing is illustrative only and is not limiting, and that in specific applications, those skilled in the art may set the invention as desired, and the invention is not limited thereto.
It should be noted that the above-described working procedure is merely illustrative, and does not limit the scope of the present invention, and in practical application, a person skilled in the art may select part or all of them according to actual needs to achieve the purpose of the embodiment, which is not limited herein.
In addition, technical details not described in detail in this embodiment may refer to the reserved memory adaptive configuration method provided in any embodiment of the present invention, which is not described herein.
Furthermore, 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 invention 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 invention 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. Read Only Memory)/RAM, magnetic disk, optical disk) and including several 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 invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, 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 reserved memory self-adaptive configuration method is characterized by comprising the following steps of:
determining a target reserved memory and a target reserved memory configuration strategy according to the current scene;
when the effective reserved memory does not accord with the target reserved memory, determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy;
and when the reserved memory needs to be optimized, adjusting the effective reserved memory according to the target reserved memory.
2. The method of claim 1, wherein determining the target reserved memory and the target reserved memory configuration policy according to the current scenario comprises:
determining the target reserved memory according to the current scene and the current physical memory;
and determining the target reserved memory configuration strategy in a preset reserved memory configuration strategy according to the current scene, wherein the preset reserved memory configuration strategy at least comprises a reserved memory optimization strategy, a reserved memory difference optimization strategy and a reserved memory maintenance strategy.
3. The method of claim 2, wherein the determining the target reserve memory based on the current scene and a current physical memory comprises:
acquiring a first corresponding relation between a current physical memory and an additional memory;
determining an additional memory according to the current physical memory and the first corresponding relation;
acquiring a second corresponding relation among the initial memory, the additional memory and the initial reserved memory;
determining an initial reserved memory according to the initial memory, the additional memory and the second corresponding relation;
determining a third corresponding relation between the initial reserved memory and the target reserved memory according to the current scene;
and obtaining the target reserved memory according to the corresponding relation between the initial reserved memory and the third corresponding relation.
4. The method of claim 2, wherein determining the target reserved memory allocation policy from among preset reserved memory allocation policies according to the current scenario comprises:
when the current scene accords with a preset important scene, determining that the target reserved memory configuration strategy is a reserved memory optimization strategy;
when the current scene accords with a preset common scene, determining that the target reserved memory configuration strategy is a reserved memory difference value optimization strategy;
and when the current scene accords with a preset restarting scene, determining the target reserved memory configuration strategy as a reserved memory maintenance strategy.
5. The method of claim 2, wherein determining whether reservation memory needs to be optimized according to the target reservation memory configuration policy comprises:
when the target reserved memory allocation policy is the reserved memory optimization policy, determining that reserved memory needs to be optimized;
when the target reserved memory allocation policy is the reserved memory difference optimization policy, determining a reserved memory difference according to the effective reserved memory and the target reserved memory, and when the reserved memory difference is greater than a preset difference threshold, determining that the reserved memory needs to be optimized;
and when the target reserved memory configuration strategy is the reserved memory maintenance strategy, determining that the reserved memory does not need to be optimized.
6. The method of claim 2, wherein the reserve memory adaptive configuration method further comprises:
recording configuration decision information and obtaining a configuration result;
analyzing the target reserved memory configuration strategy according to the configuration result, the configuration decision information and the current scene to obtain analysis data;
and optimizing the target reserved memory configuration strategy according to the analysis data.
7. The method according to any one of claims 1 to 6, wherein before determining the target reserved memory and the target reserved memory configuration policy according to the current scenario, the method further comprises:
acquiring system configuration and state indexes, wherein the system configuration at least comprises a server type, a CPU architecture, the number of CPUs, the number of physical memories, an operating system version, a kernel version, an application process and the effective reserved memory, and the state indexes at least comprise a current physical memory, a current available memory, an available memory proportion, a memory change state and a memory dump condition;
and determining the current scene according to the system configuration and the state index.
8. A reserved memory adaptive configuration device, the reserved memory adaptive configuration device comprising:
the strategy module is used for determining a target reserved memory and a target reserved memory configuration strategy according to the current scene;
the configuration module is used for determining whether the reserved memory needs to be optimized according to the target reserved memory configuration strategy when the effective reserved memory does not accord with the target reserved memory;
the configuration module is further configured to adjust the effective reserved memory according to the target reserved memory when the reserved memory needs to be optimized.
9. A reserved memory adaptive configuration device, the device comprising: a memory, a processor and a reserve memory adaptive configuration program stored on the memory and executable on the processor, the reserve memory adaptive configuration program configured to implement the steps of the reserve memory adaptive configuration method of any one of claims 1 to 7.
10. A storage medium having stored thereon a reserve memory adaptive configuration program which, when executed by a processor, implements the steps of the reserve memory adaptive configuration method of any of claims 1 to 7.
CN202310964762.2A 2023-08-01 2023-08-01 Reserved memory self-adaptive configuration method, device, equipment and storage medium Pending CN116991582A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310964762.2A CN116991582A (en) 2023-08-01 2023-08-01 Reserved memory self-adaptive configuration method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310964762.2A CN116991582A (en) 2023-08-01 2023-08-01 Reserved memory self-adaptive configuration method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116991582A true CN116991582A (en) 2023-11-03

Family

ID=88533407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310964762.2A Pending CN116991582A (en) 2023-08-01 2023-08-01 Reserved memory self-adaptive configuration method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116991582A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118519783A (en) * 2024-07-19 2024-08-20 浙江大华技术股份有限公司 Core dump method and device based on embedded equipment and computer equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118519783A (en) * 2024-07-19 2024-08-20 浙江大华技术股份有限公司 Core dump method and device based on embedded equipment and computer equipment
CN118519783B (en) * 2024-07-19 2024-10-11 浙江大华技术股份有限公司 Core dump method and device based on embedded equipment and computer equipment

Similar Documents

Publication Publication Date Title
US10277525B2 (en) Method and apparatus for disaggregated overlays via application services profiles
US7676699B2 (en) Event trace conditional logging
US9003239B2 (en) Monitoring and resolving deadlocks, contention, runaway CPU and other virtual machine production issues
US8521986B2 (en) Allocating storage memory based on future file size or use estimates
AU2011213795A1 (en) Efficient cache reuse through application determined scheduling
US20170206011A1 (en) Enhancing performance-cost ratio of a primary storage adaptive data reduction system
CN116991582A (en) Reserved memory self-adaptive configuration method, device, equipment and storage medium
CN107402863B (en) Method and equipment for processing logs of service system through log system
US11500577B2 (en) Method, electronic device, and computer program product for data processing
CN110427258A (en) Scheduling of resource control method and device based on cloud platform
CN110347546B (en) Dynamic adjustment method, device, medium and electronic equipment for monitoring task
CN117555732A (en) CPU utilization monitoring method, device, equipment and storage medium
US11561843B2 (en) Automated performance tuning using workload profiling in a distributed computing environment
CN114253662A (en) Method, device, equipment and medium for dynamically migrating virtual machines
CN115271861A (en) Request filtering method, device, equipment and storage medium
US10992517B1 (en) Dynamic distributed execution budget management system
CN111090627B (en) Log storage method and device based on pooling, computer equipment and storage medium
US11770411B2 (en) Prioritize endpoint selection based on criteria
CN107273188B (en) Virtual machine Central Processing Unit (CPU) binding method and device
CN112948118A (en) Edge calculation method, platform, computer device and readable storage medium
CN111459634A (en) Task scheduling method, device, terminal and storage medium
CN111143134A (en) Fault processing method, equipment and computer storage medium
CN113806011B (en) Cluster resource control method and device, cluster and computer readable storage medium
CN112306901B (en) Disk refreshing method and device based on layered storage system, electronic equipment and medium
US11520638B1 (en) Combined active and preinitialized resource management for rapid autoscaling

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