Big data job scheduling method and system based on memory health degree and storage medium

By calculating memory health and setting multi-level scheduling strategies, the problem of unreasonable scheduling of big data jobs was solved, and the stability and efficiency of system operation were improved.

CN117009056BActive Publication Date: 2026-11-20贝联珠贯科技(浙江)有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310958789.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-01
Publication Date
2026-11-20
Estimated Expiration
2043-08-01

AI Technical Summary

Technical Problem

Existing big data job scheduling systems fail to accurately grasp the memory status of job nodes, leading to unreasonable scheduling, which may result in system deterioration and crashes.

Method used

By calculating memory health, taking into account available memory, memory fragmentation index, and memory contention index, a health level is set and corresponding scheduling strategies are executed, including job scheduling and handling schemes for normal state, first-level alarm state, second-level alarm state, and third-level alarm state.

Benefits of technology

It achieves more reasonable job scheduling, improves the efficiency of big data job processing, avoids the system frequently entering a state of insufficient memory, and reduces system downtime.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009056B_ABST
    Figure CN117009056B_ABST
Patent Text Reader

Abstract

The present application relates to big data job processing technical field, specifically to a kind of big data job scheduling method, system and storage medium based on memory health degree, the method includes: job node receives the health degree level division setting of memory, receives job scheduling treatment scheme;Job node respectively periodically executes the following steps: the available memory amount is counted, and memory fragmentation index is calculated and obtained;Statistical process pause event, and memory competition index is calculated and obtained;Available memory amount, memory fragmentation index and memory competition index are calculated to obtain the health degree of memory;The health degree level of memory in current cycle is obtained;If health degree level changes, then the changed health degree level is sent to job management node, and corresponding job scheduling treatment scheme is executed.The beneficial technical effects of the present application include: available memory amount, memory fragmentation index and memory competition index are used to obtain the health degree of memory in multiple dimensions, and big data job is more reasonably scheduled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data job processing technology, specifically to a big data job scheduling method, system, and storage medium based on memory health. Background Technology

[0002] Memory, as a resource in a computer system, is essential for program execution. Current mainstream system cluster management software considers memory as a crucial factor when deciding whether to schedule a job to run on a specific machine within the cluster. The overall technical solution involves monitoring the remaining memory on each machine, estimating the amount of memory a job will consume, and then using this as a benchmark, combined with empirical algorithms, to decide whether to schedule the job onto a specific machine.

[0003] This approach has the following drawbacks:

[0004] 1. The indicator of remaining memory is singular and does not take into account factors such as memory contention intensity and memory fragmentation index.

[0005] 2. The job scheduling system lacks interaction with the operating system's memory module, and cannot detect and make timely decisions when the internal memory conditions deteriorate.

[0006] In situations where some machines experience severe fragmentation and intense memory contention, new jobs may still be scheduled onto those machines, leading to further deterioration of system performance and issues such as system crashes or freezes. Therefore, there is a need to research more reliable big data scheduling schemes that take memory considerations into account.

[0007] For example, Chinese patent CN105740068A, published on July 6, 2016, discloses a scheduling method and system based on memory data locality for big data platforms, relating to the field of distributed computing task scheduling for big data processing. This method includes periodically acquiring data blocks cached in the memory of data nodes and periodically reporting the memory data block information of data nodes to the storage management node; acquiring user-submitted jobs, with computing nodes sharding the jobs; when a computing node fills in job shard information, it writes the memory data block information into the job shard information; the computing node creates tasks to be executed based on the job shard information, makes resource request requests for the tasks to be executed, and allocates resource nodes to the tasks to be executed based on the resource request requests. This technical solution can accelerate the overall job execution speed and has significant practical implications for reducing job execution time. However, this technical solution still cannot solve the problem of memory idle indicators not matching the actual situation, leading to delays in actual job execution. Summary of the Invention

[0008] The technical problem this invention aims to solve is that current big data job scheduling suffers from inaccurate monitoring of job node memory status, leading to inefficient job scheduling. This invention proposes a big data job scheduling method, system, and storage medium based on memory health, which enables more rational scheduling of big data jobs and improves their processing efficiency.

[0009] To solve the above technical problems, the present invention adopts the following technical solution: a big data job scheduling method based on memory health, wherein the big data job is distributed by the job management node to the job node for execution, and the job node receives the memory health level classification setting and receives the job scheduling and handling scheme corresponding to the health level;

[0010] Each of the work nodes periodically executes the following steps:

[0011] The available memory amount is counted, and then the memory fragmentation index is calculated.

