当前位置:网站首页>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 .
边栏推荐
- rman備份報ORA-19809 ORA-19804
- JMeter -- interface test 2
- STL - inverter
- [big case] Xuecheng online website
- Is it safe to open an account for online stock speculation?
- 个人究竟如何开户炒股?在线开户安全么?
- Where is CentOS mysql5.5 configuration file
- 与普通探头相比,差分探头有哪些优点
- Container adapter - stack: stack queue: queue priority_ Queue: priority queue
- Apache Doris becomes the top project of Apache
猜你喜欢

Operating principle of Rogowski coil

MySQL8.0 忘记 root 密码

硬盘基本知识(磁头、磁道、扇区、柱面)

Music website design based on harmonyos (portal page)

Chrome devtools

股票 停牌

What are the advantages of a differential probe over a conventional probe

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

基于宽表的数据建模

Deployment of MySQL database in Linux Environment
随机推荐
Operating principle of Rogowski coil
【.NET6】gRPC服务端和客户端开发案例,以及minimal API服务、gRPC服务和传统webapi服务的访问效率大对决
TCP
为什么SELECT * 会导致查询效率低?
"Jianzhi offer" -- Interview Question 4: finding two-dimensional arrays
用Pytorch搭建第一個神經網絡且進行優化
Data mining modeling practice
Use of Jasper soft studio report tool and solution of thorny problems
Apache Doris becomes the top project of Apache
It only takes two steps to find the right PMP organization, one check and two questions
Where is CentOS mysql5.5 configuration file
SQL optimization experience: from 30248 seconds to 0.001 seconds
与普通探头相比,差分探头有哪些优点
我想网上注册股票开户,如何操作?在线开户安全么?
[.Net6] GRP server and client development cases, as well as the access efficiency duel between the minimum API service, GRP service and traditional webapi service
From knowledge to wisdom: how far will the knowledge map go?
Privacy computing fat----- offline prediction
How do individuals open accounts to speculate in stocks? Is online account opening safe?
Data modeling based on wide table
SQL injection file read / write
