Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Data Processing
  • Getting started
    • All guides
      • Working with logs
      • Cluster and host state monitoring
      • Spark application status monitoring
      • Diagnosing and troubleshooting Spark application performance issues
    • Creating and using Python virtual environments
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • FAQ

In this article:

  • Initial performance diagnostics of Spark applications
  • Troubleshooting common performance issues
  • High garbage collection time
  • Multiple executors are competing for CPU resources
  • Recurring heartbeat errors when running jobs
  1. Step-by-step guides
  2. Logs and monitoring
  3. Diagnosing and troubleshooting Spark application performance issues

Diagnosing and troubleshooting Spark application performance issues

Written by
Yandex Cloud
Updated at June 29, 2026
View in Markdown
  • Initial performance diagnostics of Spark applications
  • Troubleshooting common performance issues
    • High garbage collection time
    • Multiple executors are competing for CPU resources
    • Recurring heartbeat errors when running jobs

If your Spark applications are slow:

  • Check their execution to identify the cause of performance issues.
  • Try using one of the methods for troubleshooting common issues.

Initial performance diagnostics of Spark applicationsInitial performance diagnostics of Spark applications

If your Spark application underperforms, run the initial diagnostics:

  • Check the application queue to make sure your application is not getting blocked by others.

  • View detailed application info and check the jobs' statuses and actual start and end times on the Event Timeline chart.

  • Check the resources allocated to the application:

    • Make sure the application has enough executors and all available executors are not idle.
    • Make sure the resources within each executor are used in a balanced way.
  • Check the SQL query plans and the execution time for each operation.

  • Check the application logs for any warnings about failures.

Troubleshooting common performance issuesTroubleshooting common performance issues

High garbage collection timeHigh garbage collection time

If you checked the resources allocated to the application and found out that the GC Time in the total Task Time is high:

  • Make sure the executor has enough memory allocated.
  • Configure the garbage collector manually. Check out this Apache Spark guide.

Multiple executors are competing for CPU resourcesMultiple executors are competing for CPU resources

When allocating executors, the YARN scheduler using the default settings ignores available CPU resources on the node. This may slow down compute-intensive jobs.

To avoid this, enable the alternative resource-aware scheduling algorithm for executors by setting the following cluster-level property:

capacity-scheduler:yarn.scheduler.capacity.resource-calculator=org.apache.hadoop.yarn.util.resource.DominantResourceCalculator

For more information about the YARN scheduler, see this Hadoop guide.

Recurring heartbeat errors when running jobsRecurring heartbeat errors when running jobs

When running Spark jobs, executors regularly send heartbeat messages to the driver with info on the executor status and operation progress. If the driver does not get any heartbeat messages from an executor during a certain interval, it considers this executor unhealthy and requests the YARN resource manager to forcibly terminate it. In this case, the driver logs will contain a message of the following type:

23/02/23 20:22:09 WARN TaskSetManager: Lost task 28.0 in stage 13.0 (TID 242) 
        (rc1c-dataproc-*****.mdb.yandexcloud.net executor 5): ExecutorLostFailure 
        (executor 5 exited caused by one of the running tasks) 
        Reason: Executor heartbeat timed out after 138218 ms

Such errors may be due to cluster networking issues. In practice, however, heartbeat timeouts most often occur because an executor runs out of memory. Consequently, job logs may fail to register such errors as java.lang.OutOfMemoryError because logging itself fails due to the memory shortage.

If you regularly get heartbeat errors when running jobs and there are no other signs of network errors, increase the amount of RAM allocated per concurrent operation. To do this, change your cluster's component properties:

  • Reduce the number of CPU cores per executor in the spark.executor.cores parameter.
  • Increase the amount of RAM allocated per executor in the spark.executor.memory parameter.

For more information about these parameters, see this Spark guide.

Was the article helpful?

Previous
Spark application status monitoring
Next
Creating and using Python virtual environments
© 2026 Direct Cursus Technology L.L.C.