KR102195886B1 - Distributed processing system and operating method thereof - Google Patents

Distributed processing system and operating method thereof Download PDF

Info

Publication number
KR102195886B1
KR102195886B1 KR1020190074053A KR20190074053A KR102195886B1 KR 102195886 B1 KR102195886 B1 KR 102195886B1 KR 1020190074053 A KR1020190074053 A KR 1020190074053A KR 20190074053 A KR20190074053 A KR 20190074053A KR 102195886 B1 KR102195886 B1 KR 102195886B1
Authority
KR
South Korea
Prior art keywords
threads
tasks
divisions
initial
garbage collection
Prior art date
Application number
KR1020190074053A
Other languages
Korean (ko)
Other versions
KR102195886B9 (en
KR20200063962A (en
Inventor
이재욱
배종현
허준
김문경
Original Assignee
서울대학교산학협력단
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 서울대학교산학협력단 filed Critical 서울대학교산학협력단
Publication of KR20200063962A publication Critical patent/KR20200063962A/en
Application granted granted Critical
Publication of KR102195886B1 publication Critical patent/KR102195886B1/en
Publication of KR102195886B9 publication Critical patent/KR102195886B9/en

Links

Images

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

본 발명은 분산 처리 시스템 및 이의 동작 방법에 관한 것이다. 본 발명의 실시예에 따른 분산 처리 시스템은 마스터 및 적어도 하나의 워커 노드를 포함할 수 있다. 마스터는 복수의 단계(stage)들을 포함하는 작업(job)에서의 사용 함수들 각각에 대한 메모리 부하 가중치에 기초하여 분할 수 및 스레드 수를 생성한다. 마스터는 복수의 단계들 각각의 데이터를 분할 수만큼의 태스크들로 분할하고, 태스크들을 스레드 수만큼 병렬로 출력할 수 있다. 워커 노드는 출력된 태스크들을 실행하고, 태스크들을 실행하는 동안의 가비지 컬렉션 시간을 측정한다. 마스터는 가비지 컬렉션 시간에 기초하여 스레드 수를 조절할 수 있다.The present invention relates to a distributed processing system and a method of operation thereof. The distributed processing system according to an embodiment of the present invention may include a master and at least one worker node. The master generates the number of divisions and the number of threads based on a memory load weight for each of the functions used in a job including a plurality of stages. The master may divide the data of each of the plurality of steps into tasks equal to the number of divisions, and output the tasks in parallel by the number of threads. The worker node executes the printed tasks and measures the garbage collection time while executing the tasks. The master can adjust the number of threads based on the garbage collection time.

Description

분산 처리 시스템 및 이의 동작 방법{DISTRIBUTED PROCESSING SYSTEM AND OPERATING METHOD THEREOF}Distributed processing system and its operation method {DISTRIBUTED PROCESSING SYSTEM AND OPERATING METHOD THEREOF}

본 발명은 컴퓨팅 장치에 관한 것으로써, 좀 더 상세하게는 분산 처리 시스템 및 이의 동작 방법에 관한 것이다.The present invention relates to a computing device, and more particularly, to a distributed processing system and a method of operating the same.

최근, 인-메모리 프로세싱 패러다임이 아파치 스파크(Apache Spark)와 같은 빅데이터 분석 프레임워크에 채택되고 있다. 머신러닝 등 많은 데이터 분석 알고리즘은 중간 계산 값을 재사용하는 반복 알고리즘(iterative algorithm) 패턴을 갖는다. 재사용되는 데이터는 디스크 대신 메모리에 저장될 수 있고, 데이터 분석의 처리량과 응답시간이 개선될 수 있다. 많은 빅데이터 분석 프레임워크들은 데이터 흐름(dataflow)기반의 실행 모델에 기반하는데, 예를 들어 아파치 스파크는 사용자의 프로그램을 비 순환 방향 그래프(Directed acyclic graph; DAG)로 표현하고, DAG 스케줄러가 계산의 결과값을 필요로 하는 함수를 실행할 때까지 연산을 늦추는 방식(lazy execution)으로 전체 프로그램 연산을 최적화할 수 있다.Recently, an in-memory processing paradigm has been adopted in big data analytics frameworks such as Apache Spark. Many data analysis algorithms, such as machine learning, have an iterative algorithm pattern that reuses intermediate computed values. Reusable data can be stored in memory instead of disk, and throughput and response time of data analysis can be improved. Many big data analysis frameworks are based on dataflow-based execution models. For example, Apache Spark represents a user's program as a directed acyclic graph (DAG), and the DAG scheduler The entire program operation can be optimized by lazy execution until the function that requires the result value is executed.

그러나, 이러한 인-메모리 데이터 분석 프레임워크는 시스템의 메모리가 부족한 경우 성능이 크게 저하 될 수 있다. 스파크의 경우 연산 도중 사용 가능한 메모리가 부족한 경우 디스크로의 대량의 데이터 스필 및 가비지 컬렉션이 실행되어 인-메모리 연산의 성능 이점을 얻을 수 없다. 따라서, 메모리 사용에 있어 정밀한 최적화가 필요하다.However, such an in-memory data analysis framework can significantly degrade performance when the system's memory is insufficient. In the case of Spark, if there is not enough available memory during an operation, a large amount of data spill and garbage collection to disk is executed, and the performance benefits of in-memory operations cannot be obtained. Therefore, precise optimization is required for memory usage.

본 발명은 상술된 기술적 과제를 해결하기 위한 것으로써, 본 발명의 목적은 태스크를 실행하는 동안의 워커 노드들의 성능 저하 또는 워커 노드의 메모리 사용의 효율성을 개선하도록, 태스크를 스케줄링하는 분산 처리 시스템 및 이의 동작 방법을 제공하는 데 있다.The present invention is to solve the above-described technical problem, and an object of the present invention is a distributed processing system for scheduling a task so as to improve the efficiency of memory use of worker nodes or performance degradation of worker nodes during task execution, and It is to provide a method of operation.

본 발명의 실시 예에 따른 분산 처리 시스템은 마스터 및 적어도 하나의 워커 노드를 포함한다. 복수의 단계(stage)들을 포함하는 작업(job)에서의 사용 함수들 각각에 대한 메모리 부하 가중치에 기초하여 분할 수 및 스레드 수를 생성하고, 복수의 단계들 각각의 데이터를 분할 수만큼의 태스크들로 분할하고, 태스크들을 상기 스레드 수만큼 병렬로 출력한다. 적어도 하나의 워커 노드는 출력된 태스크들을 실행하고, 태스크들을 실행하는 동안의 가비지 컬렉션 시간을 측정한다. 마스터는 가비지 컬렉션 시간에 기초하여 스레드 수를 조절한다.A distributed processing system according to an embodiment of the present invention includes a master and at least one worker node. The number of divisions and the number of threads are generated based on the memory load weight for each of the functions used in a job including a plurality of stages, and the data of each of the plurality of stages are divided into tasks And outputs tasks in parallel by the number of threads. At least one worker node executes the output tasks and measures the garbage collection time while executing the tasks. The master adjusts the number of threads based on the garbage collection time.

마스터는 메모리 부하 가중치에 기초하여 복수의 단계들에서 사용 함수들에 의하여 변경되는 데이터의 최대 크기를 계산하고, 최대 크기에 기초하여 분할 수 및 스레드 수를 예측하는 분석 모듈을 포함할 수 있다. The master may include an analysis module that calculates the maximum size of data changed by the use functions in a plurality of steps based on the memory load weight, and predicts the number of divisions and the number of threads based on the maximum size.

일례로, 분석 모듈은 데이터의 최대 크기 및 적어도 하나의 워커 노드의 사용 가능한 메모리 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산하고, 초기 분할 수 및 초기 스레드 수 중 적어도 하나를 변경하여 분할 수 및 스레드 수를 결정하는 파라미터 생성기를 포함할 수 있다. 초기 스레드 수는 적어도 하나의 워커 노드에 포함된 코어의 개수에 의존할 수 있다. 초기 분할 수는 초기 스레드 수 및 데이터의 최대 크기의 곱에 사용 가능한 메모리 크기를 나눈 값에 의존할 수 있다. For example, the analysis module calculates the initial number of divisions and the number of threads based on the maximum size of data and the available memory size of at least one worker node, and changes the number of divisions by changing at least one of the initial number of divisions and the number of initial threads. And a parameter generator for determining the number of threads. The initial number of threads may depend on the number of cores included in at least one worker node. The initial number of partitions may depend on the product of the number of initial threads and the maximum size of data divided by the size of available memory.

일례로, 파라미터 생성기는 초기 분할 수 및 초기 스레드 수에 대응되는 태스크들의 예측 실행 시간을 계산하고, 초기 분할 수 및 초기 스레드 수 중 적어도 하나를 변경할 때의 예측 실행 시간의 감소율에 기초하여 분할 수 및 스레드 수를 결정할 수 있다. 파라미터 생성기는 예측 실행 시간의 감소율이 기준 비율보다 작을 때까지 초기 분할 수 및 초기 스레드 수 중 적어도 하나를 변경하여, 분할 수 및 상기 스레드 수를 결정할 수 있다.As an example, the parameter generator calculates the predicted execution time of tasks corresponding to the initial number of divisions and the number of initial threads, and the number of divisions based on the reduction rate of the predicted execution time when at least one of the initial number of divisions and the number of initial threads is changed, and You can decide the number of threads. The parameter generator may determine the number of divisions and the number of threads by changing at least one of the number of initial divisions and the number of initial threads until the reduction rate of the prediction execution time is less than the reference ratio.

일례로, 마스터는 태스크들 중 상기 스레드 수만큼의 태스크들을 적어도 하나의 워커 노드로 출력하고, 출력된 태스크들을 실행하는 동안의 가비지 컬렉션 시간들에 기초하여 스레드 수를 조절하는 태스크 스케줄러를 포함할 수 있다. As an example, the master may include a task scheduler that outputs tasks as many as the number of threads among tasks to at least one worker node and adjusts the number of threads based on garbage collection times while executing the output tasks. have.

일례로, 태스크 스케줄러는 출력된 태스크들 각각의 실행 시간들에 대한 가비지 컬렉션 시간들의 비율이 기준 비율보다 큰 경우, 스레드 수를 감소시킬 수 있다. 태스크 스케줄러는 출력된 상기 태스크들 각각의 실행 시간들에 대한 가비지 컬렉션 시간들의 비율이 기준 비율보다 작은 경우, 스레드 수를 증가시킬 수 있다. 태스크 스케줄러는 가비지 컬렉션 시간들에 대한 출력된 태스크들 이전에 측정된 가비지 컬렉션 시간들의 비율이 기준 비율보다 큰 경우, 스레드 수를 감소시킬 수 있다.For example, the task scheduler may reduce the number of threads when a ratio of garbage collection times to execution times of each of the output tasks is greater than a reference ratio. The task scheduler may increase the number of threads when a ratio of garbage collection times to execution times of each of the output tasks is smaller than a reference ratio. The task scheduler may reduce the number of threads when a ratio of garbage collection times measured before output tasks to garbage collection times is greater than a reference ratio.

일례로, 적어도 하나의 워커 노드는, 마스터로부터 수신된 태스크들을 실행하는 실행기, 및 가비지 컬렉션 시간 및 태스크들 각각의 실행 시간을 측정하는 타이머를 포함할 수 있다. 적어도 하나의 워커 노드는 가비지 컬렉션 시간 및 태스크들 각각의 실행 시간을 마스터로 송신하고, 마스터는 가비지 컬렉션 시간 및 실행 시간을 비교하여, 스레드 수를 조절할 수 있다.For example, at least one worker node may include an executor that executes tasks received from a master, and a timer that measures garbage collection time and execution time of each of the tasks. The at least one worker node transmits the garbage collection time and the execution time of each of the tasks to the master, and the master may adjust the number of threads by comparing the garbage collection time and the execution time.

본 발명의 실시 예에 따른 분산 처리 시스템의 동작 방법은, 작업(job)에 대응되는 데이터의 분할 수 및 스레드 수를 생성하는 단계, 분할 수 에 기초하여 데이터를 복수의 태스크들로 분할하는 단계, 복수의 태스크들 중 스레드 수만큼의 태스크들을 워커 노드로 출력하는 단계, 워커 노드가 태스크들을 실행하는 동안의 가비지 컬렉션 시간 및 실행 시간을 측정하는 단계, 및 가비지 컬렉션 시간 및 실행 시간에 기초하여 스레드 수를 조절하는 단계를 포함한다.A method of operating a distributed processing system according to an embodiment of the present invention includes generating a number of divisions and a number of threads of data corresponding to a job, dividing data into a plurality of tasks based on the number of divisions, Outputting as many tasks as the number of threads among a plurality of tasks to a worker node, measuring the garbage collection time and execution time while the worker node is executing the tasks, and the number of threads based on the garbage collection time and execution time It includes the step of adjusting.

분산 처리 시스템의 동작 방법은 작업의 사용 함수에 기초하여, 상기 작업을 복수의 단계들(stage)로 분할하는 단계를 더 포함할 수 있다. 분할 수는 복수의 단계들 각각에 대응되는 값들을 포함하고, 스레드 수는 복수의 단계들 각각에 대응되는 값들을 포함한다.The method of operating the distributed processing system may further include dividing the job into a plurality of stages based on a function of using the job. The number of divisions includes values corresponding to each of the plurality of steps, and the number of threads includes values corresponding to each of the plurality of steps.

일례로, 분할 수 및 스레드 수를 생성하는 단계는, 작업의 사용 함수들 각각의 메모리 부하 가중치를 검색하는 단계, 메모리 부하 가중치에 기초하여 사용 함수들에 의하여 변경되는 데이터의 최대 크기를 계산하는 단계, 최대 크기 및 워커 노드의 사용 가능한 메모리 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산하는 단계, 및 초기 분할 수 및 초기 스레드 수에 대응되는 태스크들의 예측 실행 시간에 기초하여, 초기 분할 수 및 초기 스레드 수를 조절하는 단계를 포함할 수 있다.As an example, generating the number of divisions and the number of threads may include searching for a memory load weight of each of the working functions, calculating a maximum size of data changed by the use functions based on the memory load weight. , Calculating an initial number of partitions and an initial number of threads based on the maximum size and the available memory size of the worker node, and based on the estimated execution time of tasks corresponding to the initial number of partitions and the number of initial threads, the number of initial partitions, and It may include adjusting the initial number of threads.

일례로, 초기 분할 수 및 초기 스레드 수를 조절하는 단계는, 초기 분할 수 및 초기 스레드 수 중 적어도 하나를 변경할 때의 예측 실행 시간의 감소율을 계산하는 단계, 및 감소율이 기준 비율보다 작을 때까지 초기 분할 수 및 초기 스레드 수 중 적어도 하나를 변경하는 단계를 포함할 수 있다.As an example, adjusting the initial number of partitions and the number of initial threads may include calculating a reduction rate of the predicted execution time when at least one of the initial number of partitions and the number of initial threads is changed, and initial until the reduction rate is less than the reference ratio. It may include changing at least one of the number of divisions and the number of initial threads.

일례로, 스레드 수를 조절하는 단계는, 실행 시간에 대한 가비지 컬렉션 시간의 비율이 기준 비율보다 큰 경우, 스레드 수를 감소시키는 단계를 포함할 수 있다. 스레드 수를 조절하는 단계는 실행 시간에 대한 가비지 컬렉션 시간의 비율이 기준 비율보다 작은 경우, 스레드 수를 증가시키는 단계를 포함할 수 있다. 스레드 수를 조절하는 단계는, 워커 노드가 작업을 실행하는 동안 수행될 수 있다.For example, adjusting the number of threads may include reducing the number of threads when the ratio of the garbage collection time to the execution time is greater than the reference ratio. Adjusting the number of threads may include increasing the number of threads when the ratio of the garbage collection time to the execution time is less than the reference ratio. The step of adjusting the number of threads may be performed while a worker node is executing a task.

본 발명의 실시 예에 따르면, 사용 함수별 메모리 부하 가중치를 관리함으로써, 작업의 스케줄링의 신속성 및 정확성이 개선될 수 있다.According to an embodiment of the present invention, by managing the memory load weight for each used function, the speed and accuracy of task scheduling can be improved.

본 발명의 실시 예에 따르면, 가비지 컬렉션을 고려하여, 스레드 수를 조절함으로써, 태스크를 실행하는 동안의 워커 노드들의 성능 저하 및 워커 노드의 메모리 사용의 효율성이 개선될 수 있다.According to an embodiment of the present invention, by adjusting the number of threads in consideration of garbage collection, the performance of worker nodes during task execution and the efficiency of memory use of the worker nodes can be improved.

도 1은 본 발명의 실시예에 따른 분산 처리 시스템의 블록도이다.
도 2는 도 1의 분산 처리 시스템의 동작을 구체적으로 설명하기 위한 도면이다.
도 3 내지 도 6은 분할 수 및 스레드 수에 따른 워커 노드의 동작을 설명하기 위한 도면이다.
도 7은 도 1의 분석 모듈을 구체화한 예시적인 블록도이다.
도 8은 도 7의 분석 모듈이 MAF를 검색하는 동작을 설명하기 위한 그래프이다.
도 9는 도 7의 분석 모듈이 스레드 수 및 분할 수를 결정하는 동작을 설명하기 위한 그래프이다.
도 10은 도 1의 분산 처리 시스템이 태스크들을 스케줄링하는 동작을 설명하기 위한 그래프이다.
도 11은 도 1의 분산 처리 시스템의 동작 방법의 예시적인 순서도이다.
도 12는 도 11의 S110 단계를 구체화한 순서도이다.
도 13은 도 11의 S150 단계를 구체화한 순서도이다.
1 is a block diagram of a distributed processing system according to an embodiment of the present invention.
FIG. 2 is a diagram specifically illustrating an operation of the distributed processing system of FIG. 1.
3 to 6 are diagrams for explaining an operation of a worker node according to the number of divisions and the number of threads.
7 is an exemplary block diagram embodied in the analysis module of FIG. 1.
FIG. 8 is a graph for explaining an operation of the analysis module of FIG. 7 searching for a MAF.
9 is a graph for explaining an operation of determining the number of threads and the number of divisions by the analysis module of FIG. 7.
FIG. 10 is a graph illustrating an operation of scheduling tasks by the distributed processing system of FIG. 1.
11 is an exemplary flow chart of a method of operating the distributed processing system of FIG. 1.
12 is a flow chart illustrating step S110 of FIG. 11.
13 is a flowchart illustrating step S150 of FIG. 11.

아래에서는, 본 발명의 기술 분야에서 통상의 지식을 가진 자가 본 발명을 용이하게 실시할 수 있을 정도로, 본 발명의 실시 예들이 명확하고 상세하게 기재된다.In the following, embodiments of the present invention are described clearly and in detail to the extent that a person having ordinary knowledge in the technical field of the present invention can easily implement the present invention.

도 1은 본 발명의 실시예에 따른 분산 처리 시스템의 블록도이다. 도 1을 참조하면, 분산 처리 시스템(1000)은 마스터(1100) 및 복수의 워커 노드들(1200~1400)을 포함할 수 있다. 분산 처리 시스템(1000)은 인-메모리 프로세싱을 이용하여 빅데이터를 분석하기 위하여, 중간 계산 값을 재사용하는 반복 알고리즘(iterative algorithm)을 사용할 수 있다. 예시적으로, 분산 처리 시스템(1000)이 아파치 스파크(Apache Spark) 환경에서 수행되는 것으로 설명된다.1 is a block diagram of a distributed processing system according to an embodiment of the present invention. Referring to FIG. 1, the distributed processing system 1000 may include a master 1100 and a plurality of worker nodes 1200 to 1400. The distributed processing system 1000 may use an iterative algorithm that reuses intermediate calculation values in order to analyze big data using in-memory processing. Illustratively, the distributed processing system 1000 is described as being executed in an Apache Spark environment.

마스터(1100)는 복수의 워커 노드들(1200~1400)이 작업(job)을 실행하도록, 작업을 스케줄링할 수 있다. 마스터(1100)는 작업(job)에 대응되는 데이터를 태스크들로 분할하고, 복수의 워커 노드들(1200~1400)에 태스크들을 할당할 수 있다. 이를 위하여, 마스터(1100)는 분석 모듈(1110), 비 순환 방향 그래프(Directed acyclic graph) 스케줄러 (이하, DAG 스케줄러(1120)), 및 태스크 스케줄러(1130)를 포함할 수 있다.The master 1100 may schedule a job so that the plurality of worker nodes 1200 to 1400 execute a job. The master 1100 may divide data corresponding to a job into tasks and allocate the tasks to a plurality of worker nodes 1200 to 1400. To this end, the master 1100 may include an analysis module 1110, a directed acyclic graph scheduler (hereinafter, the DAG scheduler 1120), and a task scheduler 1130.

분석 모듈(1110)은 작업을 실행하기 전에, 작업에 대응되는 데이터를 분할하는 개수 (이하, 분할 수) 및 분할된 데이터를 병렬로 출력하는 개수 (이하, 스레드 수)를 계산할 수 있다. 아파치 스파크 환경에서, 작업에 포함된 동작들에서 빅데이터를 저장하기 위한 분산 자료구조인 RDD(Resilient Distributed Dataset)가 사용될 수 있다. RDD는 프로그래머가 작업에서의 중간 데이터를 복수의 워커 노드들(1200~1400) 각각에 포함된 실행기 메모리(미도시)에 캐시할 수 있도록 하는 아파치 스파크의 기본 데이터 구조이다. 분석 모듈(1110)은 단일 RDD를 태스크들로 분할하는 개수인 분할 수, 및 분할된 태스크들을 복수의 워커 노드들(1200~1400)에 병렬로 출력하는 개수인 스레드 수를 미리 계산할 수 있다.Before executing the job, the analysis module 1110 may calculate the number of divisions of data corresponding to the job (hereinafter, the number of divisions) and the number of outputting the divided data in parallel (hereinafter, the number of threads). In the Apache Spark environment, RDD (Resilient Distributed Dataset), a distributed data structure for storing big data in operations included in a job, can be used. RDD is a basic data structure of Apache Spark that enables a programmer to cache intermediate data in a job in an executor memory (not shown) included in each of the plurality of worker nodes 1200 to 1400. The analysis module 1110 may pre-calculate the number of divisions, which is the number of dividing a single RDD into tasks, and the number of threads, which is the number of outputting the divided tasks to the plurality of worker nodes 1200 to 1400 in parallel.

분석 모듈(1110)은 작업에 포함된 단계(stage)에서 사용되는 함수들 각각의 메모리 부하 가중치(Memory amplification factor; MAF)에 기초하여 분할 수 및 스레드 수를 예측할 수 있다. MAF는 사용 함수에 입력되는 데이터의 크기에 대한 출력 데이터의 크기의 비율로 정의될 수 있다. 하나의 작업은 적어도 하나의 단계(stage)를 포함할 수 있다. 작업은 셔플(shuffle)을 기준으로 복수의 단계들로 분할될 수 있다. 여기에서, 셔플은 워커 노드들(1200~1400) 사이에서 중간 데이터를 교환 또는 공유하는 동작을 의미할 수 있다. 사용 함수에 입력되는 RDD의 크기는 사용 함수로부터 출력되는 RDD의 크기와 다를 수 있다. 분석 모듈(1110)은 사용 함수의 MAF를 고려하여, 분할 수 및 스레드 수를 계산할 수 있다. 이러한 계산에 대한 구체적인 내용은 후술된다.The analysis module 1110 may predict the number of divisions and the number of threads based on a memory amplification factor (MAF) of each of functions used in a stage included in the job. MAF can be defined as the ratio of the size of the output data to the size of the data input to the use function. One task may include at least one stage. The work can be divided into a plurality of steps based on a shuffle. Here, shuffle may mean an operation of exchanging or sharing intermediate data between worker nodes 1200 to 1400. The size of the RDD input to the use function may be different from the size of the RDD output from the use function. The analysis module 1110 may calculate the number of divisions and the number of threads in consideration of the MAF of the use function. Details of this calculation will be described later.

DAG 스케줄러(1120)는 작업을 복수의 단계들로 분할하고, 분할 수에 기초하여 단계들 각각의 RDD를 복수의 태스크들로 분할한다. 작업은 비 순환 방향 그래프(Directed acyclic graph; DAG)로 표현될 수 있다. 즉, 작업에 포함된 단계들은 하나의 방향성을 갖고, 순환되지 않을 수 있다. DAG 스케줄러(1120)는 셔플을 유발하는 사용 함수를 기준으로, 작업을 복수의 단계들로 분할할 수 있다. DAG 스케줄러(1120)는 분할 수만큼 단계들 각각의 RDD를 태스크들로 분할할 수 있다.The DAG scheduler 1120 divides the job into a plurality of stages, and divides the RDD of each of the stages into a plurality of tasks based on the number of divisions. The task can be expressed as a directed acyclic graph (DAG). That is, the steps included in the work have one direction and may not be cycled. The DAG scheduler 1120 may divide a task into a plurality of steps based on a usage function that causes shuffle. The DAG scheduler 1120 may divide the RDD of each step into tasks by the number of divisions.

태스크 스케줄러(1130)는 분할된 복수의 태스크들을 복수의 워커 노드들(1200~1400)로 출력할 수 있다. 태스크 스케줄러(1130)는 스레드 수에 기초하여 병렬로 태스크들(TG1~TGn)을 출력할 수 있다. 병렬로 출력되는 태스크들(TG1~TGn)의 개수는 스레드 수와 같을 수 있다. 스레드 수가 많을수록, 병렬로 출력되는 태스크들(TG1~TGn)의 개수가 증가한다. 스레드 수가 너무 많은 경우, 복수의 워커 노드들(1200~1400)의 메모리 공간이 부족하여 성능이 저하될 수 있다. 또한, 스레드 수가 너무 적은 경우, 복수의 워커 노드들(1200~1400)의 메모리 공간이 충분히 활용되지 않아 최적의 성능을 갖지 못할 수 있다.The task scheduler 1130 may output a plurality of divided tasks to a plurality of worker nodes 1200 to 1400. The task scheduler 1130 may output tasks TG1 to TGn in parallel based on the number of threads. The number of tasks TG1 to TGn output in parallel may be the same as the number of threads. As the number of threads increases, the number of tasks TG1 to TGn output in parallel increases. If the number of threads is too large, the memory space of the plurality of worker nodes 1200 to 1400 may be insufficient and performance may deteriorate. In addition, when the number of threads is too small, the memory space of the plurality of worker nodes 1200 to 1400 may not be sufficiently utilized and thus optimal performance may not be obtained.

태스크 스케줄러(1130)는 복수의 워커 노드들(1200~1400)로부터 가비지 컬렉션 시간들(Gt1~Gtn) 및 실행 시간들(Et1~Etn)을 수신할 수 있다. 가비지 컬렉션은 복수의 워커 노드들(1200~1400)의 메모리 공간이 태스크들(TG1~TGn)을 로드하기에 부족한 경우, 사용되지 않는 데이터가 점유하는 메모리 공간을 회수하는 동작을 의미한다. 가비지 컬렉션 시간들(Gt1~Gtn)은 태스크들(TG1~TGn)을 처리하는 실행 시간들(Et1~Etn) 동안 가비지 컬렉션을 수행하는 시간으로 이해될 것이다. The task scheduler 1130 may receive garbage collection times Gt1 to Gtn and execution times Et1 to Etn from the plurality of worker nodes 1200 to 1400. Garbage collection refers to an operation of recovering a memory space occupied by unused data when the memory space of the plurality of worker nodes 1200 to 1400 is insufficient to load the tasks TG1 to TGn. Garbage collection times (Gt1 to Gtn) will be understood as a time to perform garbage collection during execution times (Et1 to Etn) processing tasks TG1 to TGn.

태스크 스케줄러(1130)는 가비지 컬렉션 시간들(Gt1~Gtn) 및 실행 시간들(Et1~Etn)에 기초하여, 스레드 수를 조절할 수 있다. 예를 들어, 실행 시간들(Et1~Etn)에 대한 가비지 컬렉션 시간들(Gt1~Gtn)의 비율이 기준 비율보다 큰 경우, 복수의 워커 노드들(1200~1400) 중 적어도 하나는 태스크들(TG1~TGn)을 저장하기에 메모리 공간이 부족한 것일 수 있다. 이 경우, 태스크 스케줄러(1130)는 스레드 수를 감소시켜, 병렬로 출력되는 태스크들(TG1~TGn)의 크기를 감소시킬 수 있다. 또한, 실행 시간들(Et1~Etn)에 대한 가비지 컬렉션 시간들(Gt1~Gtn)의 비율이 기준 비율보다 작은 경우, 복수의 워커 노드들(1200~1400)이 태스크들(TG1~TGn)을 저장하기에 메모리 공간이 여유있는 것일 수 있다. 이 경우, 태스크 스케줄러(1130)는 스레드 수를 증가시킬 수 있다. 따라서, 복수의 워커 노드들(1200~1400)의 태스크 처리 능력에 맞는 태스크 스케줄링이 수행될 수 있다. 여기에서, 기준 비율은 태스크들을 저장 및 실행하기에 충분한 메모리 공간이 확보된 것으로 판단되는 상한을 의미할 수 있다.The task scheduler 1130 may adjust the number of threads based on garbage collection times Gt1 to Gtn and execution times Et1 to Etn. For example, when the ratio of the garbage collection times Gt1 to Gtn to the execution times Et1 to Etn is greater than the reference ratio, at least one of the plurality of worker nodes 1200 to 1400 is tasks TG1 ~TGn) may have insufficient memory space. In this case, the task scheduler 1130 may reduce the number of threads, thereby reducing the size of tasks TG1 to TGn that are output in parallel. In addition, when the ratio of garbage collection times (Gt1 to Gtn) to execution times (Et1 to Etn) is smaller than the reference ratio, a plurality of worker nodes (1200 to 1400) store tasks (TG1 to TGn). The memory space may be available below. In this case, the task scheduler 1130 may increase the number of threads. Accordingly, task scheduling suitable for the task processing capability of the plurality of worker nodes 1200 to 1400 may be performed. Here, the reference ratio may mean an upper limit at which it is determined that sufficient memory space for storing and executing tasks is secured.

복수의 워커 노드들(1200~1400)은 복수의 실행기들(1210~1410) 및 복수의 타이머들(1220~1420)을 포함할 수 있다. 복수의 실행기들(1210~1410)은 마스터(1100)로부터 출력된 태스크들(TG1~TGn)을 실행 및 처리할 수 있다. 도시되지 않았으나, 복수의 실행기들(1210~1410)은 태스크들(TG1~TGn)을 저장하기 위한 실행기 메모리(미도시)를 포함할 수 있다. 복수의 실행기들(1210~1410)에 의하여 실행 및 처리된 결과는 마스터(1100)에 제공될 수 있다.The plurality of worker nodes 1200 to 1400 may include a plurality of executors 1210 to 1410 and a plurality of timers 1220 to 1420. The plurality of executors 1210 to 1410 may execute and process the tasks TG1 to TGn output from the master 1100. Although not shown, the plurality of executors 1210 to 1410 may include an executor memory (not shown) for storing the tasks TG1 to TGn. Results executed and processed by the plurality of executors 1210 to 1410 may be provided to the master 1100.

복수의 타이머들(1220~1420)은 태스크들(TG1~TGn)을 실행하는 동안, 실행 시간들(Et1~Etn) 및 가비지 컬렉션 시간들(Gt1~Gtn)을 측정할 수 있다. 복수의 타이머들(1220~1420) 각각은 복수의 워커 노드들(1200~1400) 중 대응되는 워커 노드에 대한 실행 시간 및 가비지 컬렉션 시간을 측정할 수 있다. 측정된 실행 시간들(Et1~Etn) 및 가비지 컬렉션 시간들(Gt1~Gtn)은 마스터(1100)로 제공되어, 스레드 수를 조절하는데 사용될 수 있다.The plurality of timers 1220 to 1420 may measure execution times Et1 to Etn and garbage collection times Gt1 to Gtn while the tasks TG1 to TGn are being executed. Each of the plurality of timers 1220 to 1420 may measure an execution time and a garbage collection time for a corresponding worker node among the plurality of worker nodes 1200 to 1400. The measured execution times Et1 to Etn and garbage collection times Gt1 to Gtn are provided to the master 1100 and may be used to control the number of threads.

마스터(1100) 및 복수의 워커 노드들(1200~1400) 각각은 임베디드 컴퓨터, 데스크탑 및 서버 등을 포함할 수 있으나, 이에 제한되지 않는다. 마스터(1100) 및 복수의 워커 노드들(1200~1400) 각각은 CPU를 포함하는 다양한 종류의 전자 장치로 구현될 수 있다. 마스터(1100) 및 복수의 워커 노드들(1200~1400) 각각은 명령어를 수신하고 수신된 명령어에 기초하여 동작할 수 있다. Each of the master 1100 and the plurality of worker nodes 1200 to 1400 may include an embedded computer, a desktop, and a server, but is not limited thereto. Each of the master 1100 and the plurality of worker nodes 1200 to 1400 may be implemented as various types of electronic devices including a CPU. Each of the master 1100 and the plurality of worker nodes 1200 to 1400 may receive a command and operate based on the received command.

마스터(1100) 및 복수의 워커 노드들(1200~1400) 각각에 포함된 구성들은 소프트웨어, 또는 하드웨어, 또는 이의 조합의 형태로 구현될 수 있다. 예시적으로, 소프트웨어는 기계 코드, 펌웨어, 임베디드 코드, 및 애플리케이션 소프트웨어일 수 있다. 예를 들어, 하드웨어는 전기 회로, 전자 회로, 프로세서, 컴퓨터, 집적 회로, 집적 회로 코어들, 또는 이의 조합을 포함할 수 있다.Components included in each of the master 1100 and the plurality of worker nodes 1200 to 1400 may be implemented in the form of software, hardware, or a combination thereof. Illustratively, the software may be machine code, firmware, embedded code, and application software. For example, the hardware may include an electrical circuit, an electronic circuit, a processor, a computer, an integrated circuit, integrated circuit cores, or a combination thereof.

마스터(1100) 및 복수의 워커 노드들(1200~1400)은 네트워크를 통하여 태스크들(TG1~TGn), 실행 시간들(Et1~Etn), 및 가비지 컬렉션 시간들(Gt1~Gtn)을 송신 및 수신할 수 있다. 마스터(1100) 및 복수의 워커 노드들(1200~1400)은 유선 또는 무선으로 데이터를 주고 받을 수 있다.The master 1100 and a plurality of worker nodes 1200 to 1400 transmit and receive tasks (TG1 to TGn), execution times (Et1 to Etn), and garbage collection times (Gt1 to Gtn) through a network. can do. The master 1100 and the plurality of worker nodes 1200 to 1400 may exchange data by wire or wirelessly.

도 2는 도 1의 분산 처리 시스템의 동작을 구체적으로 설명하기 위한 도면이다. 도 2를 참조하면, 분산 처리 시스템(1000)은 분석 모듈(1110), DAG 스케줄러(1120), 태스크 스케줄러(1130), 및 제1 및 제2 워커 노드들(1200, 1300)을 포함하며, 각각 도 1의 분석 모듈(1110), DAG 스케줄러(1120), 태스크 스케줄러(1130), 및 제1 및 제2 워커 노드들(1200, 1300)에 대응된다.FIG. 2 is a diagram specifically illustrating an operation of the distributed processing system of FIG. 1. 2, the distributed processing system 1000 includes an analysis module 1110, a DAG scheduler 1120, a task scheduler 1130, and first and second worker nodes 1200 and 1300, respectively. It corresponds to the analysis module 1110 of FIG. 1, the DAG scheduler 1120, the task scheduler 1130, and the first and second worker nodes 1200 and 1300.

사용자 프로그램(user program)이 도 1의 마스터(1100)에 제공됨에 따라, 새로운 작업이 생성될 수 있다. 작업이 생성되는 경우, DAG 스케줄러(1120)에 의하여 RDD 의존성 그래프가 생성될 수 있다. RDD 의존성 그래프는 입력 RDD(RDD0)가 사용 함수들(f1, f2)에 의하여 출력 RDD들(RDD1, RDD2)로 변형되는 과정을 나타낼 수 있다. 일례로, 입력 RDD(RDD0)는 제1 함수(f1)에 의하여 제1 출력 RDD(RDD1)로 변형되고, 제1 출력 RDD(RDD1)는 제2 함수(f2)에 의하여 제2 출력 RDD(RDD2)로 변형될 수 있다. 이러한 RDD 의존성 그래프는 도 1의 마스터(1100)의 메모리(미도시)에 저장되고 분석 모듈(1110)에 의하여 관리될 수 있다.As a user program is provided to the master 1100 of FIG. 1, a new job may be created. When a task is generated, an RDD dependency graph may be generated by the DAG scheduler 1120. The RDD dependency graph may represent a process in which the input RDD RDD0 is transformed into the output RDDs RDD1 and RDD2 by the use functions f1 and f2. For example, the input RDD (RDD0) is transformed into the first output RDD (RDD1) by the first function (f1), and the first output RDD (RDD1) is the second output RDD (RDD2) by the second function (f2). ) Can be transformed. This RDD dependency graph may be stored in a memory (not shown) of the master 1100 of FIG. 1 and managed by the analysis module 1110.

