Parallel execution of parsed query based on a concurrency level corresponding to an average number of available worker threads
First Claim
1. A method comprising:
- activating, by a computer system, a plurality of worker threads,receiving, by the computer system, a query;
processing, by the computer system, the query in a first thread in the plurality of worker threads to generate a parsing task associated with the query;
parsing, by the computer system, the query based on the parsing task to generate an execution plan comprising a plurality of ordered operations for answering the query;
generating, by the computer system, a task graph comprising a plurality of task nodes corresponding to the plurality of ordered operations, based on the execution plan;
identifying, by the computer system, a first task node in the plurality of task nodes corresponding to a first ordered operation in the plurality of ordered operations determined to be partitionable into sub operations that can be executed in parallel;
generating, by the computer system, a concurrency level value that corresponds to an availability of worker threads in the plurality of worker threads, wherein generating the concurrency level value comprises calculating an average number of available worker threads in the plurality of worker threads over a period of time; and
generating, by the computer system, a plurality of partitioned tasks that can be executed in parallel based on the first task node and the concurrency level value, wherein the concurrency level value is the upper limit for the number of partitioned tasks.
2 Assignments
0 Petitions
Accused Products
Abstract
Systems and method for a task scheduler with dynamic adjustment of concurrency levels and task granularity are disclosed for improved execution of highly concurrent analytical and transactional systems. The task scheduler can avoid both over commitment and underutilization of computing resources by monitoring and controlling the number of active worker threads. The number of active worker threads can be adapted to avoid underutilization of computing resources by giving the OS control of additional worker threads processing blocked application tasks. The task scheduler can dynamically determine a number of parallel operations for a particular task based on the number of available threads. The number of available worker threads can be determined based on the average availability of worker threads in the recent history of the application. Based on the number of available worker threads, the partitionable operation can be partitioned into a number of sub operations and executed in parallel.
46 Citations
20 Claims
-
1. A method comprising:
-
activating, by a computer system, a plurality of worker threads, receiving, by the computer system, a query; processing, by the computer system, the query in a first thread in the plurality of worker threads to generate a parsing task associated with the query; parsing, by the computer system, the query based on the parsing task to generate an execution plan comprising a plurality of ordered operations for answering the query; generating, by the computer system, a task graph comprising a plurality of task nodes corresponding to the plurality of ordered operations, based on the execution plan; identifying, by the computer system, a first task node in the plurality of task nodes corresponding to a first ordered operation in the plurality of ordered operations determined to be partitionable into sub operations that can be executed in parallel; generating, by the computer system, a concurrency level value that corresponds to an availability of worker threads in the plurality of worker threads, wherein generating the concurrency level value comprises calculating an average number of available worker threads in the plurality of worker threads over a period of time; and generating, by the computer system, a plurality of partitioned tasks that can be executed in parallel based on the first task node and the concurrency level value, wherein the concurrency level value is the upper limit for the number of partitioned tasks. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A non-transitory computer readable medium comprising instructions, that when executed by a processor cause the processor to be configured for:
-
activating a plurality of worker threads based, receiving a query, processing the query in a first thread in the plurality of worker threads to generate a parsing task associated with the query; parsing the query based on the parsing task to generate an execution plan comprising a plurality of ordered operations for answering the query; generating a task graph comprising a plurality of task nodes corresponding to the plurality of ordered operations, based on the execution plan; identifying a first task node in the plurality of task nodes corresponding to a first ordered operation in the plurality of ordered operations determined to be partitionable into sub operations that can be executed in parallel; generating a concurrency level value that corresponds to an availability of worker threads in the plurality of worker threads, wherein generating the concurrency level value comprises calculating an average number of available worker threads in the plurality of worker threads over a period of time; and generating a plurality of partitioned tasks that can be executed in parallel based on the first task node and the concurrency level value, wherein the concurrency level value is the upper limit for the number of partitioned tasks. - View Dependent Claims (9, 10, 11, 12, 13, 14)
-
-
15. A system comprising:
-
a computer processor; a non-transitory computer readable medium coupled to the computer processor and comprising instructions, that when executed by the computer processor cause the computer processor to be configured to; activate a plurality of worker threads, receive a query, process the query in a first thread in the plurality of worker threads to generate a parsing task associated with the query; parse the query based on the parsing task to generate an execution plan comprising a plurality of ordered operations for answering the query; generate a task graph comprising a plurality of task nodes corresponding to the plurality of ordered operations, based on the execution plan; identify a first task node in the plurality of task nodes corresponding to a first ordered operation in the plurality of ordered operations determined to be partitionable into sub operations that can be executed in parallel; generate a concurrency level value that corresponds to an availability of worker threads in the plurality of worker threads, wherein generating the concurrency level value comprises calculating an average number of available worker threads in the plurality of worker threads over a period of time; and generate a plurality of partitioned tasks that can be executed in parallel based on the first task node and the concurrency level value, wherein the concurrency level value is the upper limit for the number of partitioned tasks. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification