当前位置:网站首页>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 .
边栏推荐
- I want to register my stock account online. How do I do it? Is online account opening safe?
- AVFrame内存管理api
- Not so Mobile
- Analysis of prepaid power purchase device
- Implement global double finger long press to return to the desktop
- Privacy computing fat----- offline prediction
- Apache Doris becomes the top project of Apache
- A - Bi-shoe and Phi-shoe
- Deployment of MySQL database in Linux Environment
- JMeter -- interface test 2
猜你喜欢

Discussion on the improvement and application of the prepayment system in the management of electricity charge and price

Data mining modeling practice

Loggerfactory uses log4j Parameter introduction of properties

Music website design based on harmonyos (portal page)

Lilda low code data large screen, leveling the threshold of data application development

图解MySQL的binlog、redo log和undo log

数据挖掘建模实战

APICloud携手三六零天御,助力企业守好App安全“第一关”

【无标题】

Import and export of a single collection in postman
随机推荐
SQL 优化经历:从 30248秒到 0.001秒的经历
Not so Mobile
Copy & Deepcopy
DEJA_ Vu3d - 052 of cesium feature set - Simulation of satellite orbit (high altitude) effect
FatMouse and Cheese
AVFrame内存管理api
Goldbach`s Conjecture
Deployment of MySQL database in Linux Environment
Use of Jasper soft studio report tool and solution of thorny problems
Expérience d'optimisation SQL: de 30248 secondes à 0001 secondes
The 6th smart home Asia 2022 will be held in Shanghai in October
I want to register my stock account online. How do I do it? Is online account opening safe?
手机炒股开户安不安全?
JMeter -- interface test 1
Is it safe for CICC fortune to open an account? How much do you charge?
Why does select * lead to low query efficiency?
Postman interface test
Applet: traverse the value of an array in the list, which is equivalent to for= "list" list An item in comment
Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
Apiccloud, together with 360 Tianyu, helps enterprises keep the "first pass" of APP security
