当前位置:网站首页>Resource scheduling and task scheduling of spark
Resource scheduling and task scheduling of spark
2022-06-28 09:03:00 【Endless learning WangXiaoShuai】
Spark Resource scheduling and task scheduling

- Spark Resource scheduling and task scheduling process :
After starting the cluster ,Worker The node will Master Node reports resources ,Master Master the cluster resources . When Spark To submit a Application after , according to RDD The dependency between will be Application To form a DAG Directed acyclic graph . After the task is submitted ,Spark Will be in Driver Create two objects at the end :DAGScheduler and TaskScheduler,DAGScheduler It is a high-level scheduler for task scheduling , It's an object .DAGScheduler The main function of will be DAG according to RDD The wide and narrow dependencies are divided into Stage, And then put these Stage With TaskSet Form submitted to TaskScheduler(TaskScheduler It is a low-level scheduler for task scheduling , here TaskSet It's actually a collection , Inside the package is one by one task Mission , That is to say stage The degree of parallelism in task Mission ),TaskSchedule Can traverse TaskSet aggregate , Get each task After the will task Send to compute node Executor To perform ( It's actually sent to Executor Thread pool in ThreadPool To carry out ).task stay Executor The operation in the thread pool will be reported to TaskScheduler feedback , When task When execution fails , By TaskScheduler Responsible for retrying , take task Resend to Executor To carry out , Default retry 3 Time . If you try again 3 The first time still failed , So this task Where stage And failed .stage Failure is caused by DAGScheduler To try again , To resend TaskSet To TaskSchdeuler,Stage Default retry 4 Time . If you try again 4 Still fail after times , So this job And failed .job failed ,Application And failed .
TaskScheduler Can not only retry failed task, And try again straggling( backward , slow )task( That is, the execution speed is faster than other task Too slow task). If there are slow running task that TaskScheduler Will start a new task Come with this slow task Perform the same processing logic . Two task Which is the first to finish , Just one task The results of the implementation of . This is it. Spark Speculative execution mechanism . stay Spark Speculative execution is off by default . Speculative execution can be performed through spark.speculation Property to configure .
Be careful :
- about ETL The type of business to be entered into the database needs to close the speculation execution mechanism , In this way, there will be no duplicate data warehousing .
- If you encounter data skew , If speculative execution is enabled, there may always be task Restart processing the same logic , The task may be in an endless state .
- The illustration Spark Resource scheduling and task scheduling process

- Coarse grained resource requests and fine-grained resource requests
- Coarse grained resource requests (Spark)
stay Application Perform before , Apply all the resources , When the resource application is successful , The task will be scheduled , When all task After execution , This part of the resources will be released .
advantage : stay Application Perform before , All the resources have been applied for , every last task Just use the resources directly , Unwanted task Apply for resources yourself before executing ,task It's going to start soon ,task Execution is fast ,stage Execution is fast ,job That's fast. ,application Execution is fast .
shortcoming : Until the last one task Resources will only be released when the execution is completed , The resources of the cluster cannot be fully utilized .
- Fine grained resource requests (MapReduce)
Application You don't need to apply for resources before you execute , I'm going to do it directly , Give Way job Each of them task Apply for resources yourself before executing ,task Release resources when execution is complete .
advantage : The resources of the cluster can be fully utilized .
shortcoming :task Apply for resources yourself ,task Slow start ,Application The operation of the corresponding slow down .
边栏推荐
- How to suppress SiC MOSFET crosstalk?
- How do I open an account on my mobile phone? Is it safe to open an account online now?
- Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
- Explain observer mode
- Build the first neural network with pytoch and optimize it
- Postman interface test
- Discussion on safety management of centralized maintenance construction site of substation under the mode of operation and maintenance
- 【无标题】
- Use of Jasper soft studio report tool and solution of thorny problems
- MATLAB小技巧(20)矩阵分析--主成分回归
猜你喜欢

Large current and frequency range that can be measured by Rogowski coil

Application of energy management system in iron and steel enterprises

SQL注入之文件读写

买卖股票费用计算

containerd1.5.5的安装

Build the first neural network with pytoch and optimize it

Test cases for learning the basic content of software testing (II)

【大案例】学成在线网站

Discussion on safety management of centralized maintenance construction site of substation under the mode of operation and maintenance

Protection range and optimization of motor protector for hoist equipment
随机推荐
containerd1.5.5的安装
How to solve the problem of high concurrency and seckill
A - Bi-shoe and Phi-shoe
实现全局双指长按返回桌面
Protection range and optimization of motor protector for hoist equipment
网上炒股开户安不安全?
Tree
Goldbach`s Conjecture
State machine program framework
What are the advantages of a differential probe over a conventional probe
rman備份報ORA-19809 ORA-19804
中金财富开户安全吗?怎么收费?
Trailing Zeroes (II)
Common faults and solutions of Substation
Test cases for learning the basic content of software testing (II)
Copy & Deepcopy
From knowledge to wisdom: how far will the knowledge map go?
Which is a better ERP management system for electronic component sales?
JMeter -- interface test 1
break database---mysql
