Speed Up Presto at Uber with Alluxio Local Cache

Chen Liang, Beinan Wang
12 min readintermediate
--
View Original

Overview

The article discusses Uber's implementation of Alluxio local caching to enhance the performance of Presto, a data analytics engine. It covers the architecture, key challenges faced during deployment, and the solutions developed to optimize query performance across various use cases at Uber.

What You'll Learn

1

How to implement Alluxio as a local cache for Presto

2

Why real-time partition updates are critical for data consistency

3

How to optimize cache hit rates using selective caching strategies

Prerequisites & Requirements

  • Understanding of data analytics and caching concepts
  • Familiarity with Presto and Alluxio(optional)

Key Questions Answered

What are the key benefits of using Alluxio for local caching with Presto?
Using Alluxio for local caching with Presto significantly improves query performance by reducing latency and increasing cache hit rates. The implementation allows Presto to leverage local NVMe disks, which enhances data retrieval speeds and overall efficiency in processing large datasets.
How does Uber handle real-time partition updates in their caching strategy?
Uber addresses real-time partition updates by incorporating the latest modification time into the caching key. This ensures that the cache reflects the most current data, preventing users from receiving outdated results when querying.
What challenges did Uber face when implementing Alluxio with Presto?
Uber faced several challenges, including managing real-time partition updates, handling cluster membership changes that affected cache efficiency, and dealing with cache size restrictions due to limited local disk space. Each challenge required tailored solutions to maintain performance and consistency.
What is the impact of cache size restrictions on Presto's performance?
The cache size restrictions at Uber, with only 500 GB available per node, limit the amount of data that can be cached. This leads to frequent evictions, which can hurt overall cache performance and necessitate a selective caching strategy to optimize resource usage.

Key Statistics & Figures

Daily Active Users of Presto
9,000
This indicates the scale at which Presto is utilized within Uber's data analytics operations.
Queries Processed Per Day
500,000
This showcases the volume of data queries handled by Presto, emphasizing the need for efficient caching solutions.
Data Handled by Presto
50PB
This highlights the significant amount of data processed daily, necessitating robust caching mechanisms to improve performance.
Cache Hit Rate Improvement
>90%
This improvement was achieved through the implementation of a cache filter that selectively caches data.

Technologies & Tools

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

Caching Solution
Alluxio
Used as a local cache for Presto to enhance query performance.
Data Analytics Engine
Presto
Core engine for data analytics at Uber, heavily utilized for various operational tasks.
Data Management
Hudi
Used for managing data updates and real-time partitioning.

Key Actionable Insights

1
Implementing selective caching can significantly enhance cache hit rates.
By only caching a subset of data that is frequently accessed, Uber increased their cache hit rate from approximately 65% to over 90%, demonstrating the effectiveness of targeted caching strategies.
2
Incorporate the latest modification time into caching keys to ensure data consistency.
This approach helps prevent users from receiving stale data, especially in environments where data is frequently updated, such as with Hudi tables.
3
Utilize consistent hashing for better cache efficiency during cluster membership changes.
Switching from a mod-based algorithm to consistent hashing mitigates the negative impact on cache efficiency when nodes are added or removed from the cluster.

Common Pitfalls

1
Relying solely on partition IDs for caching keys can lead to stale data.
If the underlying data changes in Hive but the cache remains unchanged, users may receive outdated results. This inconsistency can be avoided by incorporating additional metadata, such as the latest modification time.

Related Concepts

Caching Strategies In Data Analytics
Real-time Data Processing With Hudi
Performance Optimization Techniques For Presto