CPU cores
The central processing unit (CPU) is the resource where the computation happens. Modern machines come with more than one CPU core, allowing users to run multiple applications in parallel. As discussed in Chapter 5, Spark Architecture and Application Execution Flow, tasks for your Spark jobs get executed on these cores. Thus, the degree of parallelism also depends on the number of cores available. This means if you have 1,000 cores available and the total number of partitions is 2,000, then Spark will first schedule the 1,000 tasks for each partition and then run the remaining ones after the completion of the first 1,000 tasks.
We have already discussed how we can control these resources while submitting our job. But it is a good ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access