当前位置:网站首页>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 .
边栏推荐
- Avframe Memory Management API
- How do individuals open accounts to speculate in stocks? Is online account opening safe?
- Superimposed ladder diagram and line diagram and merged line diagram and needle diagram
- 【无标题】
- Discussion on safety management of centralized maintenance construction site of substation under the mode of operation and maintenance
- 用Pytorch搭建第一个神经网络且进行优化
- 电子元器件销售ERP管理系统哪个比较好?
- Power data
- 【云原生 | Kubernetes篇】深入了解Pod(六)
- Mysql8.0 forgot the root password
猜你喜欢
使用transform:scale之后导致页面鼠标悬浮事件消失
如何抑制SiC MOSFET Crosstalk(串扰)?
Characteristics and prevention of electrical fire
It only takes two steps to find the right PMP organization, one check and two questions
Large current and frequency range that can be measured by Rogowski coil
[untitled]
Implementation of code scanning login
Matlab tips (20) matrix analysis -- principal component regression
Discussion on the improvement and application of the prepayment system in the management of electricity charge and price
MySQL8.0 忘记 root 密码
随机推荐
Batch modify tables and sorting rules for fields in tables
SQL injection file read / write
Apache Doris becomes the top project of Apache
Rich text - Test Case
Avframe Memory Management API
Key points of building fire protection design
How to solve the problem of port number occupation
【大案例】学成在线网站
Implementation of single sign on
[reprint] STM32 GPIO type
隐私计算FATE-----离线预测
Container adapter - stack: stack queue: queue priority_ Queue: priority queue
Superimposed ladder diagram and line diagram and merged line diagram and needle diagram
理解IO模型
Illustration of MySQL binlog, redo log and undo log
Learn how Alibaba manages the data indicator system
实现全局双指长按返回桌面
Basic content learning of software testing (I)
买卖股票费用计算
Copy & Deepcopy