Optimizing LinkedIn Sales Navigator’s search pipeline with Spark

Chunxu Tang
14 min readadvanced
--
View Original

Overview

The article discusses the optimization of LinkedIn Sales Navigator’s search pipeline using Apache Spark, highlighting the transition from MapReduce to Spark and the resulting performance improvements. Key insights include the reduction of execution time from 6-7 hours to approximately 3 hours through various optimization techniques.

What You'll Learn

1

How to optimize Spark jobs for better performance

2

Why pruning job graphs is essential in data pipelines

3

How to identify bottlenecks in complex data pipelines

4

When to use broadcast joins for efficient data processing

Prerequisites & Requirements

  • Understanding of Spark job orchestration and performance tuning
  • Familiarity with Apache Spark and its ecosystem

Key Questions Answered

How did LinkedIn optimize the search pipeline for Sales Navigator?
LinkedIn optimized the search pipeline by transitioning from MapReduce to Spark, which allowed for more efficient data manipulation jobs. They reduced execution time from 6-7 hours to about 3 hours by tuning over 100 data manipulation jobs, focusing on critical path analysis and optimizing job dependencies.
What challenges are faced when tuning Spark jobs?
Challenges include complex dependency management among over 100 jobs, constraints on compute resources due to enforced caps, and uneven data distribution that can lead to performance bottlenecks. Identifying and addressing these issues is crucial for optimizing overall pipeline performance.
When should broadcast joins be used in Spark jobs?
Broadcast joins should be used when joining tables of significantly different sizes, particularly when the smaller table is under 40 MB. This technique can greatly reduce execution time by minimizing shuffle operations, but care must be taken to avoid memory issues with larger tables.
What is the impact of data repartitioning in Spark jobs?
Data repartitioning helps mitigate data skewness by redistributing datasets more evenly across partitions. This technique can significantly improve performance, as demonstrated by reducing execution time from 2 hours to 30 minutes in one of the data manipulation jobs.

Key Statistics & Figures

Execution time reduction
From 6-7 hours to around 3 hours
This improvement was achieved by optimizing over 100 data manipulation jobs in the Spark-based pipeline.
Executor usage
Approximately 5,000 executors required for the largest Spark-based job
This highlights the scale of resources needed for processing in the Sales Navigator's data manipulation pipeline.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Data Processing
Apache Spark
Used for optimizing data manipulation jobs in the Sales Navigator search pipeline.
Storage
Hadoop Distributed File System (hdfs)
Utilized for storing and processing datasets in the data manipulation pipeline.
Workflow Management
Azkaban
LinkedIn's open-source workflow manager used for orchestrating job executions.

Key Actionable Insights

1
Prioritize job graph optimization before tuning individual Spark jobs to enhance performance.
By pruning unnecessary dependencies and consolidating related jobs, you can significantly reduce execution time and improve overall efficiency in data pipelines.
2
Identify and focus on bottlenecks within the critical path of your data pipeline.
Analyzing job dependencies and execution times allows you to pinpoint which jobs most impact overall performance, enabling targeted optimizations.
3
Utilize broadcast joins strategically to optimize join operations in Spark.
When dealing with tables of varying sizes, broadcasting smaller tables can minimize shuffling and drastically reduce execution times, but ensure the broadcast table is within memory limits.

Common Pitfalls

1
Failing to account for data skewness can lead to significant performance issues in Spark jobs.
Data skewness occurs when data is unevenly distributed across partitions, causing some executors to handle disproportionately large workloads. This can be mitigated through effective repartitioning strategies.
2
Overlooking the importance of job dependency management can complicate performance tuning.
With numerous jobs and dependencies, a slowdown in one job can affect others, making it critical to analyze the entire job graph for effective optimization.

Related Concepts

Data Manipulation Pipelines
Performance Tuning In Spark
Job Orchestration Techniques