Application server optimization method and system based on multi-subqueue concurrent scheduling
By creating multiple subqueries in the thread pool and binding the corresponding subqueries when the target thread acquires tasks, the problem of locking competition in the task queue under high concurrent thread pool is solved, and task scheduling efficiency and system performance are improved.
Patent Information
- Application Number
- CN202510429147.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-08
- Publication Date
- 2025-05-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In high concurrency, the task queue of the thread pool will grow rapidly, resulting in frequent locking of queue operations, seriously affecting system performance.
By creating an object thread containing multiple subqueues, and when the target thread starts to acquire tasks, select a subqueue from the object thread to bind it to the target thread, the target thread allows the target thread to perform tasks through the bound subqueue.
It reduces the competition between lock mechanisms between threads, improves the efficiency of task scheduling in high concurrency situations, reduces task scheduling delay, and enhances the expansion ability of thread pools.
Smart Images

Figure CN119938342A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of servers, and in particular to an application server optimization method, system, medium and electronic device based on multi-subqueue concurrent scheduling. Background Art
[0002] In modern distributed and high-concurrency systems, thread pools have become one of the key technologies to improve concurrent processing capabilities. The role of thread pools is to reduce the overhead of thread creation and destruction by reusing threads, avoiding frequent thread switching and resource allocation, thereby improving system processing efficiency. In most application servers and middleware, thread pools are used to handle a large number of concurrent requests and tasks. However, as the amount of concurrency increases, thread pools will face a series of performance bottlenecks under high load conditions, especially queue lock competition and task scheduling efficiency issues.
[0003] Usually, the thread pool uses a blocking queue to store tasks to be executed. When the number of threads in the thread pool reaches the upper limit, new tasks will be pushed into the queue and wait for execution. In high concurrency situations, the task queue of the thread pool will grow rapidly, causing queue operations (such as take or poll, the take operation is to remove the head element from the queue, and the queue is blocked when it is empty; the poll operation is to remove the head element from the queue, and the queue is empty. Return a null value) to frequently lock, resulting in lock contention between threads, seriously affecting system performance. Summary of the invention
[0004] The purpose of the present invention is to provide an application server optimization method, system, computer-readable storage medium and electronic device based on multi-subqueue concurrent scheduling, which can reduce the locking mechanism between threads and improve the task scheduling efficiency under high concurrency conditions.
[0005] In order to solve the above technical problems, the present invention provides an application server optimization method based on concurrent scheduling of multiple sub-queues, and the specific technical solution is as follows:
[0006] When it is detected that the server creates a thread pool task queue, the set thread pool queue number is obtained;
[0007] Create an object thread containing multiple sub-queues according to the set thread pool queue number;
[0008] When it is detected that the target thread starts to acquire tasks, a subqueue is selected from the object thread and bound to the target thread, so that the target thread executes the tasks through the bound subqueue.
[0009] Optionally, when it is detected that the server creates a thread pool task queue, before obtaining the set thread pool queue number, it also includes:
[0010] Configure the thread pool queue properties in the configuration file and set the number of thread pool queues.
[0011] Optionally, creating an object thread containing multiple sub-queues according to the set thread pool queue number includes:
[0012] Get the server's hardware parameters;
[0013] Calculate the number of subqueues according to the number of CPU cores and / or the maximum number of threads in the hardware parameters;
[0014] An object thread is created based on the number of sub-queues; the object thread is used to satisfy the requirement that each thread is bound to at least one sub-queue.
[0015] Optionally, before the target thread executes the task through the bound subqueue, the method further includes:
[0016] The tasks are assigned to corresponding sub-queues according to the task attributes of each task.
[0017] Optionally, before the target thread executes the task through the bound subqueue, the method further includes:
[0018] If the subqueue bound to the target thread is empty, the target thread obtains and executes the task corresponding to the idle subqueue of the unbound thread.
[0019] Optionally, also include:
[0020] detecting a load index of each subqueue in the object thread at a set inspection time point; the load index includes at least one of the number of tasks and the task waiting time;
[0021] If there is a high-load sub-queue whose load is greater than a set load value, the load balancing adjustment logic is triggered; the set load value is calculated by the load average value of all sub-queues and a set coefficient.
[0022] Optionally, the load balancing adjustment logic includes:
[0023] The load migration logic is used to extract tasks from the high-load sub-queue and insert them into the low-load sub-queue; the low-load sub-queue is a sub-queue with a load lower than the average value;
[0024] Thread rebinding logic, used to rebind the idle thread with the high-load subqueue;
[0025] The expansion logic is used to expand the object thread and create a new sub-queue.
[0026] The present invention also provides an application server optimization system based on multi-subqueue concurrent scheduling, comprising:
[0027] The thread pool detection module is used to obtain the set thread pool queue number when detecting that the server creates a thread pool task queue;
[0028] The object thread creation module is used to create an object thread containing multiple sub-queues according to the set thread pool queue number;
[0029] The subqueue allocation module is used to select a subqueue from the object thread and bind it to the target thread when detecting that the target thread starts to obtain tasks, so that the target thread executes tasks through the bound subqueue.
[0030] Optionally, also include:
[0031] The thread pool setting module is used to configure the thread pool queue properties in the configuration file and set the number of thread pool queues.
[0032] Optionally, the object thread creation module is a module for performing the following steps:
[0033] Get the server's hardware parameters;
[0034] Calculate the number of subqueues according to the number of CPU cores and / or the maximum number of threads in the hardware parameters;
[0035] An object thread is created based on the number of sub-queues; the object thread is used to satisfy the requirement that each thread is bound to at least one sub-queue.
[0036] Optionally, also include:
[0037] The task allocation module is used to allocate the tasks to corresponding sub-queues according to the task attributes of each task before the target thread executes the tasks through the bound sub-queues.
[0038] Optionally, also include:
[0039] The task scheduling module is used for, if the subqueue bound to the target thread is empty, the target thread obtains and executes the task corresponding to the idle subqueue of the unbound thread.
[0040] Optionally, also include:
[0041] A load balancing module is used to detect the load index of each sub-queue in the object thread at a set inspection time point; the load index includes at least one of the number of tasks and the task waiting time. If there is a high-load sub-queue with a load greater than a set load value, the load balancing adjustment logic is triggered; the set load value is calculated by the load average value of all sub-queues and a set coefficient.
[0042] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the application server optimization method described above are implemented.
[0043] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the application server optimization method described above when calling the computer program in the memory.
[0044] The present invention provides an application server optimization method based on multi-subqueue concurrent scheduling, comprising: when detecting that a server creates a thread pool task queue, obtaining a set thread pool queue number; creating an object thread containing multiple subqueues according to the set thread pool queue number; when detecting that a target thread starts to obtain a task, selecting a subqueue from the object thread and binding it to the target thread, so that the target thread executes the task through the bound subqueue.
[0045] The application server optimization method based on multi-subqueue concurrent scheduling provided by the present invention creates an object thread, and before the thread executes a task, selects a subqueue from the object thread to bind to the target thread, so that the target thread executes the task through the subqueue without waiting for other threads or competing for the same queue, thereby reducing task scheduling delays. At the same time, applying multiple subqueues in the object thread can enable the thread pool to adapt to higher concurrent loads and have better scalability.
[0046] The present invention also provides an application server optimization system based on concurrent scheduling of multiple sub-queues, a computer-readable storage medium and an electronic device, which have the above-mentioned beneficial effects and are not described in detail here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0048] Figure 1 A flowchart of an application server optimization method based on concurrent scheduling of multiple sub-queues provided by an embodiment of the present invention;
[0049] Figure 2 A schematic diagram of the structure of an application server optimization system based on concurrent scheduling of multiple sub-queues provided by an embodiment of the present invention;
[0050] Figure 3 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] The object information involved in the present invention, including but not limited to object device information, object personal information, etc., and data, including but not limited to data used for analysis, stored data, displayed data, etc., are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the laws, regulations and standards of relevant countries and regions.
[0053] The main defects of the prior art include:
[0054] The lock granularity is too large: All threads in the thread pool share a blocking queue, which leads to frequent locking and unlocking during high concurrency, resulting in a waste of CPU resources.
[0055] Queue operation blocking: As the number of queue tasks increases, threads need to wait longer to get tasks from the queue, affecting response speed.
[0056] Poor scalability: Traditional queues cannot effectively handle a large number of concurrent requests, have poor scalability, and cannot adapt to the performance requirements in a high-concurrency environment.
[0057] The purpose of the present invention is to reduce lock contention between threads by dividing the task queue into multiple sub-queues and allowing each thread to bind to a specific sub-queue when taking a task for the first time, thereby improving the response speed and task scheduling efficiency of the server under high concurrency conditions.
[0058] See also Figure 1 , Figure 1 A flowchart of an application server optimization method based on concurrent scheduling of multiple sub-queues provided by an embodiment of the present invention, the method comprising:
[0059] S101: When it is detected that the server creates a thread pool task queue, the set thread pool queue number is obtained;
[0060] S102: creating an object thread including multiple sub-queues according to the set thread pool queue number;
[0061] S103: When it is detected that the target thread starts to acquire tasks, a subqueue is selected from the object thread and bound to the target thread, so that the target thread executes the tasks through the bound subqueue.
[0062] First, get the number of thread pool queues to set. Specifically, you can first determine the thread pool configuration by looking for parameters related to the thread pool in the server configuration file, which usually include thread pool size, queue type, and queue capacity. At the same time, locate the thread pool initialization code, that is, find the thread pool initialization part in the server source code, which is usually executed when the server starts.
[0063] In addition, you need to identify the queue type: determine the type of queue used by the thread pool, such as an unbounded queue (LinkedBlockingQueue) or a bounded queue (ArrayBlockingQueue). Then get the queue capacity. If it is a bounded queue, find the set value for the queue capacity, which is usually specified via a constructor parameter at initialization. If it is an unbounded queue, the queue capacity may not have an explicit limit or may be determined by system resources. When initializing the thread pool, record or output the queue capacity for subsequent monitoring or debugging.
[0064] It is easy to understand that in this embodiment, the thread pool queue properties can also be configured in the configuration file in advance, and the number of thread pool queues can be set. Take the Spring framework as an example, and the configuration file is application.properties or application.yml. Use application.properties to open the configuration file: Find and open the application.properties file of the Spring Boot project. Add configuration items in the file to enable the thread pool queue properties and set the number of thread pool queues. The configuration items are:
[0065] spring.task.execution.pool.queue-capacity=50, that is, the queue capacity of the thread pool is set to 50. The specific number of thread pool queues can be set by those skilled in the art, and will not be described here. When setting the number of thread pool queues, it can be set based on the amount of tasks in a high concurrency state.
[0066] In step S102, it is necessary to create an object thread. Specifically, different types of tasks may have different configuration requirements for the thread pool depending on whether the task type to be processed is CPU-intensive, I / O-intensive or a mixed task. At the same time, it is necessary to estimate the total amount of tasks and the frequency of task arrival, and set the size of the thread pool and the capacity of the queue accordingly. Finally, the total number of threads in the thread pool can be determined based on the system's hardware resources (such as the number of CPU cores, memory size) and task characteristics. Generally speaking, for CPU-intensive tasks, the number of threads can be set to 1.5-2 times the number of CPU cores. For I / O-intensive tasks, the number of threads can be set higher.
[0067] In addition, you can also set the queue type in the object thread. You can choose the appropriate queue type according to the execution order and priority requirements of the tasks. Common queue types include:
[0068] First-in-first-out queue (FIFO): Applicable to scenarios where tasks are executed in the order they are submitted.
[0069] Priority queue: Applicable to scenarios where tasks have different priorities, and high-priority tasks will be executed first.
[0070] Bounded queue: The maximum capacity of the queue can be limited to prevent memory overflow caused by excessive task backlog.
[0071] In addition, you can also allocate appropriate capacity to each subqueue based on the number and frequency of tasks. The queue capacity setting needs to balance the task waiting time and memory usage.
[0072] When creating a subqueue, you can classify tasks by type or priority and create a subqueue for each type of task. For example, you can put high-priority tasks into one subqueue and low-priority tasks into another subqueue; or you can put different types of tasks into different subqueues. Set the appropriate capacity for each subqueue based on the number and characteristics of each type of task. At the same time, determine the management strategy of the subqueue, such as whether to allow tasks to migrate between queues (when one queue is full, whether tasks can be placed in another queue).
[0073] Create these sub-queues in the system and store them in a collection or array as object threads to facilitate subsequent management and access.
[0074] A possible implementation may include:
[0075] The first step is to obtain the hardware parameters of the server;
[0076] Step 2: Calculate the number of subqueues according to the number of CPU cores and / or the maximum number of threads in the hardware parameters;
[0077] Step 3: Create an object thread based on the number of sub-queues; the object thread is used to satisfy the requirement that each thread is bound to at least one sub-queue.
[0078] After the target thread is created, once it is detected that the thread acquires a task, a subqueue can be selected from the target thread and bound to the target thread. Each thread should have the ability to acquire tasks from the queue and execute them. In actual application, the tasks can be assigned to corresponding subqueues according to the task attributes of each task.
[0079] When binding a subqueue to a target thread, you can use any of the following methods:
[0080] Fixed allocation method: Each thread gets tasks from a fixed subqueue. This method is simple, but may cause some threads to be idle because the queue is empty.
[0081] Polling allocation method: threads obtain tasks from each sub-queue in a certain order. This method can effectively improve the utilization rate of the queue.
[0082] Work stealing: When a thread's own queue is empty, it can try to obtain tasks from other threads' queues, which can maximize thread utilization. For example, if the subqueue bound to the target thread is empty, the target thread can obtain and execute tasks corresponding to the idle subqueue of the unbound thread.
[0083] When a new task arrives, it is submitted to the corresponding subqueue according to the type or priority of the task. When submitting a task, the queue capacity needs to be checked. If the queue is full, it can be processed according to the preset strategy, such as waiting for the queue to have space, putting the task into other queues, or rejecting the task.
[0084] At the same time, the operation of the thread pool can be monitored, including thread utilization, queue length, task execution time, etc. Based on the monitoring results, the configuration of the thread pool can be dynamically adjusted, such as increasing or decreasing the number of threads, adjusting the queue capacity, etc.
[0085] When the thread pool is no longer needed, you can close the thread pool, make sure all tasks have been completed and the thread can exit normally. At the same time, release the resources occupied by the thread pool, such as memory, file handles, etc.
[0086] In a feasible implementation, the load index of each subqueue in the object thread may be detected at a set inspection time point, wherein the load index includes at least one of the number of tasks and the task waiting time.
[0087] If there is a high-load sub-queue with a load greater than the set load value, the load balancing adjustment logic is triggered; the set load value is calculated by the load average of all sub-queues and the set coefficient. There is no limit on the set coefficient, which is usually a fluctuation range of 1, that is, it can be greater than 1 or less than 1.
[0088] The load balancing adjustment logic mentioned in this embodiment may include the following:
[0089] The load migration logic is used to extract tasks from the high-load sub-queue and insert them into the low-load sub-queue; the low-load sub-queue is a sub-queue with a load lower than the average value;
[0090] Thread rebinding logic, used to rebind the idle thread with the high-load subqueue;
[0091] The expansion logic is used to expand the object thread and create a new sub-queue.
[0092] It is easy to understand that those skilled in the art can adopt other load balancing adjustment logics based on this embodiment, and no specific examples are given here.
[0093] The application server optimization method provided by the embodiment of the present invention creates an object thread, and before the thread executes a task, selects a subqueue from the object thread to bind to the target thread, so that the target thread executes the task through the subqueue without waiting for other threads or competing for the same queue, thereby reducing task scheduling delays. At the same time, multiple subqueues in the application object thread can enable the thread pool to adapt to higher concurrent loads and have better scalability.
[0094] See also Figure 2 , Figure 2 A schematic diagram of the structure of an application server optimization system based on concurrent scheduling of multiple sub-queues provided by an embodiment of the present invention, the system comprising:
[0095] The thread pool detection module is used to obtain the set thread pool queue number when detecting that the server creates a thread pool task queue;
[0096] The object thread creation module is used to create an object thread containing multiple sub-queues according to the set thread pool queue number;
[0097] The subqueue allocation module is used to select a subqueue from the object thread and bind it to the target thread when detecting that the target thread starts to obtain tasks, so that the target thread executes tasks through the bound subqueue.
[0098] Based on the above embodiments, as a preferred embodiment, it also includes:
[0099] The thread pool setting module is used to configure the thread pool queue properties in the configuration file and set the number of thread pool queues.
[0100] Based on the above embodiment, as a preferred embodiment, the object thread creation module is a module for executing the following steps:
[0101] Get the server's hardware parameters;
[0102] Calculate the number of subqueues according to the number of CPU cores and / or the maximum number of threads in the hardware parameters;
[0103] An object thread is created based on the number of sub-queues; the object thread is used to satisfy the requirement that each thread is bound to at least one sub-queue.
[0104] Based on the above embodiments, as a preferred embodiment, it also includes:
[0105] The task allocation module is used to allocate the tasks to corresponding sub-queues according to the task attributes of each task before the target thread executes the tasks through the bound sub-queues.
[0106] Based on the above embodiments, as a preferred embodiment, it also includes:
[0107] The task scheduling module is used for, if the subqueue bound to the target thread is empty, the target thread obtains and executes the task corresponding to the idle subqueue of the unbound thread.
[0108] Based on the above embodiments, as a preferred embodiment, it also includes:
[0109] A load balancing module is used to detect the load index of each sub-queue in the object thread at a set inspection time point; the load index includes at least one of the number of tasks and the task waiting time. If there is a high-load sub-queue with a load greater than a set load value, the load balancing adjustment logic is triggered; the set load value is calculated by the load average value of all sub-queues and a set coefficient.
[0110] Based on the above embodiment, as a preferred embodiment, the load balancing adjustment logic includes:
[0111] The load migration logic is used to extract tasks from the high-load sub-queue and insert them into the low-load sub-queue; the low-load sub-queue is a sub-queue with a load lower than the average value;
[0112] Thread rebinding logic, used to rebind the idle thread with the high-load subqueue;
[0113] The expansion logic is used to expand the object thread and create a new sub-queue.
[0114] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0115] The present invention also provides an electronic device, see Figure 3 , a structural diagram of an electronic device provided by an embodiment of the present invention, such as Figure 3 As shown, a processor 1410 and a memory 1420 may be included.
[0116] Among them, the processor 1410 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1410 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1410 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1410 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1410 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0117] The memory 1420 may include one or more computer-readable storage media, which may be non-transitory. The memory 1420 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 1420 is at least used to store the following computer program 1421, wherein, after the computer program is loaded and executed by the processor 1410, it can implement the relevant steps in the method performed by the electronic device side disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 1420 may also include an operating system 1422 and data 1423, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 1422 may include Windows, Linux, Android, etc.
[0118] In some embodiments, the electronic device may further include a display screen 1430 , an input / output interface 1440 , a communication interface 1450 , a sensor 1460 , a power source 1470 , and a communication bus 1480 .
[0119] certainly, Figure 3 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present invention. In actual applications, the electronic device may include Figure 3 More or fewer components than shown, or combinations of certain components.
[0120] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the system provided in the embodiment, since it corresponds to the method provided in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0121] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0122] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. An application server optimization method based on concurrent scheduling of multiple sub-queues, characterized in that: include: When it is detected that the server creates a thread pool task queue, the set thread pool queue number is obtained; Create an object thread containing multiple sub-queues according to the set thread pool queue number; When it is detected that the target thread starts to acquire tasks, a subqueue is selected from the object thread and bound to the target thread, so that the target thread executes the tasks through the bound subqueue.
2. The application server optimization method according to claim 1, characterized in that: When it is detected that the server has created a thread pool task queue, before obtaining the set thread pool queue number, it also includes: Configure the thread pool queue properties in the configuration file and set the number of thread pool queues.
3. The application server optimization method according to claim 1, characterized in that: Creating object threads containing multiple sub-queues according to the set thread pool queue number includes: Get the server's hardware parameters; Calculate the number of subqueues according to the number of CPU cores and / or the maximum number of threads in the hardware parameters; An object thread is created based on the number of sub-queues; the object thread is used to satisfy the requirement that each thread is bound to at least one sub-queue.
4. The application server optimization method according to claim 1, characterized in that: Before the target thread executes the task through the bound subqueue, it also includes: The tasks are assigned to corresponding sub-queues according to the task attributes of each task.
5. The application server optimization method according to claim 1, characterized in that: Before the target thread executes the task through the bound subqueue, it also includes: If the subqueue bound to the target thread is empty, the target thread obtains and executes the task corresponding to the idle subqueue of the unbound thread.
6. The application server optimization method according to claim 1, characterized in that: Also includes: detecting a load index of each subqueue in the object thread at a set inspection time point; the load index includes at least one of the number of tasks and the task waiting time; If there is a high-load sub-queue whose load is greater than a set load value, the load balancing adjustment logic is triggered; the set load value is calculated by the load average value of all sub-queues and a set coefficient.
7. The application server optimization method according to claim 6, characterized in that: The load balancing adjustment logic includes: The load migration logic is used to extract tasks from the high-load sub-queue and insert them into the low-load sub-queue; the low-load sub-queue is a sub-queue with a load lower than the average value; Thread rebinding logic, used to rebind the idle thread with the high-load subqueue; The expansion logic is used to expand the object thread and create a new sub-queue.
8. An application server optimization system based on concurrent scheduling of multiple sub-queues, characterized in that: include: The thread pool detection module is used to obtain the set thread pool queue number when detecting that the server creates a thread pool task queue; The object thread creation module is used to create an object thread containing multiple sub-queues according to the set thread pool queue number; The subqueue allocation module is used to select a subqueue from the object thread and bind it to the target thread when detecting that the target thread starts to obtain tasks, so that the target thread executes tasks through the bound subqueue.
9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the application server optimization method based on concurrent scheduling of multiple sub-queues as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed, implements the steps of the application server optimization method based on concurrent scheduling of multiple sub-queues as claimed in any one of claims 1 to 7.
Citation Information
Patent Citations
Device and method for guaranteeing order execution of multithread tasks
CN103810072A
Parallel user state protocol stack management method and protocol stack system
CN104951357A
Thread pool capacity expansion method and device, server, medium and product
CN113064705A
Task scheduling method and device, equipment and storage medium
CN113535361A
Queue scheduling method and device and related equipment
CN116048756A