DAG 스케줄러(1120)는 작업을 복수의 단계들로 분할할 수 있다. DAG 스케줄러(1120)는 셔플을 경계로 작업을 복수의 단계들로 분할할 수 있다. 예를 들어, 제1 함수(f1)가 map() 함수이고, 제2 함수(f2)가 sortByKey() 함수인 경우, 제1 함수(f1)는 셔플과 무관하고, 제2 함수(f2)는 셔플과 관련된 함수일 수 있다. 이 경우, 제2 함수(f2)를 기준으로, 작업은 제1 단계 및 제2 단계로 구분될 수 있다.The DAG scheduler 1120 may divide the task into a plurality of steps. The DAG scheduler 1120 may divide a task into a plurality of steps based on a shuffle. For example, if the first function (f1) is the map() function and the second function (f2) is the sortByKey() function, the first function (f1) is independent of shuffle, and the second function (f2) is It may be a function related to shuffle. In this case, based on the second function f2, the task may be divided into a first step and a second step.

분석 모듈(1110)은 작업에 대응되는 RDD 의존성 그래프로부터 단계들 각각의 분할 수 및 스레드 수를 예측할 수 있다. 분석 모듈(1110)은 RDD 의존성 그래프에서의 사용 함수들(f1, f2) 각각의 MAF를 검색할 수 있다. 이러한 MAF는 분석 모듈(1110)에 의하여 관리될 수 있다. 일례로, MAF는 선형 회귀 분석을 통하여 미리 마스터(1100)의 메모리(미도시)에 저장될 수 있다. 분석 모듈(1110)은 제1 및 제2 워커 노드들(1200, 1300)의 사용 가능한 메모리의 크기에 기초하여 RDD를 몇 개의 태스크들로 분할하고, 몇 개의 태스크들을 병렬로 출력해야 하는지 결정할 수 있다. 이에 대한 구체적인 내용은 도 7 이하에서 후술된다.The analysis module 1110 may predict the number of divisions and the number of threads of each of the steps from the RDD dependency graph corresponding to the task. The analysis module 1110 may search the MAF of each of the use functions f1 and f2 in the RDD dependency graph. This MAF may be managed by the analysis module 1110. For example, the MAF may be stored in a memory (not shown) of the master 1100 in advance through linear regression analysis. The analysis module 1110 may divide the RDD into several tasks based on the size of the available memory of the first and second worker nodes 1200 and 1300 and determine how many tasks should be output in parallel. . Detailed information about this will be described later in FIG. 7.