[0012] Collect process pause events and calculate the memory contention index based on these events.

[0013] The memory health status is calculated based on the available memory amount, the memory fragmentation index, and the memory contention index.

[0014] The current memory health status is compared with the set health status level to obtain the memory health status for the current period;

[0015] If the health level changes, the changed health level is sent to the job management node, and the corresponding job scheduling and handling plan is executed according to the changed health level.

[0016] Preferred methods for determining available memory include:

[0017] Iterate through all LRU lists from LRU_BASE to NR_LRU_LISTS-1, obtain the page status of each LRU list, and store it in a pre-built pages array;

[0018] Iterate through each memory management zone in the system and call the low_wmark_pages macro definition to calculate the low watermark of the current memory management zone.

[0019] The calculated number of pages for the low watermark marker low_wmark_pages is added to the preset wmark_low variable;

[0020] The number of cached pages is calculated using the following formula:

[0021] Number of cached pages = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE] - wmark_low;

[0022] To obtain the number of free pages, calculate the available memory using the following formula:

[0023] Available memory = number of free pages + number of cached pages.

[0024] Preferred methods for calculating the memory fragmentation index include:

[0025] Perform the following steps for each memory management zone in the system:

[0026] Enumerate the preset memory block sizes one by one and request memory accordingly;

[0027] By using the free_area linked list in the zone structure of the memory management area, the number of free memory blocks of the corresponding size can be obtained, and then the total number of pages and the number of contiguous spaces that can fill memory blocks of the same size can be calculated under the memory management area.

[0028] (The relationship between the number of memory pages and the number of memory blocks is: Number of pages = Number of memory blocks * Size of memory blocks);

[0029] The fragmentation index of each memory management zone is calculated using the following formula: Fragmentation index = (Total number of pages - Number of pages that can be filled) / Total number of pages;

[0030] If the recorded fragment index exceeds the set warning value, the excess will be added to the total fragment index.

[0031] The fragmentation index is calculated using the following formula: Fragmentation Index = Total Fragmentation Index / Number of Memory Management Zones.

[0032] During execution, skip the DMA and DMA32 regions, and enumerate different memory block sizes in turn. The recommended memory block size is 2 to the power of i.

[0033] Preferred methods for calculating the memory contention index include:

[0034] By using the vm_all_events function interface exposed by the system, all memory events in the system within the period can be obtained, and preset events of interest can be filtered out.

[0035] The event competition index is calculated based on the transformation amount of each event of interest and the pre-configured weighting factors. The specific calculation formula is as follows:

[0036] Event Competition Index = (Current Value of Event of Interest - Original Value of Event of Interest) * Weighting Factor;

[0037] The event contention indices of all events of interest are summed up to form the memory contention index.

[0038] Preferably, the events of interest include one or more of the following: ALLOCSTALL, PGSCAN_KSWAPD, PGSCAN_DIRECT, PAGEOUTRU, KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, COMPACTSTALL, and COMPACTFAIL. The following events trigger memory reclamation: ALLOCSTALL event: Memory page allocation triggers direct reclamation. PGSCAN_KSWAPD event: When memory is insufficient, the kernel periodically scans memory pages and reclaims unused pages. PGSCAN_DIRECT event: When system memory is insufficient, the kernel actively notifies relevant threads to perform memory reclamation. PAGEOUTRU event: When memory usage exceeds a certain threshold, the kernel starts the pageout thread to reclaim some unused pages. KSWAPD_LOW_WMARK_HIT_QUICKLY event: After kswapd performs reclamation once, it needs to be executed again because memory is below lowwmark. KSWAPD_HIGH_WMARK_HIT_QUICKLY event: After kswapd performs reclamation once, it needs to be executed again because memory is below highwmark. COMPACTSTALL event: Memory page allocation triggers memory compaction. COMPACTFAIL event: Memory compaction fails.

[0039] Preferably, the health level classification includes several health levels and corresponding health ranges, and the health level corresponding to the health range into which the memory's health falls is used as the memory's health level.

[0040] As a preferred method, the method for calculating memory health includes the following steps:

[0041] Obtain system memory pressure control parameters, including mild pressure threshold, normal memory usage threshold, and severe pressure threshold;

[0042] Calculate warning points, where the value of a warning point is the average of the mild pressure threshold and the severe pressure threshold in the pressure control parameters;

[0043] The baseline is calculated based on the current available memory size of the system and the normal memory usage threshold in the stress control parameters;

