Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Spark tuning (3): RDD refactoring and persistence

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

First, the reconstruction and optimization of RDD architecture

Try to reuse RDD, similar RDD, can be extracted as a common RDD for later RDD calculation, repeated use.

Second, public RDD must be persistent.

For public RDD that needs to be calculated and used multiple times, be sure to persist.

Persistence, that is, caching RDD data to memory / disk, (BlockManager). No matter how many times the RDD is calculated later, the persistent data of the RDD will be taken directly, for example, a piece of data will be extracted directly from memory or disk.

Third, persistence can be serialized.

If data is normally persisted in memory, it may result in excessive memory footprint, which may lead to an OOM memory overflow.

When pure memory cannot support the full storage of public RDD data, it is preferred to use serialization to store it in pure memory. Serialize the data of each partition of RDD into a large array of bytes, just one object; after serialization, the memory footprint is greatly reduced.

The only drawback to serialization is that it needs to be deserialized when getting data.

If serialization of pure memory mode still results in OOM, memory overflow; you can only consider disk mode, memory + disk normal way (no serialization).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report