DAG 스케줄러(1120)는 분석 모듈(1110)로부터 예측된 분할 수에 기초하여 단계들 각각의 RDD들(RDD0~RDD2)를 복수의 태스크들(T00~T03, T10~T13, T20~T23)로 분할한다. 도 2는 예시적으로, 분할 수가 4인 것으로 가정한다. The DAG scheduler 1120 divides the RDDs (RDD0 to RDD2) of each step into a plurality of tasks (T00 to T03, T10 to T13, T20 to T23) based on the number of partitions predicted from the analysis module 1110 do. In FIG. 2, as an example, it is assumed that the number of divisions is 4.

태스크 스케줄러(1130)는 분석 모듈(1110)로부터 예측된 스레드 수에 기초하여 태스크들(TG1, TG2)을 병렬로 제1 및 제2 워커 노드들(1200, 1300)에 출력할 수 있다. 도 2는 예시적으로, 스레드 수가 2인 것으로 가정한다. 제1 워커 노드(1200)는 2개의 태스크들(T00, T01)을 수신하고, 제2 워커 노드(1300)는 2개의 태스크들(T02, T03)를 수신할 수 있다. The task scheduler 1130 may output the tasks TG1 and TG2 to the first and second worker nodes 1200 and 1300 in parallel based on the number of threads predicted from the analysis module 1110. 2 is an example, and assumes that the number of threads is 2. The first worker node 1200 may receive two tasks T00 and T01, and the second worker node 1300 may receive two tasks T02 and T03.

제1 및 제2 워커 노드들(1200, 1300)은 제1 및 제2 실행기들(1210, 1310)을 포함할 수 있다. 예시적으로, 제1 및 제2 실행기들(1210) 각각은 2개의 코어들을 갖는 CPU를 포함하는 것으로 가정한다. 이 경우, 코어들 각각에 하나의 태스크가 할당될 수 있고, 코어들 각각은 분할된 태스크를 실행할 수 있다. 제1 및 제2 워커 노드들(1200, 1300)은 태스크를 실행하는 동안, 실행 시간 및 가비지 컬렉션 시간을 측정할 수 있고, 태스크 스캐줄러(1130)는 실행 시간 및 가비지 컬렉션 시간에 기초하여 스레드 수를 조절할 수 있다.The first and second worker nodes 1200 and 1300 may include first and second executors 1210 and 1310. Illustratively, it is assumed that each of the first and second executors 1210 includes a CPU having two cores. In this case, one task may be assigned to each of the cores, and each of the cores may execute a divided task. The first and second worker nodes 1200 and 1300 may measure execution time and garbage collection time while executing a task, and the task scheduler 1130 determines the number of threads based on the execution time and garbage collection time. Can be adjusted.

도 3 내지 도 6은 분할 수 및 스레드 수에 따른 워커 노드의 동작을 설명하기 위한 도면이다. 도 3 내지 도 6은 분할 수 및 스레드 수가 워커 노드(1200)에 최적화되지 않은 경우의 동작을 설명하는 도면이다. 여기에서, 워커 노드(1200)는 도 1의 복수의 워커 노드들(1200~1400)을 모두 포함할 수 있으나, 예시적으로 하나의 워커 노드(1200)를 도시한 것으로 이해될 것이다.3 to 6 are diagrams for explaining an operation of a worker node according to the number of divisions and the number of threads. 3 to 6 are diagrams illustrating operations when the number of divisions and the number of threads are not optimized for the worker node 1200. Here, the worker node 1200 may include all of the plurality of worker nodes 1200 to 1400 of FIG. 1, but it will be understood that an exemplary worker node 1200 is illustrated.

도 3 내지 도 6을 참조하면, 작업은 셔플을 기준으로 제1 단계 및 제2 단계로 구분될 수 있다. 워커 노드(1200)는 실행기 메모리(1215) 및 로컬 디스크(1230)를 포함할 수 있다. 실행기 메모리(1215)는 도 1의 실행기들(1210~1410) 각각에 포함되며, 워커 노드(1200)의 주 메모리로 이해될 것이다. 로컬 디스크(1230)는 워커 노드(1200)의 보조 메모리로 이해될 것이다.3 to 6, the operation may be divided into a first step and a second step based on the shuffle. The worker node 1200 may include an executor memory 1215 and a local disk 1230. The executor memory 1215 is included in each of the executors 1210 to 1410 of FIG. 1, and will be understood as the main memory of the worker node 1200. The local disk 1230 will be understood as an auxiliary memory of the worker node 1200.