[0044] The smaller value between the baseline point and the warning point will be used as the final baseline score;

[0045] Memory health is calculated using the following formula: Memory health = Baseline score - Memory fragmentation index - Memory contention index.

[0046] Preferably, the health status levels include: normal state, first-level alarm state, second-level alarm state, and third-level alarm state.

[0047] The task scheduling and handling plan includes:

[0048] Under normal circumstances, the job node receives tasks scheduled by the management node;

[0049] In the first-level alarm state, the work node sends a corresponding signal to the management node to notify the management node to stop scheduling to it;

[0050] When the alarm status escalates from Level 1 to Level 2, the job node sends a corresponding signal to the management node, and at the same time, the corresponding job node evicts the low-priority job.

[0051] In the third-level alarm state, the kernel module of the corresponding job node actively kills the job process;

[0052] When the alarm status drops from Level 2 to Level 1, the job node sends a corresponding signal to the management node to resume job scheduling.

[0053] A computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the aforementioned big data job scheduling method based on memory health.

[0054] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned big data job scheduling method based on memory health.

[0055] The beneficial technical effects of this invention include: obtaining memory health by comprehensively calculating multiple dimensions such as available memory, memory fragmentation index, and memory contention index, enabling more reasonable scheduling of big data jobs; avoiding the problem that the availability of system memory cannot be accurately judged based solely on the remaining memory; the health level is divided into three alarm levels, which not only ensures the full utilization of memory resources but also retains sufficient buffer to prevent the system from frequently entering a state of insufficient memory and killing processes; in the third-level alarm state, by proactively killing processes in advance, the system is prevented from entering a state of repeated file cache reclamation and falling into an infinite loop, resulting in a significant reduction in system downtime.

[0056] Other features and advantages of the present invention will be disclosed in detail in the following detailed description and accompanying drawings. Attached Figure Description

[0057] The invention will be further described below with reference to the accompanying drawings:

[0058] Figure 1 This is a schematic diagram of a big data job scheduling system applied in an embodiment of the present invention.

[0059] Figure 2 This is a schematic diagram of the big data job scheduling method according to an embodiment of the present invention.

[0060] Figure 3 This is a schematic diagram of the method for calculating the amount of available memory in an embodiment of the present invention.

[0061] Figure 4 This is a schematic diagram of the method for calculating the memory fragmentation index according to an embodiment of the present invention.

[0062] Figure 5 This is a schematic diagram of the method for calculating the memory contention index according to an embodiment of the present invention.

[0063] Figure 6 This is a schematic diagram of the method for calculating memory health according to an embodiment of the present invention.

[0064] Figure 7 This is a schematic diagram of the job scheduling and handling scheme in an embodiment of the present invention.

[0065] Among them: 10, job management node, 20, job node. Detailed Implementation

[0066] The technical solutions of the embodiments of the present invention will be explained and described below with reference to the accompanying drawings. However, the following embodiments are only preferred embodiments of the present invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments in the implementation methods without creative effort are all within the protection scope of the present invention.

[0067] In the following description, terms such as “inner,” “outer,” “upper,” “lower,” “left,” and “right” are used only to indicate orientation or positional relationship for the convenience of describing the embodiments and simplifying the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.

[0068] Before introducing the technical solution of this embodiment, the LRU technology involved in this embodiment will be introduced.

[0069] Current operating systems all employ strategies that support automatic memory reclamation. When memory is insufficient, the system must reclaim some pages. Selecting the correct pages for reclamation can free up memory space and improve system speed. Conversely, selecting the wrong pages can burden the system and slow it down. To determine which pages to reclaim, Linux uses the LRU (Last Recent Use) list to prioritize reclaiming memory that has not been accessed for the longest time. The LRU list is crucial for memory reclamation; in fact, the entire process of memory reclamation essentially involves shrinking the LRU list. To minimize performance impact, the system categorizes memory pages added to the LRU list as active or inactive, reclaiming memory from the inactive list. Pages that have been recently accessed are considered active, while those that haven't been accessed recently are considered inactive. There are five LRU lists:

[0070] LRU_INACTIVE_ANON = LRU_BASE, an inactive anonymous linked list;

[0071] LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, active anonymous linked list;

[0072] LRU_INACTIVE_FILE=LRU_BASE+LRU_FILE, inactive file;

[0073] LRU_ACTIVE_FILE=LRU_BASE+LRU_FILE+LRU_ACTIVE, active file;

[0074] LRU_UNEVICTABLE, unreclaimable memory.

[0075] In older versions, each memory management zone had its own independent LRU list. In the new version, each node establishes its own LRU list. Pages can be added to the LRU list and move between the active and inactive lists based on certain conditions.

[0076] Memory management is a complex task that significantly impacts system efficiency. When a system with insufficient memory continues to schedule more tasks, memory management becomes significantly more strained, leading to a marked deterioration in system performance. Current big data task scheduling systems only consider the remaining memory capacity of job node 20, failing to effectively reflect the system's memory status. This can result in big data jobs being scheduled onto job node 20, which has remaining memory but suffers from severely degraded memory management, causing a significant drop in job node 20's performance and hindering the execution of big data jobs. Therefore, it is necessary to research more effective big data job scheduling schemes that take memory scheduling into account.

[0077] For a big data job scheduling method based on memory health, please refer to the appendix. Figure 1 The big data job is distributed from job management node 10 to job nodes 20 for execution. One job management node 10 connects to multiple job nodes 20. The job management node 10 breaks down the big data task into multiple smaller jobs and distributes these jobs to the job nodes 20 for execution. The job nodes 20 feed back the execution results to the job management node 10. After summing the execution results of all jobs, the result of the big data job is obtained. The big data job scheduling method provided in this embodiment includes: job nodes 20 receiving the health level classification settings of the memory and receiving the job scheduling and handling scheme corresponding to the health level. Please refer to the appendix. Figure 2 Each of the 20 job nodes periodically executes the following steps:

[0078] Step A01) Calculate the available memory amount and then calculate the memory fragmentation index;

[0079] Step A02) Collect process pause events and calculate the memory contention index based on the process pause events;

[0080] Step A03) Calculate the memory health status based on the available memory, memory fragmentation index, and memory contention index;

[0081] Step A04) Compare the current memory health status with the set health status level to obtain the memory health status level within the current period;

[0082] Step A05) If the health level changes, the changed health level is sent to the job management node 10, and the corresponding job scheduling and handling plan is executed according to the changed health level.

[0083] Please see the appendix Figure 3 Methods for calculating available memory include:

[0084] Step B01) Traverse all LRU lists from LRU_BASE to NR_LRU_LISTS-1, obtain the page status of each LRU list, and store it in the pre-established pages array;

[0085] Step B02) Traverse each memory management zone in the system and call the low_wmark_pages macro definition to calculate the low watermark of the current memory management zone.

[0086] Step B03) Add the calculated number of pages of the low watermark low_wmark_pages to the preset wmark_low variable;

[0087] Step B04) Calculate the number of cached pages using the following formula: Number of cached pages = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE] - wmark_low;

[0088] Step B05) Obtain the number of free pages and calculate the available memory using the following formula: Available memory = Number of free pages + Number of cached pages.

[0089] Please see the appendix Figure 4 Methods for calculating the memory fragmentation index include:

[0090] Step C01) Perform the following steps for each memory management zone in the system:

[0091] Step C02) Enumerate the preset memory block sizes in sequence and request memory;

[0092] Step C03) Obtain the number of free memory blocks of the corresponding size through the free_area linked list in the zone structure of the memory management area, and then count the total number of pages and the number of contiguous spaces that can fill memory blocks of the same size under the memory management area.

[0093] Step C04) Calculate the fragmentation index of each memory management zone using the following formula: Fragmentation index = (Total number of pages - Number of pages that can be filled) / Total number of pages;

[0094] Step C05) If the recorded fragment index exceeds the set warning value, the excess portion will be added to the total fragment index;

[0095] Step C06) Calculate the fragmentation index using the following formula: Fragmentation Index = Total Fragmentation Index / Number of Memory Management Zones.

[0096] The relationship between the number of memory pages and the number of memory blocks is: Number of pages = Number of memory blocks * Memory block size. During execution, DMA and DMA32 regions must also be skipped. When enumerating different memory block sizes, a memory block size of 2 to the power of i is recommended.

[0097] Please see the appendix Figure 5 Methods for calculating the memory contention index include:

[0098] Step D01) Obtain all memory events in the system within the period and filter out the preset events of interest;

[0099] Step D02) Calculate the event competition index based on the transformation amount of each event of interest and the pre-configured weight factor. The specific calculation formula is: Event Competition Index = (Current Value of Event of Interest - Original Value of Event of Interest) * Weight Factor;

[0100] Step D03) Sum the event contention indices of all events of interest to obtain the memory contention index.

[0101] Memory events are obtained through the vm_all_events function interface exposed by the system.

[0102] The events to be monitored include one or more of the following: ALLOCSTALL, PGSCAN_KSWAPD, PGSCAN_DIRECT, PAGEOUTRU, KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, COMPACTSTALL, and COMPACTFAIL. The following events trigger memory reclamation: ALLOCSTALL event: Memory page allocation triggers direct reclamation. PGSCAN_KSWAPD event: When memory is insufficient, the kernel periodically scans memory pages and reclaims unused pages. PGSCAN_DIRECT event: When system memory is insufficient, the kernel actively notifies relevant threads to perform memory reclamation. PAGEOUTRU event: When memory usage exceeds a certain threshold, the kernel starts the pageout thread to reclaim some unused pages. KSWAPD_LOW_WMARK_HIT_QUICKLY event: After kswapd performs reclamation once, it needs to be executed again because memory is below lowwmark. KSWAPD_HIGH_WMARK_HIT_QUICKLY event: After kswapd performs reclamation once, it needs to be executed again because memory is below highwmark. COMPACTSTALL event: Memory page allocation triggers memory compaction. COMPACTFAIL event: Memory compaction fails.

[0103] The health level classification includes several health levels and corresponding health ranges. The health level corresponding to the health range into which the memory's health falls is used as the memory's health level.

[0104] Please see the appendix Figure 6 The method for calculating memory health includes the following steps:

[0105] Step E01) Obtain system memory pressure control parameters, which include mild pressure threshold, normal memory usage threshold and severe pressure threshold;

[0106] Step E02) Calculate the warning point. The value of the warning point is the average of the mild pressure threshold and the severe pressure threshold in the pressure control parameters.

[0107] Step E03) Calculate the baseline point based on the current available memory size of the system and the normal memory usage threshold in the stress control parameters;

[0108] Step E04) The smaller value between the baseline point and the warning point is used as the final baseline score;

[0109] Step E05) Calculate the memory health score using the following formula: Memory Health Score = Baseline Score - Memory Fragmentation Index - Memory Contention Index.

[0110] Health status levels include: normal status, Level 1 alarm status, Level 2 alarm status, and Level 3 alarm status.

[0111] Please see the appendix Figure 7 The task scheduling and handling plan includes:

[0112] Step F01) Under normal conditions, job node 20 receives tasks scheduled by the management node;

[0113] In step F02) Under the first-level alarm state, the job node 20 sends a corresponding signal to the management node to notify the management node to stop scheduling to it;

[0114] Step F03) When the alarm status rises from the first level to the second level, the job node 20 sends a corresponding signal to the management node, and at the same time, the corresponding job node 20 evicts the low-priority job.

[0115] Step F04) In the third-level alarm state, the kernel module of the corresponding job node 20 actively kills the job process;

[0116] Step F05) When the alarm state drops from the second level to the first level, the job node 20 sends a corresponding signal to the management node to restore job scheduling.

[0117] On the other hand, embodiments of this application provide a computer system, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the method as described above.

[0118] The computer system can be a general-purpose computer system or a special-purpose computer system. In specific implementations, the computer system can be a server cluster including multiple servers, such as a blockchain system including multiple nodes. Those skilled in the art will understand that the embodiments described herein are merely examples of computer systems and do not constitute a limitation on the computer system. It may include more or fewer components than illustrated, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0119] The processor can be a Central Processing Unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0120] In some embodiments, the memory can be an internal storage unit of a computer system, such as a hard drive or RAM. In other embodiments, the memory can be an external storage device of the computer system, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal and external storage units. The memory is used to store the operating system, applications, boot loader, data, and other programs. The memory can also be used to temporarily store data that has been output or will be output.

[0121] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method as described above.

[0122] The beneficial technical effects of this invention include: obtaining memory health by comprehensively calculating multiple dimensions such as available memory, memory fragmentation index, and memory contention index, enabling more reasonable scheduling of big data jobs; avoiding the problem that the availability of system memory cannot be accurately judged based solely on the remaining memory; the health level is divided into three alarm levels, which not only ensures the full utilization of memory resources but also retains sufficient buffer to prevent the system from frequently entering a state of insufficient memory and killing processes; in the third-level alarm state, by proactively killing processes in advance, the system is prevented from entering a state of repeated file cache reclamation and falling into an infinite loop, resulting in a significant reduction in system downtime.

[0123] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.

Claims