본 발명의 인-메모리 프로세싱을 이용하여 빅데이터를 분석하기 위한 분산 처리 시스템(도 1, 1000)은 중간 계산 값을 재사용하는 반복 알고리즘(iterative algorithm)을 사용할 수 있다. 재사용되는 데이터는 로컬 디스크(1230) 대신에 실행기 메모리(1215)에 저장되고, 도 2의 CPU 코어에 의하여 실행될 수 있다. 따라서, 데이터 분석의 처리량과 응답 시간이 개선될 수 있다. The distributed processing system (FIGS. 1, 1000) for analyzing big data using the in-memory processing of the present invention may use an iterative algorithm that reuses intermediate calculation values. The reused data is stored in the executor memory 1215 instead of the local disk 1230, and may be executed by the CPU core of FIG. 2. Thus, the throughput and response time of data analysis can be improved.

도 3은 분할 수(NP)가 작아서, 실행기 메모리(1215)의 사용 가능한 크기에 비하여 태스크들의 크기가 큰 경우의 동작을 설명하기 위한 도면이다. 도 3을 참조하면, 예시적으로 분할 수(NP)는 2이고, 스레드 수(NT)는 2인 것으로 가정한다. 하나의 RDD는 2개의 태스크들(T20, T21)로 분할되고, 2개의 태스크들(T20, T21)은 병렬로 워커 노드(1200)에 출력될 수 있다. 2개의 태스크들(T20, T21) 전체의 크기는 실행기 메모리(1215)의 사용 가능한 크기보다 클 수 있다. 이 경우, 데이터 스필(data spill) 및 가비지 컬렉션이 발생할 수 있다. 3 is a diagram for explaining an operation when the number of divisions (NP) is small and the size of tasks is larger than the usable size of the executor memory 1215. Referring to FIG. 3, it is assumed that the number of divisions (NP) is 2 and the number of threads (NT) is 2. One RDD may be divided into two tasks T20 and T21, and the two tasks T20 and T21 may be output to the worker node 1200 in parallel. The total size of the two tasks T20 and T21 may be larger than the usable size of the executor memory 1215. In this case, data spill and garbage collection may occur.

데이터 스필은 실행기 메모리(1215)의 사용 가능한 공간이 부족하여 데이터의 일부를 직렬화(serialize)하여 로컬 디스크(1230)에 저장하는 동작을 의미한다. 로컬 디스크(1230)에 저장된 데이터가 다시 필요한 경우, 데이터가 역직렬화(de-serialize)되어 실행기 메모리(1215)에 로드될 수 있다. 가비지 컬렉션은 상술한 바와 같이, 실행기 메모리(1215)의 사용 가능한 공간이 부족하여 사용되지 않는 데이터가 점유하는 메모리 공간을 회수하는 동작을 의미한다. 데이터 스필이 발생하는 동안, 가비지 컬렉션이 함께 발생한다.The data spill refers to an operation of serializing a part of data and storing it in the local disk 1230 due to insufficient available space in the executor memory 1215. When data stored in the local disk 1230 is required again, the data may be de-serialized and loaded into the executor memory 1215. As described above, garbage collection refers to an operation of recovering a memory space occupied by unused data due to insufficient available space in the executor memory 1215. During the data spill, garbage collection occurs together.

태스크들(T20, T21)의 크기가 실행기 메모리(1215)의 사용 가능한 공간보다 크므로, 태스크들(T20, T21)에 포함된 데이터의 일부가 실행기 메모리(1215)에서 로컬 디스크(1230)로 옮겨질 수 있다. 그리고, 태스크들(T20, T21)에 포함된 나머지 데이터가 실행기 메모리(1215)에 저장될 수 있다. 이에 따라, 태스크들(T20, T21)을 실행하기 위하여 데이터 스필 및 가비지 컬렉션이 발생되고, 인-메모리 프로세싱에 따른 성능 개선의 효과가 감소한다. Since the sizes of the tasks T20 and T21 are larger than the usable space of the executor memory 1215, some of the data included in the tasks T20 and T21 is moved from the executor memory 1215 to the local disk 1230. I can lose. In addition, the remaining data included in the tasks T20 and T21 may be stored in the executor memory 1215. Accordingly, data spill and garbage collection are generated in order to execute the tasks T20 and T21, and the effect of performance improvement due to in-memory processing is reduced.

데이터 스필이 워커 노드(1200)의 성능을 저하시키나, 데이터 스필 동안 발생하는 가비지 컬렉션이 데이터 스필보다 더 큰 성능 저하를 발생시킨다. 따라서, 워커 노드(1200)는 태스크들을 실행하는 동안의 가비지 컬렉션 시간을 측정하여 도 1의 마스터(1100)에 피드백함으로써, 최적화된 태스크 스케줄링이 수행될 수 있다.The data spill degrades the performance of the worker node 1200, but garbage collection that occurs during the data spill causes a greater performance degradation than the data spill. Accordingly, the worker node 1200 measures a garbage collection time while executing tasks and feeds it back to the master 1100 of FIG. 1, thereby performing optimized task scheduling.

도 4는 분할 수(NP)가 커서, 셔플 동작이 과도하게 발생하는 경우의 동작을 설명하기 위한 도면이다. 도 4를 참조하면, 예시적으로 분할 수(NP)는 도 3의 분할 수(NP)보다 많은 a이고, 스레드 수(NT)는 2인 것으로 가정한다. 하나의 RDD는 a개의 태스크들(T20~T2a)로 분할되고, 2개의 태스크들(T20, T21)은 병렬로 워커 노드(1200)에 출력될 수 있다. 하나의 태스크의 크기는 도 3의 태스크의 크기보다 작을 수 있다. 2개의 태스크들(T20, T21)의 크기는 실행기 메모리(1215)의 사용 가능한 크기보다 작을 수 있다. 이 경우, 태스크들(T20, T21)이 실행되는 동안 데이터 스필 및 가비지 컬렉션이 발생하지 않을 수 있다.4 is a diagram for explaining an operation when the number of divisions NP is large and the shuffle operation occurs excessively. Referring to FIG. 4, as an example, it is assumed that the number of divisions (NP) is a larger than the number of divisions (NP) of FIG. 3 and the number of threads NT is 2. One RDD may be divided into a number of tasks T20 to T2a, and two tasks T20 and T21 may be output to the worker node 1200 in parallel. The size of one task may be smaller than the size of the task of FIG. 3. The sizes of the two tasks T20 and T21 may be smaller than the usable size of the executor memory 1215. In this case, data spill and garbage collection may not occur while the tasks T20 and T21 are being executed.

다만, 분할 수(NP)가 클수록, 셔플 동작에 많은 부하가 발생된다. 이로 인하여, 도 1의 마스터(1100)의 스케줄링에 오버헤드가 증가할 수 있다. 즉, 분할 수(NP)가 너무 적어도 성능이 감소하고, 너무 많아도 성능이 감소하므로, 적정한 분할 수(NP)가 요구된다. However, the larger the number of divisions NP, the more load is generated in the shuffle operation. Due to this, overhead may increase in scheduling of the master 1100 of FIG. 1. That is, since the performance decreases at least when the number of divisions NP is too large, and the performance decreases even when the number of divisions NP is too large, an appropriate number of divisions NP is required.

도 5는 스레드 수(NT)가 작아서, 실행기 메모리(1215)의 사용 가능한 크기에 비하여 실행하는 데이터 양이 작은 경우의 동작을 설명하기 위한 도면이다. 도 5를 참조하면, 예시적으로 분할 수(NP)는 4이고, 스레드 수(NT)는 1인 것으로 가정한다. 하나의 RDD는 4개의 태스크들(T20~T23)로 분할되고, 하나의 태스크(T20)가 워커 노드(1200)에 출력될 수 있다. 하나의 태스크(T20)의 크기는 실행기 메모리(1215)의 사용 가능한 크기보다 작을 수 있다. 이 경우, 태스크들(T20, T21)이 실행되는 동안 데이터 스필 및 가비지 컬렉션이 발생하지 않을 수 있다.5 is a view for explaining an operation when the number of threads NT is small and the amount of data to be executed is small compared to the usable size of the executor memory 1215. Referring to FIG. 5, it is assumed that the number of divisions (NP) is 4 and the number of threads (NT) is 1. One RDD may be divided into four tasks T20 to T23, and one task T20 may be output to the worker node 1200. The size of one task T20 may be smaller than the usable size of the executor memory 1215. In this case, data spill and garbage collection may not occur while the tasks T20 and T21 are being executed.

다만, 워커 노드(1200)는 복수의 태스크들을 병렬로 처리할 수 있음에도, 하나의 태스크(T20)만을 처리하므로, 효율적인 태스크 처리를 수행하지 못할 수 있고, 전체의 태스크들을 처리하는데 소모되는 시간이 증가할 수 있다. 즉, 워커 노드(1200)의 성능이 제대로 활용되지 못할 수 있다.However, although the worker node 1200 can process a plurality of tasks in parallel, since it processes only one task T20, it may not be able to perform efficient task processing, and the time spent processing all tasks increases. can do. That is, the performance of the worker node 1200 may not be properly utilized.

도 6은 스레드 수(NT)가 커서, 실행기 메모리(1215)의 사용 가능한 크기에 비하여 태스크들의 크기가 큰 경우의 동작을 설명하기 위한 도면이다. 도 6을 참조하면, 예시적으로 분할 수(NP)는 4이고, 스레드 수(NT)는 4인 것으로 가정한다. 하나의 RDD는 4개의 태스크들(T20~T23)로 분할되고, 4개의 태스크들(T20~T23)은 병렬로 워커 노드(1200)에 출력될 수 있다. 4개의 태스크들(T20~T23) 전체의 크기는 실행기 메모리(1215)의 사용 가능한 크기보다 클 수 있다. 이 경우, 데이터 스필(data spill) 및 가비지 컬렉션이 발생할 수 있다.FIG. 6 is a diagram for describing an operation when the number of threads NT is large and the size of tasks is larger than the usable size of the executor memory 1215. Referring to FIG. 6, it is assumed that the number of divisions (NP) is 4 and the number of threads (NT) is 4 by way of example. One RDD may be divided into four tasks T20 to T23, and the four tasks T20 to T23 may be output to the worker node 1200 in parallel. The total size of the four tasks T20 to T23 may be larger than the usable size of the executor memory 1215. In this case, data spill and garbage collection may occur.

태스크들(T20~T23)의 크기가 실행기 메모리(1215)의 사용 가능한 공간보다 크므로, 태스크들(T20~T23)에 포함된 데이터의 일부가 실행기 메모리(1215)에서 로컬 디스크(1230)로 옮겨질 수 있다. 그리고, 태스크들(T20~T23)에 포함된 나머지 데이터가 실행기 메모리(1215)에 저장될 수 있다. 이에 따라, 태스크들(T20~T23)을 실행하기 위하여 데이터 스필 및 가비지 컬렉션이 발생되고, 인-메모리 프로세싱에 따른 성능 개선의 효과가 감소한다. 즉, 스레드 수(NT)가 너무 적은 경우 워크 노드(1200)의 성능이 활용되지 못하고, 너무 많은 경우 성능이 감소하므로, 적정한 스레드 수(NT)가 요구된다.Since the size of the tasks T20 to T23 is larger than the available space of the executor memory 1215, some of the data included in the tasks T20 to T23 is moved from the executor memory 1215 to the local disk 1230. I can lose. In addition, the remaining data included in the tasks T20 to T23 may be stored in the executor memory 1215. Accordingly, data spill and garbage collection are generated to execute the tasks T20 to T23, and the effect of improving performance due to in-memory processing decreases. That is, when the number of threads NT is too small, the performance of the work node 1200 cannot be utilized, and when the number of threads NT is too large, the performance decreases, so an appropriate number of threads NT is required.

도 7은 도 1의 분석 모듈을 구체화한 예시적인 블록도이다. 분석 모듈(1110)에 포함된 구성들은 소프트웨어, 또는 하드웨어, 또는 이의 조합의 형태로 구현될 수 있다. 예시적으로, 소프트웨어는 기계 코드, 펌웨어, 임베디드 코드, 및 애플리케이션 소프트웨어일 수 있다. 예를 들어, 하드웨어는 전기 회로, 전자 회로, 프로세서, 컴퓨터, 집적 회로, 집적 회로 코어들, 또는 이의 조합을 포함할 수 있다. 7 is an exemplary block diagram embodied in the analysis module of FIG. 1. Components included in the analysis module 1110 may be implemented in the form of software, hardware, or a combination thereof. Illustratively, the software may be machine code, firmware, embedded code, and application software. For example, the hardware may include an electrical circuit, an electronic circuit, a processor, a computer, an integrated circuit, integrated circuit cores, or a combination thereof.

도 7을 참조하면, 분석 모듈(1110)은 파라미터 생성기(1111) 및 파라미터 관리기(1114)를 포함할 수 있다. 파라미터 생성기(1111)는 작업에 대응되는 RDD 의존성 그래프로부터 단계들 각각의 분할 수(NP) 및 스레드 수(NT)를 예측할 수 있다. 이를 위하여, 파라미터 생성기(1111)는 초기 파라미터 계산기(1112) 및 파라미터 검색기(1113)를 포함할 수 있다.Referring to FIG. 7, the analysis module 1110 may include a parameter generator 1111 and a parameter manager 1114. The parameter generator 1111 may predict the number of divisions (NP) and the number of threads (NT) of each of the steps from the RDD dependency graph corresponding to the task. To this end, the parameter generator 1111 may include an initial parameter calculator 1112 and a parameter searcher 1113.

초기 파라미터 계산기(1112)는 단계들 각각의 MAF에 기초하여 초기 분할 수 및 초기 스레드 수를 계산할 수 있다. 도 2에 도시된 작업을 참조하여 설명하면, 초기 파라미터 계산기(1112)는 RDD 의존성 그래프로부터 사용 함수들(f1, f2)을 추출하고, 사용 함수들(f1, f2) 각각의 MAF를 검색할 수 있다. 이러한 MAF는 분석 모듈(1110)에 의하여 관리될 수 있다. 일례로, MAF는 도 8에서 후술될 선형 회귀 분석을 통하여 미리 마스터(도 1, 1100)의 메모리(미도시)에 저장될 수 있다. The initial parameter calculator 1112 may calculate an initial number of divisions and an initial number of threads based on the MAF of each of the steps. 2, the initial parameter calculator 1112 extracts the use functions f1 and f2 from the RDD dependency graph, and retrieves the MAF of each of the use functions f1 and f2. have. This MAF may be managed by the analysis module 1110. For example, the MAF may be previously stored in a memory (not shown) of the master (FIGS. 1, 1100) through linear regression analysis to be described later in FIG. 8.

일례로, 초기 파라미터 계산기(1112)는 검색된 MAF에 기초하여 단계들 각각에 대응되는 RDD들 중 가장 큰 크기를 갖는 RDD를 예측할 수 있다. 도 2에서 설명한 바와 같이, 사용 함수들(f1, f2)의 MAF에 따라 출력 RDD들(RDD1, RDD2)의 크기는 변화한다.For example, the initial parameter calculator 1112 may predict an RDD having the largest size among RDDs corresponding to each of the steps based on the searched MAF. As described with reference to FIG. 2, the sizes of the output RDDs RDD1 and RDD2 change according to the MAF of the use functions f1 and f2.

Figure 112019063777969-pat00001
Figure 112019063777969-pat00001

수학식 1을 참조하면, RDD의 최대 크기(RDDM)는 입력 데이터(일례로, 도 2의 입력RDD(RDD0))의 크기에 사용 함수들 각각의 MAF들을 곱하여 계산될 수 있다. 예를 들어, 하나의 단계에 2개의 사용 함수가 존재하고, 제1 사용 함수의 MAF가 1보다 크고, 제2 사용 함수의 MAF가 1보다 작은 경우, RDD의 최대 크기(RDDM)는 제1 사용 함수로부터 출력된 RDD의 크기와 같을 수 있다. Referring to Equation 1, the maximum size of RDD (RDDM) may be calculated by multiplying the size of input data (eg, input RDD (RDD0) of FIG. 2) by MAFs of each of the use functions. For example, when there are two usage functions in one step, the MAF of the first usage function is greater than 1, and the MAF of the second usage function is less than 1, the maximum size of RDD (RDDM) is the first usage It may be the same as the size of the RDD output from the function.

Figure 112019063777969-pat00002
Figure 112019063777969-pat00002

그리고, 수학식 2와 같이, 초기 파라미터 계산기(1112)는 워커 노드들(도 1의 1200~1400)의 사용 가능한 실행기 메모리(도 3 내지 도 6의 1215)의 크기(Execution memory) 및 RDD의 최대 크기(RDDM)에 기초하여 초기 분할 수(NP(i)) 및 초기 스레드 수(NT(i))를 계산할 수 있다. 사용 가능한 실행기 메모리의 크기는 분석 모듈(1110)에 의하여 관리될 수 있으며, 미리 마스터(도 1, 1100)의 메모리(미도시)에 저장될 수 있다. 일례로, 초기 스레드 수(NT(i))는 워커 노드들에 포함된 코어들의 개수와 같을 수 있다. 이 경우, 수학식 2를 통하여, 초기 분할 수(NP(i))도 계산될 수 있다. 초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))는 단계들마다 생성된다.And, as shown in Equation 2, the initial parameter calculator 1112 is the size of the available executor memory (1215 in FIGS. 3 to 6) of the worker nodes (1200 to 1400 in FIG. 1) and the maximum RDD. Based on the size RDDM, the initial number of divisions NP(i) and the number of initial threads NT(i) may be calculated. The size of the usable executor memory may be managed by the analysis module 1110, and may be stored in a memory (not shown) of the master (FIGS. 1, 1100) in advance. For example, the initial number of threads NT(i) may be equal to the number of cores included in worker nodes. In this case, through Equation 2, the initial number of divisions NP(i) may also be calculated. The initial number of threads (NT(i)) and the number of initial divisions (NP(i)) are generated for each step.

파라미터 검색기(1113)는 초기 파라미터 계산기(1112)로부터 계산된 초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))를 예측 실행 시간을 감소시키도록 조절할 수 있다. 여기에서, 예측 실행 시간은 초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))를 기준으로, 워커 노드들이 태스크들을 실행하는데 걸리는 예측 시간으로 정의된다.The parameter finder 1113 may adjust the initial number of threads NT(i) and the initial number of divisions NP(i) calculated from the initial parameter calculator 1112 to reduce the prediction execution time. Here, the predicted execution time is defined as a predicted time taken for worker nodes to execute tasks based on the initial number of threads (NT(i)) and the initial number of divisions (NP(i)).

Figure 112019063777969-pat00003
Figure 112019063777969-pat00003

수학식 3을 참조하면, 예측 실행 시간(ExecTime)은 RDD의 최대 크기(RDDM)를 분할 수(NP)로 나눈 크기, 데이터 스필에 따른 성능 저하 비용(ak), 및 분할 수(NP)를 스레드 수(NT)로 나눈 크기의 곱들에 비례할 수 있다. 여기에서, 데이터 스필에 따른 성능 저하 비용(ak)은 수학식 4와 같을 수 있다.Referring to Equation 3, the prediction execution time (ExecTime) is the size obtained by dividing the maximum size of the RDD (RDDM) by the number of divisions (NP), the cost of performance degradation according to data spill (a k ), and the number of divisions (NP). It can be proportional to the products of the size divided by the number of threads (NT). Here, the performance degradation cost (a k ) according to the data spill may be equal to Equation 4.

Figure 112019063777969-pat00004
Figure 112019063777969-pat00004

수학식 4를 참조하면, 앞서 계산된 RDD의 최대 크기(RDDM), 분할 수(NP) (초기 분할 수(NP(i)), 스레드 수(NT) (초기 스레드 수(NT(i)), 및 사용 가능한 실행기 메모리의 크기(Execution memory)로부터 데이터 스필에 따른 성능 저하 비용(ak)이 계산될 수 있다.Referring to Equation 4, the maximum size of RDD (RDDM), number of divisions (NP) (initial number of divisions (NP(i))), number of threads (NT) (initial number of threads (NT(i))), And from the size of the available executor memory (Execution memory), a performance degradation cost (a k ) according to data spill may be calculated.

파라미터 검색기(1113)는 수학식 3과 같은 비례 관계로부터, 예측 실행 시간(ExecTime)을 감소시키도록 초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))를 조절할 수 있다. 일례로, 파라미터 검색기(1113)는 도 9에서 설명될 경사 검색(Gradient Search)을 이용하여 스레드 수(NT) 및 분할 수(NP)를 결정할 수 있다.The parameter searcher 1113 may adjust the initial number of threads (NT(i)) and the initial number of divisions (NP(i)) to reduce the predicted execution time (ExecTime) from a proportional relationship as shown in Equation (3). For example, the parameter searcher 1113 may determine the number of threads NT and the number of divisions NP using a gradient search to be described in FIG. 9.

파라미터 관리기(1114)는 파라미터 생성기(1111)로부터 최종 결정된 단계별 스레드 수(NT) 및 분할 수(NP)를 관리한다. 일례로, 최종 결정된 단계별 스레드 수(NT) 및 분할 수(NP)는 룩업 테이블 형태로, 마스터(도 1, 1100)의 메모리(미도시)에 저장되고, 파라미터 관리기(1114)에 의하여 수정, 변경 등과 같이 관리될 수 있다. 일례로, 최종 결정된 단계별 스레드 수(NT) 및 분할 수(NP)는 RDD 의존성 그래프에 주석 첨가(Annotate)되어, RDD 의존성 그래프와 함께 관리될 수 있다.The parameter manager 1114 manages the number of step-by-step threads (NT) and the number of divisions (NP) finally determined from the parameter generator 1111. For example, the final determined number of step-by-step threads (NT) and divisions (NP) are stored in a memory (not shown) of the master (Fig. 1, 1100) in the form of a lookup table, and modified or changed by the parameter manager 1114 It can be managed as. As an example, the final determined number of step threads (NT) and division number (NP) may be annotated in the RDD dependency graph and managed together with the RDD dependency graph.

도 8은 도 7의 분석 모듈이 MAF를 검색하는 동작을 설명하기 위한 그래프이다. 도 8은 사용 함수별 MAF를 예시적으로 나타낸다. 예시적으로, 6개의 사용 함수들이 도시되나, 이에 제한되지 않고 다양한 사용 함수들이 더 추가될 수 있다. 도 8의 그래프들의 가로축은 사용 함수에 입력되는 RDD의 크기로 정의되고, 세로축은 사용 함수로부터 출력되는 RDD의 크기로 정의된다. 설명의 편의상, 도 1 및 도 7의 도면 부호를 참조하여 도 8이 설명된다.FIG. 8 is a graph for explaining an operation of the analysis module of FIG. 7 searching for a MAF. 8 exemplarily shows MAF for each use function. By way of example, six usage functions are shown, but various usage functions may be further added without being limited thereto. The horizontal axis of the graphs of FIG. 8 is defined as the size of RDD input to the use function, and the vertical axis is defined as the size of RDD output from the use function. For convenience of explanation, FIG. 8 is described with reference to reference numerals of FIGS. 1 and 7.

도 8을 참조하면, 사용 함수들 각각의 입력 RDD 크기 및 출력 RDD 크기가 수집될 수 있다. 마스터(1000)는 선형 회귀 분석을 통하여 입력 RDD의 크기에 따른 출력 RDD의 크기의 패턴을 분석할 수 있다. 이에 따라, 사용 함수들 각각의 입력 RDD 크기에 대한 출력 RDD 크기를 1차 함수로 나타낼 수 있다. 이러한 1차 함수의 기울기는 사용 함수의 메모리 부하 가중치, 즉 MAF일 수 있다. 예를 들어, Zip() 함수, MapValue() 함수의 기울기는 1보다 크므로, 대체적으로 RDD의 크기를 증가시키는 사용 함수로 이해될 것이다. 예를 들어, SortByKey() 함수의 기울기는 1로 표현되므로, 대체적으로 RDD의 크기를 거의 변화시키지 않는 사용 함수로 이해될 것이다. Join() 함수, GroupByKey() 함수, 및 Filter() 함수의 기울기는 1보다 작으므로, 대체적으로 RDD의 크기를 감소시키는 사용 함수로 이해될 것이다.Referring to FIG. 8, an input RDD size and an output RDD size of each of the use functions may be collected. The master 1000 may analyze a pattern of the size of the output RDD according to the size of the input RDD through linear regression analysis. Accordingly, the size of the output RDD relative to the size of the input RDD of each of the use functions may be expressed as a linear function. The slope of the linear function may be the weight of the memory load of the used function, that is, MAF. For example, since the slope of the Zip() function and the MapValue() function is greater than 1, it will be generally understood as a use function that increases the size of the RDD. For example, since the slope of the SortByKey() function is expressed as 1, it will be understood as a usage function that hardly changes the size of the RDD. Since the slopes of the Join() function, GroupByKey() function, and Filter() function are less than 1, it will be understood as a use function that generally reduces the size of RDD.

초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))는 작업에 포함된 단계들 각각의 RDD의 최대 크기(RDDM)를 이용하여 계산될 수 있다. 그리고, 수학식 1과 같이, RDD의 최대 크기(RDDM)는 단계들 각각에 포함된 사용 함수들의 MAF로부터 계산될 수 있다. 도 7의 초기 파라미터 계산기(1112)는 단계들 각각에 포함된 사용 함수들의 MAF를 검색하고, MAF에 기초하여 단계들 각각의 RDD의 최대 크기(RDDM)를 계산할 수 있다.The initial number of threads (NT(i)) and the number of initial divisions (NP(i)) may be calculated using the maximum size (RDDM) of the RDD of each of the steps included in the job. And, as shown in Equation 1, the maximum size (RDDM) of the RDD can be calculated from the MAFs of the use functions included in each of the steps. The initial parameter calculator 1112 of FIG. 7 may search for MAFs of use functions included in each of the steps, and calculate the maximum RDD size (RDDM) of each of the steps based on the MAF.

도 9는 도 7의 분석 모듈이 스레드 수 및 분할 수를 결정하는 동작을 설명하기 위한 그래프이다. 도 9는 초기 스레드 수(NT(i)) 및 초기 분할 수(NP(i))로부터 경사 검색(Gradient Search)을 이용하여 최종 스레드 수(NT(k)) 및 최종 분할 수(NP(k))를 생성하는 과정을 설명하기 위한 도면이다. 도 9의 그래프의 가로축은 분할 수(NP)로 정의되고, 세로축은 스레드 수(NT)로 정의된다. 설명의 편의상 도 1 및 도 7의 도면 부호를 참조하여 도 9가 설명된다.9 is a graph for explaining an operation of determining the number of threads and the number of divisions by the analysis module of FIG. 7. 9 shows a final number of threads (NT(k)) and a final number of divisions (NP(k) using a gradient search from the initial number of threads (NT(i)) and the initial number of divisions (NP(i)). ) Is a diagram for explaining the process of generating. The horizontal axis of the graph of FIG. 9 is defined as the number of divisions (NP), and the vertical axis is defined as the number of threads (NT). For convenience of explanation, FIG. 9 is described with reference to reference numerals of FIGS. 1 and 7.

분석 모듈(1110)은 초기 분할 수(NP(i)) 및 초기 스레드 수(NT(i)) 중 적어도 하나를 +1 또는 -1한 8개의 경우의 수를 검색할 수 있다. 그리고, 8개의 경우의 수들 각각의 예측 실행 시간이 초기 분할 수(NP(i)) 및 초기 스레드 수(NT(i))에 대응되는 예측 실행 시간과 비교될 수 있다. 비교 결과, 예측 실행 시간의 감소율이 가장 높은 분할 수 및 스레드 수가 선택될 수 있다. 일례로, 초기 분할 수(NP(i))보다 1 큰 분할 수가 제1 중간 분할 수(NP(i+1))로 선택되고, 초기 스레드 수(NT(i))와 같은 스레드 수가 제1 중간 스레드 수(NT(i+1))로 선택될 수 있다.The analysis module 1110 may search for the number of eight cases obtained by +1 or -1 at least one of the initial division number NP(i) and the initial thread number NT(i). In addition, the predicted execution time of each of the eight cases may be compared with the predicted execution time corresponding to the initial number of divisions NP(i) and the number of initial threads NT(i). As a result of the comparison, the number of divisions and the number of threads having the highest reduction rate of the prediction execution time may be selected. For example, the number of divisions greater than the initial number of divisions (NP(i)) is selected as the first intermediate number of divisions (NP(i+1)), and the number of threads equal to the number of initial threads (NT(i)) is selected as the first intermediate number It can be selected by the number of threads (NT(i+1)).

분석 모듈(1110)은 특정 조건을 만족할 때까지, 8개의 경우의 수를 계속적으로 검색할 수 있다. 일례로, 특정 조건은 8개의 경우의 수들 모두 예측 실행 시간의 감소율이 기준 비율(일례로, 20%)를 넘지 않는 경우일 수 있다. 일례로, 특정 조건은 8개의 경우의 수들의 데이터 스필에 따른 성능 저하 비용(수학식 4의 ak)이 차이가 없는 경우일 수 있다. 분석 모듈(1110)은 제2 중간 분할 수(NP(i+2)) 및 제2 중간 스레드 수(NT(i+2)) 등을 거쳐 특정 조건을 만족하는 분할 수 및 스레드 수를 최종 분할 수(NP(k)) 및 최종 스레드 수(NP(k))로 결정할 수 있다. 최종 분할 수(NP(k)) 및 최종 스레드 수(NP(k))는 단계에 대응되는 RDD를 분할하고, 워커 노드들로 출력할 때, 이용된다.The analysis module 1110 may continuously search the number of eight cases until a specific condition is satisfied. As an example, a specific condition may be a case in which the reduction rate of the prediction execution time does not exceed a reference ratio (for example, 20%) in all of the eight cases. As an example, a specific condition may be a case where there is no difference in performance degradation cost (a k in Equation 4) according to data spill of the number of eight cases. The analysis module 1110 determines the number of divisions and the number of threads satisfying a specific condition through a second number of intermediate divisions (NP(i+2)) and a second number of intermediate threads (NT(i+2)). It can be determined by (NP(k)) and the number of final threads (NP(k)). The final division number (NP(k)) and the final number of threads (NP(k)) are used when dividing the RDD corresponding to the step and outputting it to worker nodes.

도 10은 도 1의 분산 처리 시스템이 태스크들을 스케줄링하는 동작을 설명하기 위한 그래프이다. 도 10은 도 7 내지 도 9를 통하여 분석 모듈(1110)로부터 예측된 분할 수(NP) 및 스레드 수(NT)에 기초하여 태스크들이 스케줄링되어 워커 노드들로 출력되고, 가비지 컬렉션 시간에 기초하여 스레드 수(NT)를 조절하는 동작을 설명하기 위한 도면이다. 도 10의 그래프의 가로축은 시간으로 정의되고, 세로축은 스레드로 정의된다. 설명의 편의상 도 1의 도면 부호를 참조하여 도 10이 설명된다.10 is a graph for explaining an operation of scheduling tasks by the distributed processing system of FIG. 1. 10 shows tasks are scheduled based on the number of divisions (NP) and the number of threads (NT) predicted from the analysis module 1110 through FIGS. 7 to 9 and output to worker nodes, and threads based on garbage collection time It is a diagram for explaining the operation of adjusting the number (NT). The horizontal axis of the graph of FIG. 10 is defined as time, and the vertical axis is defined as threads. For convenience of explanation, FIG. 10 is described with reference to the reference numerals of FIG. 1.

도 10을 참조하면, 예시적으로, 분석 모듈(1110)은 제1 단계의 분할 수(NP)를 10으로 예측하고, 스레드 수(NT)를 4로 예측한 것으로 가정한다. 또한, 분석 모듈(1110)은 제2 단계의 분할 수(NP)를 14로 예측하고, 스레드 수(NT)를 5로 예측한 것으로 가정한다. 이 경우, DAG 스케줄러(1120)는 제1 단계에 대응되는 RDD를 10개의 태스크들(T0~T9)로 분할하고, 제2 단계에 대응되는 RDD를 14개의 태스크들(T0~T13)로 분할한다.Referring to FIG. 10, as an example, it is assumed that the analysis module 1110 predicts the number of divisions (NP) of the first step as 10 and the number of threads (NT) as 4. In addition, it is assumed that the analysis module 1110 predicts the number of divisions NP in the second step as 14 and the number of threads NT as 5. In this case, the DAG scheduler 1120 divides the RDD corresponding to the first step into 10 tasks T0 to T9, and divides the RDD corresponding to the second step into 14 tasks T0 to T13. .

태스크 스케줄러(1130)는 제1 단계의 스레드 수(NT)와 같은 4개의 태스크들(T0~T3)을 워커 노드들(1200~1400)로 출력할 수 있다. 워커 노드들(1200~1400)은 4개의 태스크들(T0~T3)의 실행 시간을 측정할 수 있다. 그리고, 워커 노드들(1200~1400)은 태스크들(T0~T3)에 의하여 가비지 컬렉션이 발생한 경우, 가비지 컬렉션 시간을 측정할 수 있다. 측정된 실행 시간 및 가비지 컬렉션 시간은 태스크 스케줄러(1130)로 제공된다.The task scheduler 1130 may output four tasks T0 to T3 equal to the number of threads NT in the first step to the worker nodes 1200 to 1400. The worker nodes 1200 to 1400 may measure execution times of the four tasks T0 to T3. In addition, the worker nodes 1200 to 1400 may measure the garbage collection time when garbage collection occurs due to the tasks T0 to T3. The measured execution time and garbage collection time are provided to the task scheduler 1130.

가비지 컬렉션이 발생하지 않았거나, 실행 시간에 대한 가비지 컬렉션 시간의 비율이 기준 비율보다 작은 경우, 태스크 스케줄러(1130)는 스레드 수(NT)를 증가시킬 수 있다. 여기에서, 기준 비율은 태스크들을 저장 및 실행하기에 충분한 메모리 공간이 확보된 것으로 판단되는 상한을 의미할 수 있다. 예시적으로, 4개의 태스크들(T0~T3)에 의하여, 가비지 컬렉션이 발생되지 않은 경우, 태스크 스케줄러는 스레드 수(NT)를 증가시킬 수 있다. 스레드 수(NT)는 2배로 증가될 수 있으나, 이에 제한되지 않고, 기설정된 개수가 스레드 수(NT)에 더하여질 수도 있다.When garbage collection has not occurred or the ratio of the garbage collection time to the execution time is smaller than the reference ratio, the task scheduler 1130 may increase the number of threads NT. Here, the reference ratio may mean an upper limit at which it is determined that sufficient memory space for storing and executing tasks is secured. For example, when garbage collection is not generated by the four tasks T0 to T3, the task scheduler may increase the number of threads NT. The number of threads NT may be doubled, but is not limited thereto, and a preset number may be added to the number of threads NT.

스레드 수(NT)가 증가된 결과, 병렬로 출력되는 태스크들의 개수가 증가할 수 있다. 태스크가 실행 완료된 순서대로 추가적인 태스크들이 워커 노드들(1200~1400)로 출력될 수 있다. 4개의 태스크들(T0~T3) 모두 가비지 컬렉션에 의한 성능 저하가 발생되지 않은 것으로 판단된 제1 시간(t1) 이후에, 일례로, 스레드 수(NT)가 2배인 8로 조절될 수 있다. 최대 8개의 태스크들이 병렬로 출력 가능하므로, 제1 시간(t1) 기준으로 이미 출력된 3개의 태스크들(T4~T6)과 병렬로, 3개의 나머지 태스크들(T7~T9)이 더 출력될 수 있다.As a result of an increase in the number of threads NT, the number of tasks output in parallel may increase. Additional tasks may be output to the worker nodes 1200 to 1400 in the order in which tasks are executed. After the first time t1 when it is determined that performance deterioration due to garbage collection has not occurred in all of the four tasks T0 to T3, for example, the number of threads NT may be adjusted to 8, which is twice. Since up to eight tasks can be output in parallel, three remaining tasks (T7 to T9) can be output in parallel with the three tasks (T4 to T6) already output based on the first time (t1). have.

이후에, 태스크 스케줄러(1130)는 제2 단계의 스레드 수(NT)와 같은 5개의 태스크들(T0~T4)을 워커 노드들(1200~1400)로 출력할 수 있다. 워커 노드들(1200~1400)은 5개의 태스크들(T0~T4)의 실행 시간 및 가비지 컬렉션 시간을 측정할 수 있다. 예시적으로, 제2 단계에서, 5개의 태스크들(T0~T4)에 의하여 가비지 컬렉션이 발생된 것으로 가정한다. 태스크 스케줄러(1130)는 가비지 컬렉션에 의하여 워커 노드들(1200~1400)의 성능 저하가 발생된 것으로 판단할 수 있다. 이에 따라, 태스크 스케줄러(1130)는 스레드 수(NT)를 감소시킬 수 있다. 일례로, 스레드 수(NT)는 -1로 감소될 수 있으나, 이에 제한되지 않는다.Thereafter, the task scheduler 1130 may output five tasks T0 to T4 equal to the number of threads NT of the second step to the worker nodes 1200 to 1400. The worker nodes 1200 to 1400 may measure execution times and garbage collection times of the five tasks T0 to T4. For example, in the second step, it is assumed that garbage collection is generated by five tasks T0 to T4. The task scheduler 1130 may determine that performance degradation of the worker nodes 1200 to 1400 has occurred due to garbage collection. Accordingly, the task scheduler 1130 may reduce the number of threads NT. For example, the number of threads NT may be reduced to -1, but is not limited thereto.

스레드 수(NT)가 4로 감소된 결과, 5개의 태스크들(T0~T4) 모두 실행된 제2 시간(t2) 이후에, 태스크 9(T9)가 출력되지 않을 수 있다. 즉, 태스크 4(T4)에 뒤이어 태스크 9(T9)가 마스터(1100)로부터 출력되지 않고, 4개의 병렬성이 유지될 수 있다. 그리고, 4개의 태스크들(T5~T8)의 실행 시간 및 가비지 컬렉션 시간이 다시 측정될 수 있다. 4개의 태스크들(T5~T8)에 의하여 가비지 컬렉션이 발생되고, 성능 저하가 발생된 것으로 판단되는 경우, 스레드 수(NT)는 다시 감소할 수 있다. As a result of the number of threads NT being reduced to 4, the task 9 (T9) may not be output after the second time t2 in which all of the five tasks T0 to T4 have been executed. That is, after the task 4 (T4), the task 9 (T9) is not output from the master 1100, and four parallelism can be maintained. In addition, the execution time and the garbage collection time of the four tasks T5 to T8 may be measured again. When it is determined that garbage collection is generated by the four tasks T5 to T8 and performance degradation has occurred, the number of threads NT may decrease again.

스레드 수(NT)가 3으로 감소된 결과, 4개의 태스크들(T5~T8) 모두 실행된 제3 시간(t3) 이후에, 태스크 12(T12)가 출력되지 않을 수 있다. 즉, 태스크 8(T8)에 뒤이어 태스크 12(T12)가 마스터(1100)로부터 출력되지 않고, 3개의 병렬성이 유지될 수 있다. As a result of the number of threads NT being reduced to 3, the task 12 (T12) may not be output after the third time (t3) in which all four tasks T5 to T8 have been executed. That is, the task 12 (T12) is not output from the master 1100 following the task 8 (T8), and three parallelisms can be maintained.

즉, 태스크 스케줄러(1130)는 워커 노드들(1200~1400)에서 발생되는 가비지 컬렉션 유무 또는 시간에 기초하여 스레드 수를 런 타임 중에 계속적으로 최적화할 수 있다. 따라서, 분산 처리 시스템(1000)의 태스크 처리 속도가 증가하고, 워커 노드들(1200~1400)의 메모리 부하에 따른 성능 저하가 감소할 수 있다.That is, the task scheduler 1130 may continuously optimize the number of threads during run time based on the presence or time of garbage collection generated in the worker nodes 1200 to 1400. Accordingly, a task processing speed of the distributed processing system 1000 may increase, and performance degradation due to a memory load of the worker nodes 1200 to 1400 may decrease.

도 11은 도 1의 분산 처리 시스템의 동작 방법의 예시적인 순서도이다. 도 11의 동작 방법은 분산 처리 시스템(1000)의 마스터(1100) 또는 워커 노드들(1200~1400)에 의하여 수행될 수 있다. 설명의 편의상, 도 1의 도면 부호를 참조하여 도 11이 설명된다.11 is an exemplary flow chart of a method of operating the distributed processing system of FIG. 1. The operation method of FIG. 11 may be performed by the master 1100 of the distributed processing system 1000 or the worker nodes 1200 to 1400. For convenience of explanation, FIG. 11 is described with reference to reference numerals in FIG. 1.

S110 단계에서, 마스터(1100)의 분석 모듈(1110)은 분할 수 및 스레드 수를 예측한다. 분석 모듈(1110)은 작업(job)에 포함되는 단계(stage)들 각각에 대한 분할 수 및 스레드 수를 예측할 수 있다. 분석 모듈(1110)은 단계들 각각의 사용 함수들의 MAF에 기초하여 분할 수 및 스레드 수를 예측할 수 있다. 일례로, 분석 모듈(1110)은 도 7에서 설명한 바와 같이, 사용 함수들 각각의 MAF에 기초하여 단계에 대응되는 데이터의 최대 크기를 계산하고, 이러한 최대 크기 및 워커 노드들(1200~1400)의 사용 가능한 메모리의 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산할 수 있다. 그리고, 분석 모듈(1110)은 워커 노드들(1200~1400)의 예측 실행 시간에 기초하여 초기 분할 수 및 초기 스레드 수를 조절함으로써, 분할 수 및 스레드 수를 결정할 수 있다.In step S110, the analysis module 1110 of the master 1100 predicts the number of divisions and the number of threads. The analysis module 1110 may predict the number of divisions and the number of threads for each of the stages included in the job. The analysis module 1110 may predict the number of divisions and the number of threads based on the MAF of the use functions of each of the steps. As an example, the analysis module 1110 calculates the maximum size of data corresponding to the step based on the MAF of each of the use functions, as described in FIG. 7, and the maximum size and the worker nodes 1200 to 1400 The initial number of partitions and the number of initial threads can be calculated based on the size of the available memory. Further, the analysis module 1110 may determine the number of divisions and the number of threads by adjusting the initial number of divisions and the number of initial threads based on the predicted execution time of the worker nodes 1200 to 1400.

S120 단계에서, DAG 스케줄러(1120)는 S110 단계에서 결정된 분할 수에 기초하여 데이터(RDD)를 태스크들로 분할할 수 있다. 분할되는 태스크들의 개수는 분할 수와 같을 수 있다.In step S120, the DAG scheduler 1120 may divide the data RDD into tasks based on the number of divisions determined in step S110. The number of divided tasks may be equal to the number of divisions.

S130 단계에서, 태스크 스케줄러(1130)는 분할된 태스크들 중 적어도 일부를 워커 노드들(1200~1400)로 출력할 수 있다. 태스크 스케줄러(1130)는 S110 단계에서 결정된 스레드 수만큼 병렬성을 갖도록 태스크들 중 적어도 일부를 출력할 수 있다. 출력된 태스크들은 워커 노드들(1200~1400)에서 실행된다.In step S130, the task scheduler 1130 may output at least some of the divided tasks to the worker nodes 1200 to 1400. The task scheduler 1130 may output at least some of the tasks so as to have parallelism as much as the number of threads determined in step S110. The output tasks are executed in the worker nodes 1200 to 1400.

S140 단계에서, 워커 노드들(1200~1400)은 S130 단계에서 출력된 태스크들을 실행하는 동안 실행 시간 및 가비지 컬렉션 시간을 측정할 수 있다. 태스크의 크기가 워커 노드들(1200~1400)에 포함된 실행기 메모리의 사용 가능한 크기보다 큰 경우, 데이터 스필 및 가비지 컬렉션이 발생할 수 있다. 워커 노드들(1200~1400)은 가비지 컬렉션이 발생한 경우, 가비지 컬렉션을 수행한 시간을 측정할 수 있다. 워커 노드들(1200~1400)은 측정된 실행 시간 및 가비지 컬렉션 시간을 태스크 스케줄러(1130)로 제공할 수 있다. In step S140, the worker nodes 1200 to 1400 may measure an execution time and a garbage collection time while executing the tasks output in step S130. When the size of the task is larger than the usable size of the executor memory included in the worker nodes 1200 to 1400, data spill and garbage collection may occur. When the garbage collection occurs, the worker nodes 1200 to 1400 may measure the time at which garbage collection is performed. The worker nodes 1200 to 1400 may provide the measured execution time and garbage collection time to the task scheduler 1130.

S150 단계에서, 태스크 스케줄러(1130)는 실행 시간 및 가비지 컬렉션 시간에 기초하여 스레드 수를 조절할 수 있다. 일례로, 실행 시간에 대한 가비지 컬렉션 시간의 비율이 기준 비율보다 큰 경우, 태스크 스케줄러(1130)는 스레드 수를 감소시켜, 병렬로 출력되는 태스크들의 크기를 감소시킬 수 있다. 일례로, 실행 시간들에 대한 가비지 컬렉션 시간들의 비율이 기준 비율보다 작은 경우, 태스크 스케줄러(1130)는 스레드 수를 증가시킬 수 있다.In step S150, the task scheduler 1130 may adjust the number of threads based on the execution time and the garbage collection time. For example, when the ratio of the garbage collection time to the execution time is greater than the reference ratio, the task scheduler 1130 may reduce the size of tasks output in parallel by reducing the number of threads. For example, when a ratio of garbage collection times to execution times is less than a reference ratio, the task scheduler 1130 may increase the number of threads.

S160 단계에서, 마스터(1100)는 작업이 완료되었는지 판단하고, 작업이 완료되지 않은 경우, 남은 태스크들을 출력하기 위하여 S130 단계로 돌아갈 수 있다. S130 단계에서, 태스크 스케줄러(1130)는 S150 단계에서 조절된 스레드 수만큼 병렬성을 갖도록 태스크들 중 적어도 일부를 출력할 수 있다. S130 내지 S150 단계는 작업이 완료될 때까지 반복될 수 있다.In step S160, the master 1100 determines whether the work is completed, and if the work is not completed, it may return to step S130 to output the remaining tasks. In step S130, the task scheduler 1130 may output at least some of the tasks so as to have parallelism by the number of threads adjusted in step S150. Steps S130 to S150 may be repeated until the operation is completed.

도 12는 도 11의 S110 단계를 구체화한 순서도이다. 도 12의 S111 내지 S114 단계들은 도 1의 분석 모듈(1110)에 의하여 수행될 수 있다. 설명의 편의상, 도 1의 도면 부호를 참조하여, 도 12가 설명된다.12 is a flowchart illustrating step S110 of FIG. 11. Steps S111 to S114 of FIG. 12 may be performed by the analysis module 1110 of FIG. 1. For convenience of explanation, FIG. 12 is described with reference to the reference numerals in FIG. 1.

S111 단계에서, 분석 모듈(1110)은 단계들 각각의 사용 함수들에 대응되는 MAF를 검색할 수 있다. 도 8에서 설명한 바와 같이, 분석 모듈(1110)은 선형 회귀 분석을 통하여 사용 함수들 각각의 MAF를 관리할 수 있다. 사용자 프로그램이 마스터(1100)에 제공됨에 따라, 작업이 생성될 수 있고, DAG 스케줄러(1120)는 작업에 대한 RDD 의존성 그래프를 생성할 수 있다. 분석 모듈(1110)은 RDD 의존성 그래프로부터 사용 함수들을 추출하고, 사용 함수들 각각의 MAF를 검색할 수 있다.In step S111, the analysis module 1110 may search for MAFs corresponding to the use functions of each of the steps. As described in FIG. 8, the analysis module 1110 may manage the MAF of each of the used functions through linear regression analysis. As the user program is provided to the master 1100, a task may be created, and the DAG scheduler 1120 may generate an RDD dependency graph for the task. The analysis module 1110 may extract usage functions from the RDD dependency graph and retrieve MAFs of each of the usage functions.

S112 단계에서, 분석 모듈(1110)은 검색된 MAF에 기초하여 단계들 각각에 대응되는 최대 데이터 크기, 즉 RDD의 최대 크기를 계산할 수 있다. MAF는 사용 함수의 입력 데이터의 크기에 대한 출력 데이터의 크기의 비율을 나타내므로, 입력 데이터의 크기에 MAF를 적용함으로써, RDD의 최대 크기가 계산될 수 있다. RDD의 최대 크기는 상술된 수학식 1과 같이 계산될 수 있다.In step S112, the analysis module 1110 may calculate a maximum data size corresponding to each of the steps, that is, a maximum size of an RDD, based on the searched MAF. Since MAF represents the ratio of the size of the output data to the size of the input data of the use function, the maximum size of the RDD can be calculated by applying the MAF to the size of the input data. The maximum size of the RDD can be calculated as in Equation 1 described above.

S113 단계에서, 분석 모듈(1110)은 S112 단계에서 계산된 RDD의 최대 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산할 수 있다. 상술된 수학식 2와 같이, 분석 모듈(1110)은 워커 노드들(1200~1400)의 사용 가능한 실행기 메모리의 크기 및 RDD의 최대 크기에 기초하여 단계들 각각의 초기 분할 수 및 초기 스레드 수를 계산할 수 있다.In step S113, the analysis module 1110 may calculate the initial number of divisions and the number of initial threads based on the maximum size of the RDD calculated in step S112. As shown in Equation 2 above, the analysis module 1110 may calculate the initial number of divisions and the number of initial threads of each of the steps based on the size of the available executor memory and the maximum size of the RDD of the worker nodes 1200 to 1400. I can.

S114 단계에서, 분석 모듈(1110)은 초기 분할 수 및 초기 스레드 수를 조절할 수 있다. 상술된 수학식 3, 수학식 4, 및 도 9와 같이, 분석 모듈(1110)은 예측 실행 시간이 감소하도록, 경사 검색을 이용하여 초기 분할 수 및 초기 스레드 수를 조절할 수 있다. 일례로, 분석 모듈(1110)은 예측 실행 시간의 감소율이 기준 비율을 넘지 않을 때까지 분할 수 및 스레드 수 중 적어도 하나를 조절할 수 있다. 이러한 조절 결과, 분석 모듈(1110)은 최종 분할 수 및 최종 스레드 수를 결정할 수 있다. 결정된 최종 분할 수 및 최종 스레드 수는 도 11의 S120 단계 및 S130 단계를 수행하는데 이용된다.In step S114, the analysis module 1110 may adjust the initial number of divisions and the number of initial threads. As shown in Equation 3, Equation 4, and FIG. 9, the analysis module 1110 may adjust the initial number of divisions and the number of initial threads using gradient search so as to decrease the prediction execution time. For example, the analysis module 1110 may adjust at least one of the number of divisions and the number of threads until the reduction rate of the prediction execution time does not exceed the reference ratio. As a result of this adjustment, the analysis module 1110 may determine the final number of divisions and the number of final threads. The determined final number of divisions and the number of final threads are used to perform steps S120 and S130 of FIG. 11.

도 13은 도 11의 S150 단계를 구체화한 순서도이다. 도 13의 S151 내지 S155 단계들은 도 1의 태스크 스케줄러(1130)에 의하여 수행될 수 있다. 설명의 편의상, 도 1의 도면 부호를 참조하여 도 13이 설명된다.13 is a flowchart illustrating step S150 of FIG. 11. Steps S151 to S155 of FIG. 13 may be performed by the task scheduler 1130 of FIG. 1. For convenience of explanation, FIG. 13 will be described with reference to the reference numerals of FIG. 1.

S151 단계에서, 태스크 스케줄러(1130)는 워커 노드들(1200~1400)로부터 가비지 컬렉션 시간 및 실행 시간을 수신한다.In step S151, the task scheduler 1130 receives a garbage collection time and an execution time from the worker nodes 1200 to 1400.

S152 단계에서, 태스크 스케줄러(1130)는 실행 시간에 대한 가비지 컬렉션 시간의 비율을 제1 비율과 비교할 수 있다. 여기에서, 제1 비율은 태스크들을 저장 및 실행하기에 충분한 메모리 공간이 확보되지 못하여, 실행시간 대비 가비지 컬렉션 시간이 길다고 인정되는 하한을 의미할 수 있다. In step S152, the task scheduler 1130 may compare the ratio of the garbage collection time to the execution time with the first ratio. Here, the first ratio may refer to a lower limit in which a memory space sufficient for storing and executing tasks is not secured, and thus a garbage collection time compared to an execution time is recognized as long.

실행 시간에 대한 가비지 컬렉션 시간의 비율이 제1 비율보다 큰 경우, 태스크 스케줄러(1130)는 가비지 컬렉션에 의하여 워커 노드들(1200~1400)의 성능 저하가 발생된 것으로 판단할 수 있다. 따라서, S155 단계가 진행된다. 실행 시간에 대한 가비지 컬렉션 시간의 비율이 제1 비율보다 크지 않은 경우, S153 단계가 진행된다.When the ratio of the garbage collection time to the execution time is greater than the first ratio, the task scheduler 1130 may determine that performance degradation of the worker nodes 1200 to 1400 has occurred due to garbage collection. Therefore, step S155 proceeds. If the ratio of the garbage collection time to the execution time is not greater than the first ratio, step S153 proceeds.

S153 단계에서, 태스크 스케줄러(1130)는 이전 가비지 컬렉션 시간에 대한 현재 가비지 컬렉션 시간의 비율을 제2 비율과 비교할 수 있다. 여기에서, 제2 비율은 직전 태스크들이 실행될 때와 비교하여 비정상적으로 가비지 컬렉션 시간이 길어졌다고 인정되는 하한을 의미할 수 있다. In step S153, the task scheduler 1130 may compare the ratio of the current garbage collection time to the previous garbage collection time with the second ratio. Here, the second ratio may mean a lower limit at which it is recognized that the garbage collection time is abnormally longer compared to when the immediately previous tasks are executed.

이전 가비지 컬렉션 시간에 대한 현재 가비지 컬렉션 시간의 비율이 제2 비율보다 큰 경우, 태스크 스케줄러(1130)는 직전 동작과 비교하여 가비지 컬렉션이 과도하게 발생하여 워커 노드들(1200~1400)의 성능 저하가 발생된 것으로 판단할 수 있다. 따라서, S155 단계가 진행된다. 이전 가비지 컬렉션 시간에 대한 현재 가비지 컬렉션 시간의 비율이 제2 비율보다 크지 않은 경우, 태스크 스케줄러(1130)는 워커 노드들(1200~1400)에 충분한 메모리 공간이 존재하는 것으로 판단할 수 있다. 따라서, S154 단계가 진행된다.When the ratio of the current garbage collection time to the previous garbage collection time is greater than the second ratio, the task scheduler 1130 generates excessive garbage collection compared to the previous operation, resulting in a decrease in performance of the worker nodes 1200-1400. It can be determined that it has occurred. Therefore, step S155 proceeds. When the ratio of the current garbage collection time to the previous garbage collection time is not greater than the second ratio, the task scheduler 1130 may determine that sufficient memory space exists in the worker nodes 1200 to 1400. Therefore, step S154 proceeds.

S154 단계에서, 태스크 스케줄러(1130)는 스레드 수를 증가시킨다. 즉, 태스크 스케줄러(1130)는 병렬로 출력되는 태스크들의 개수를 증가시켜, 작업의 처리 동작 시간을 감소시킬 수 있다. In step S154, the task scheduler 1130 increases the number of threads. That is, the task scheduler 1130 may increase the number of tasks that are output in parallel, thereby reducing the operation time for processing a task.

S155 단계에서, 태스크 스케줄러(1130)는 스레드 수를 감소시킨다. 즉, 태스크 스케줄러(1130)는 병렬로 출력되는 태스크들의 개수를 감소시켜, 워커 노드들(1200~1400)의 성능 저하를 개선할 수 있다. In step S155, the task scheduler 1130 reduces the number of threads. That is, the task scheduler 1130 may reduce the number of tasks output in parallel, thereby improving performance degradation of the worker nodes 1200-1400.

상술된 내용은 본 발명을 실시하기 위한 구체적인 실시 예들이다. 본 발명은 상술된 실시 예들뿐만 아니라, 단순하게 설계 변경되거나 용이하게 변경할 수 있는 실시 예들 또한 포함할 것이다. 또한, 본 발명은 실시 예들을 이용하여 용이하게 변형하여 실시할 수 있는 기술들도 포함될 것이다. 따라서, 본 발명의 범위는 상술된 실시 예들에 국한되어 정해져서는 안되며 후술하는 특허청구범위뿐만 아니라 이 발명의 특허청구범위와 균등한 것들에 의해 정해져야 할 것이다.The above-described contents are specific examples for carrying out the present invention. The present invention will include not only the above-described embodiments, but also embodiments that can be simply changed or easily changed. In addition, the present invention will also include techniques that can be easily modified and implemented using the embodiments. Therefore, the scope of the present invention is limited to the above-described embodiments and should not be defined, and should be determined by the claims and equivalents of the present invention as well as the claims to be described later.

1000: 분산 처리 시스템 1100: 마스터
1110: 분석 모듈 1120: DAG 스케줄러
1130: 태스크 스케줄러 1200, 1300, 1400: 워커 노드
1210, 1310, 1410: 실행기 1215: 실행기 메모리
1230: 로컬 디스크
1000: distributed processing system 1100: master
1110: analysis module 1120: DAG scheduler
1130: task scheduler 1200, 1300, 1400: worker node
1210, 1310, 1410: Launcher 1215: Launcher memory
1230: local disk

Claims (20)