1. A big data job scheduling method based on memory health, wherein the big data job is distributed from the job management node to the job node for execution, characterized in that, The job node receives the health level classification settings of the memory and receives the job scheduling and handling scheme corresponding to the health level; Each of the work nodes periodically executes the following steps: The available memory amount is counted, and then the memory fragmentation index is calculated. Collect process pause events and calculate the memory contention index based on these events. The memory health status is calculated based on the available memory amount, the memory fragmentation index, and the memory contention index. The current memory health status is compared with the set health status level to obtain the memory health status for the current period. If the health level changes, the changed health level is sent to the job management node, and the corresponding job scheduling and handling plan is executed according to the changed health level. Methods for calculating the memory fragmentation index include: Perform the following steps for each memory management zone in the system: Enumerate the preset memory block sizes one by one and request memory accordingly; By using the free_area linked list in the zone structure of the memory management area, the number of free memory blocks of the corresponding size can be obtained, and then the total number of pages and the number of contiguous spaces that can fill memory blocks of the same size can be calculated under the memory management area. The fragmentation index of each memory management zone is calculated using the following formula: Fragmentation index = (Total number of pages - Number of pages that can be filled) / Total number of pages; If the recorded fragment index exceeds the set warning value, the excess will be added to the total fragment index. The fragmentation index is calculated using the following formula: Fragmentation Index = Total Fragmentation Index / Number of Memory Management Zones; Methods for calculating the memory contention index include: Retrieve all memory events in the system within the period and filter out the preset events of interest; The event competition index is calculated based on the transformation amount of each event of interest and the pre-configured weighting factors. The specific calculation formula is as follows: Event Competition Index = (Current Value of Event of Interest - Original Value of Event of Interest) * Weighting Factor; The event contention indices of all the events of interest are summed up to form the memory contention index; The method for calculating memory health includes the following steps: Obtain system memory pressure control parameters, including mild pressure threshold, normal memory usage threshold, and severe pressure threshold; Calculate warning points, where the value of a warning point is the average of the mild pressure threshold and the severe pressure threshold in the pressure control parameters; The baseline is calculated based on the current available memory size of the system and the normal memory usage threshold in the stress control parameters; The smaller value between the baseline point and the warning point will be used as the final baseline score; Memory health is calculated using the following formula: Memory health = Baseline score - Memory fragmentation index - Memory contention index.

2. The big data job scheduling method based on memory health according to claim 1, characterized in that, Methods for calculating available memory include: Iterate through all LRU lists from LRU_BASE to NR_LRU_LISTS-1, obtain the page status of each LRU list, and store it in a pre-built pages array; Traverse each memory management zone in the system and calculate the low watermark_wmark_pages of the current memory management zone; The calculated number of pages for the low watermark marker low_wmark_pages is added to the preset wmark_low variable; The number of cached pages is calculated using the following formula: Number of cached pages = pages[LRU_ACTIVE_FILE] + pages[LRU_INACTIVE_FILE] - wmark_low; To obtain the number of free pages, calculate the available memory using the following formula: Available memory = number of free pages + number of cached pages.

3. The big data job scheduling method based on memory health according to claim 1, characterized in that, The events of interest include one or more of the following: ALLOCSTALL, PGSCAN_KSWAPD, PGSCAN_DIRECT, PAGEOUTRU, KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, COMPACTSTALL, and COMPACTFAIL.

4. The big data job scheduling method based on memory health according to claim 1, characterized in that, The health level classification includes several health levels and corresponding health ranges. The health level corresponding to the health range into which the memory's health falls is used as the memory's health level.

5. The big data job scheduling method based on memory health according to claim 1, characterized in that, The health status levels include: normal state, Level 1 alarm state, Level 2 alarm state, and Level 3 alarm state. The task scheduling and handling plan includes: Under normal circumstances, the job node receives tasks scheduled by the management node; In the first-level alarm state, the work node sends a corresponding signal to the management node to notify the management node to stop scheduling to it; When the alarm status escalates from Level 1 to Level 2, the job node sends a corresponding signal to the management node, and at the same time, the corresponding job node evicts the low-priority job. In the third-level alarm state, the kernel module of the corresponding job node actively kills the job process; When the alarm status drops from Level 2 to Level 1, the job node sends a corresponding signal to the management node to resume job scheduling.

6. A computer system, characterized in that, The computer system includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the big data job scheduling method based on memory health as described in any one of claims 1 to 5.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the big data job scheduling method based on memory health as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Big data platform oriented and memory data locality based scheduling method and system

    CN105740068A

  • Associating working sets and threads

    CN109923523A

  • Picture marking method and system in APP iteration process, and storage medium

    CN110968720A