복수의 단계(stage)들을 포함하는 작업(job)에서의 사용 함수들 각각에 대한 메모리 부하 가중치에 기초하여 상기 복수의 단계들 각각의 분할 수 및 스레드 수를 생성하고, 상기 복수의 단계들 각각의 데이터를 상기 분할 수만큼의 태스크들로 분할하고, 상기 태스크들을 상기 스레드 수만큼 병렬로 출력하는 마스터; 및
상기 출력된 태스크들을 실행하고, 상기 태스크들을 실행하는 동안의 가비지 컬렉션 시간을 측정하는 적어도 하나의 워커 노드를 포함하되,
상기 마스터는 상기 가비지 컬렉션 시간에 기초하여 상기 스레드 수를 조절하는 분산 처리 시스템.
The number of divisions and the number of threads of each of the plurality of steps are generated based on a memory load weight for each of the functions used in a job including a plurality of stages, and each of the plurality of stages is A master for dividing data into tasks by the number of divisions and outputting the tasks in parallel by the number of threads; And
At least one worker node that executes the output tasks and measures a garbage collection time during execution of the tasks,
The master is a distributed processing system that adjusts the number of threads based on the garbage collection time.
제1 항에 있어서,
상기 마스터는,
상기 메모리 부하 가중치에 기초하여 상기 복수의 단계들에서 상기 사용 함수들에 의하여 변경되는 데이터의 최대 크기를 계산하고, 상기 최대 크기에 기초하여 상기 분할 수 및 상기 스레드 수를 예측하는 분석 모듈을 포함하는 분산 처리 시스템.
The method of claim 1,
The master,
Comprising an analysis module for calculating a maximum size of data changed by the use functions in the plurality of steps based on the memory load weight, and predicting the number of divisions and the number of threads based on the maximum size Distributed processing system.
제2 항에 있어서,
상기 분석 모듈은,
상기 데이터의 상기 최대 크기 및 상기 적어도 하나의 워커 노드의 사용 가능한 메모리 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산하고, 상기 초기 분할 수 및 상기 초기 스레드 수 중 적어도 하나를 변경하여 상기 분할 수 및 상기 스레드 수를 결정하는 파라미터 생성기를 포함하는 분산 처리 시스템.
The method of claim 2,
The analysis module,
An initial number of divisions and an initial number of threads are calculated based on the maximum size of the data and the available memory size of the at least one worker node, and the number of divisions by changing at least one of the initial number of divisions and the number of initial threads And a parameter generator for determining the number of threads.
제3 항에 있어서,
상기 초기 스레드 수는 상기 적어도 하나의 워커 노드에 포함된 코어의 개수에 의존하는 분산 처리 시스템.
The method of claim 3,
The initial number of threads depends on the number of cores included in the at least one worker node.
제3 항에 있어서,
상기 초기 분할 수는 상기 초기 스레드 수 및 상기 데이터의 상기 최대 크기의 곱에 상기 사용 가능한 메모리 크기를 나눈 값에 의존하는 분산 처리 시스템.
The method of claim 3,
The initial partition number is dependent on a product of the initial number of threads and the maximum size of the data divided by the usable memory size.
제3 항에 있어서,
상기 파라미터 생성기는,
상기 초기 분할 수 및 상기 초기 스레드 수에 대응되는 태스크들의 예측 실행 시간을 계산하고, 상기 초기 분할 수 및 상기 초기 스레드 수 중 적어도 하나를 변경할 때의 상기 예측 실행 시간의 감소율에 기초하여 상기 분할 수 및 상기 스레드 수를 결정하는 분산 처리 시스템.
The method of claim 3,
The parameter generator,
The number of divisions is calculated based on a reduction rate of the predicted execution time when the initial number of divisions and the predicted execution time of tasks corresponding to the number of initial threads are calculated, and at least one of the initial number of divisions and the number of initial threads is changed, and Distributed processing system for determining the number of threads.
제6 항에 있어서,
상기 파라미터 생성기는,
상기 예측 실행 시간의 상기 감소율이 기준 비율보다 작을 때까지 상기 초기 분할 수 및 상기 초기 스레드 수 중 적어도 하나를 변경하여, 상기 분할 수 및 상기 스레드 수를 결정하는 분산 처리 시스템.
The method of claim 6,
The parameter generator,
A distributed processing system configured to determine the number of divisions and the number of threads by changing at least one of the initial number of divisions and the number of initial threads until the reduction rate of the prediction execution time is less than a reference ratio.
제1 항에 있어서,
상기 마스터는,
상기 태스크들 중 상기 스레드 수만큼의 태스크들을 상기 적어도 하나의 워커 노드로 출력하고, 상기 출력된 태스크들을 실행하는 동안의 가비지 컬렉션 시간들에 기초하여 상기 스레드 수를 조절하는 태스크 스케줄러를 포함하는 분산 처리 시스템.
The method of claim 1,
The master,
Distributed processing including a task scheduler that outputs tasks as many as the number of threads among the tasks to the at least one worker node and adjusts the number of threads based on garbage collection times during execution of the output tasks system.
제8 항에 있어서,
상기 태스크 스케줄러는,
상기 출력된 태스크들 각각의 실행 시간들에 대한 상기 가비지 컬렉션 시간들의 비율이 기준 비율보다 큰 경우, 상기 스레드 수를 감소시키는 분산 처리 시스템.
The method of claim 8,
The task scheduler,
When a ratio of the garbage collection times to execution times of each of the output tasks is greater than a reference ratio, the number of threads is reduced.
제8 항에 있어서,
상기 태스크 스케줄러는,
상기 출력된 태스크들 각각의 실행 시간들에 대한 상기 가비지 컬렉션 시간들의 비율이 기준 비율보다 작은 경우, 상기 스레드 수를 증가시키는 분산 처리 시스템.
The method of claim 8,
The task scheduler,
A distributed processing system that increases the number of threads when the ratio of the garbage collection times to execution times of each of the output tasks is less than a reference ratio.
제8 항에 있어서,
상기 태스크 스케줄러는,
상기 가비지 컬렉션 시간들에 대한 상기 출력된 태스크들 이전에 측정된 가비지 컬렉션 시간들의 비율이 기준 비율보다 큰 경우, 상기 스레드 수를 감소시키는 분산 처리 시스템.
The method of claim 8,
The task scheduler,
When a ratio of garbage collection times measured before the output tasks to the garbage collection times is larger than a reference ratio, the number of threads is reduced.
제1 항에 있어서,
상기 적어도 하나의 워커 노드는,
상기 마스터로부터 수신된 상기 태스크들을 실행하는 실행기; 및
상기 가비지 컬렉션 시간 및 상기 태스크들 각각의 실행 시간을 측정하는 타이머를 포함하는 분산 처리 시스템.
The method of claim 1,
The at least one worker node,
An executor executing the tasks received from the master; And
Distributed processing system comprising a timer for measuring the garbage collection time and the execution time of each of the tasks.
제1 항에 있어서,
상기 적어도 하나의 워커 노드는 상기 가비지 컬렉션 시간 및 상기 태스크들 각각의 실행 시간을 상기 마스터로 송신하고,
상기 마스터는 상기 가비지 컬렉션 시간 및 상기 실행 시간을 비교하여, 상기 스레드 수를 조절하는 분산 처리 시스템.
The method of claim 1,
The at least one worker node transmits the garbage collection time and the execution time of each of the tasks to the master,
The master is a distributed processing system for adjusting the number of threads by comparing the garbage collection time and the execution time.
마스터 및 워커 노드를 포함하는 분산 처리 시스템의 동작 방법에 있어서,
상기 마스터가 작업(job)의 사용 함수들 각각의 메모리 부하 가중치에 기초하여 상기 작업에 대응되는 데이터의 분할 수 및 스레드 수를 생성하는 단계;
상기 마스터가 상기 분할 수 에 기초하여 상기 데이터를 복수의 태스크들로 분할하는 단계;
상기 마스터가 상기 복수의 태스크들 중 상기 스레드 수만큼의 태스크들을 상기 워커 노드로 출력하는 단계;
상기 워커 노드가 상기 태스크들을 실행하는 동안의 가비지 컬렉션 시간 및 실행 시간을 측정하는 단계; 및
상기 마스터가 상기 가비지 컬렉션 시간 및 상기 실행 시간에 기초하여 상기 스레드 수를 조절하는 단계를 포함하는 동작 방법.
In the method of operating a distributed processing system including a master and worker nodes,
Generating, by the master, the number of divisions and the number of threads of data corresponding to the job based on the memory load weights of each of the use functions of the job;
Dividing the data into a plurality of tasks based on the number of divisions by the master;
Outputting, by the master, tasks as many as the number of threads among the plurality of tasks to the worker node;
Measuring a garbage collection time and an execution time while the worker node executes the tasks; And
And adjusting, by the master, the number of threads based on the garbage collection time and the execution time.
제14 항에 있어서,
상기 데이터의 분할 수 및 스레드 수를 생성하는 단계 이전에, 상기 마스터가 상기 작업의 상기 사용 함수들에 기초하여, 상기 작업을 복수의 단계들(stage)로 분할하는 단계를 더 포함하고,
상기 분할 수는 상기 복수의 단계들 각각에 대응되는 값들을 포함하고, 상기 스레드 수는 상기 복수의 단계들 각각에 대응되는 값들을 포함하는 동작 방법.
The method of claim 14,
Before the step of generating the number of divisions and the number of threads of the data, the master further comprises dividing the job into a plurality of stages based on the usage functions of the job,
The number of divisions includes values corresponding to each of the plurality of steps, and the number of threads includes values corresponding to each of the plurality of steps.
제14 항에 있어서,
상기 분할 수 및 상기 스레드 수를 생성하는 단계는,
상기 작업의 상기 사용 함수들 각각의 메모리 부하 가중치를 검색하는 단계;
상기 메모리 부하 가중치에 기초하여 상기 사용 함수들에 의하여 변경되는 상기 데이터의 최대 크기를 계산하는 단계;
상기 최대 크기 및 상기 워커 노드의 사용 가능한 메모리 크기에 기초하여 초기 분할 수 및 초기 스레드 수를 계산하는 단계; 및
상기 초기 분할 수 및 상기 초기 스레드 수에 대응되는 태스크들의 예측 실행 시간에 기초하여, 상기 초기 분할 수 및 상기 초기 스레드 수를 조절하는 단계를 포함하는 동작 방법.
The method of claim 14,
The step of generating the number of divisions and the number of threads,
Retrieving a memory load weight of each of the use functions of the task;
Calculating a maximum size of the data changed by the use functions based on the memory load weight;
Calculating an initial number of partitions and an initial number of threads based on the maximum size and the available memory size of the worker node; And
And adjusting the initial number of divisions and the number of initial threads based on the initial number of divisions and a predicted execution time of tasks corresponding to the number of initial threads.
제16 항에 있어서,
상기 초기 분할 수 및 상기 초기 스레드 수를 조절하는 단계는,
상기 초기 분할 수 및 상기 초기 스레드 수 중 적어도 하나를 변경할 때의 상기 예측 실행 시간의 감소율을 계산하는 단계; 및
상기 감소율이 기준 비율보다 작을 때까지 상기 초기 분할 수 및 상기 초기 스레드 수 중 적어도 하나를 변경하는 단계를 포함하는 동작 방법.
The method of claim 16,
Adjusting the initial number of divisions and the number of initial threads,
Calculating a reduction rate of the prediction execution time when at least one of the initial number of divisions and the number of initial threads is changed; And
And changing at least one of the initial number of divisions and the number of initial threads until the reduction rate is less than a reference ratio.
제14 항에 있어서,
상기 스레드 수를 조절하는 단계는,
상기 실행 시간에 대한 상기 가비지 컬렉션 시간의 비율이 기준 비율보다 큰 경우, 상기 스레드 수를 감소시키는 단계를 포함하는 동작 방법.
The method of claim 14,
The step of adjusting the number of threads,
And if the ratio of the garbage collection time to the execution time is greater than a reference ratio, reducing the number of threads.
제14 항에 있어서,
상기 스레드 수를 조절하는 단계는,
상기 실행 시간에 대한 상기 가비지 컬렉션 시간의 비율이 기준 비율보다 작은 경우, 상기 스레드 수를 증가시키는 단계를 포함하는 동작 방법.
The method of claim 14,
The step of adjusting the number of threads,
And if the ratio of the garbage collection time to the execution time is less than a reference ratio, increasing the number of threads.
제14 항에 있어서,
상기 스레드 수를 조절하는 단계는, 상기 워커 노드가 상기 작업을 실행하는 동안 수행되는 동작 방법.

The method of claim 14,
The step of adjusting the number of threads may be performed while the worker node is executing the task.

KR1020190074053A 2018-11-28 2019-06-21 Distributed processing system and operating method thereof KR102195886B1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020180149376 2018-11-28
KR20180149376 2018-11-28

Publications (3)

Publication Number Publication Date
KR20200063962A KR20200063962A (en) 2020-06-05
KR102195886B1 true KR102195886B1 (en) 2020-12-29
KR102195886B9 KR102195886B9 (en) 2022-01-24

Family

ID=71089238

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190074053A KR102195886B1 (en) 2018-11-28 2019-06-21 Distributed processing system and operating method thereof

Country Status (1)

Country Link
KR (1) KR102195886B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035523A (en) * 2020-08-25 2020-12-04 上海达梦数据库有限公司 Method, device and equipment for determining parallelism and storage medium
KR102250950B1 (en) * 2020-09-21 2021-05-12 (주)시큐레이어 Method and device for automatically optimizing process execution environment based on machine learning in distributed deployment environment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101013073B1 (en) 2007-12-17 2011-02-14 한국전자통신연구원 Apparatus for Task Distribution and Parallel Processing System and Method there of
KR101823129B1 (en) 2016-11-24 2018-03-09 주식회사 실크로드소프트 Computer program, method and apparatus for distributing resource of processor

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2746941A1 (en) * 2012-12-20 2014-06-25 Thomson Licensing Device and method for optimization of data processing in a MapReduce framework

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101013073B1 (en) 2007-12-17 2011-02-14 한국전자통신연구원 Apparatus for Task Distribution and Parallel Processing System and Method there of
KR101823129B1 (en) 2016-11-24 2018-03-09 주식회사 실크로드소프트 Computer program, method and apparatus for distributing resource of processor

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
이재욱 외 3명. '고성능 데이터 분석을 위한 HW 및 SW 기반 메모리 관리 기술 동향'. 정보과학회지 제36권 제10호, 2018.10., pp.45-54.
이재욱 외 4명. '인-메모리 빅데이터 프로세싱 성능 최적화 연구 동향'. 정보과학회지 제35권 제10호, 2017.10., pp.52-57.

Also Published As

Publication number Publication date
KR102195886B9 (en) 2022-01-24
KR20200063962A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
Alipourfard et al. {CherryPick}: Adaptively unearthing the best cloud configurations for big data analytics
CA2963088C (en) Apparatus and method for scheduling distributed workflow tasks
US9785468B2 (en) Finding resource bottlenecks with low-frequency sampled data
US20200175361A1 (en) Partitioning of deep learning inference with dynamic offloading
US20160048413A1 (en) Parallel computer system, management apparatus, and control method for parallel computer system
JP6953800B2 (en) Systems, controllers, methods, and programs for running simulation jobs
US20120331474A1 (en) Real time system task configuration optimization system for multi-core processors, and method and program
US9268609B2 (en) Application thread to cache assignment
CN108205469B (en) MapReduce-based resource allocation method and server
US8869148B2 (en) Concurrency identification for processing of multistage workflows
KR102195886B1 (en) Distributed processing system and operating method thereof
KR20200091790A (en) Platform for concurrent execution of gpu operations
KR101852610B1 (en) Method for using resources using ai learning based realtime analyzing system and managemnet server using the same
Adyanthaya et al. Robustness analysis of multiprocessor schedules
JP2017117242A (en) Method and system for recommending application parameter setting and system specification setting in distributed computation
JP5470177B2 (en) Trace system
Obaida et al. Simulation of HPC job scheduling and large-scale parallel workloads
Marinho et al. LABAREDA: a predictive and elastic load balancing service for cloud-replicated databases
CN113452546A (en) Dynamic quality of service management for deep learning training communications
Radulescu et al. LLB: A fast and effective scheduling algorithm for distributed-memory systems
Foroni et al. Moira: A goal-oriented incremental machine learning approach to dynamic resource cost estimation in distributed stream processing systems
CN110362387B (en) Distributed task processing method, device, system and storage medium
Nasr et al. Task scheduling algorithm for high performance heterogeneous distributed computing systems
Banicescu et al. Towards the robustness of dynamic loop scheduling on large-scale heterogeneous distributed systems
KR102022972B1 (en) Runtime management apparatus for heterogeneous multi-processing system and method thereof

Legal Events

Date Code Title Description
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
G170 Publication of correction