Skip to content

Conversation

@Earne
Copy link
Contributor

@Earne Earne commented Apr 5, 2016

What changes were proposed in this pull request?

Currently, LRU is the only eviction strategy for cached RDD partitions in Spark.
This pull request will refactor and add support to multiple eviction strategies, such as FIFO, LFU(WIP), LCS(WIP).

How was this patch tested?

Manual test by set "spark.memory.entryEvictionPolicy" to LRU(default), FIFO or LCS.

@Earne Earne changed the title [SPARK-14289][WIP] Add support to multiple eviction strategies for cached RDD partitions [SPARK-14289][WIP] Support multiple eviction strategies for cached RDD partitions Apr 5, 2016
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@rxin
Copy link
Contributor

rxin commented Apr 5, 2016

Thanks for the pull request. Is this actually motivated by a real use case, or just doing it because it might be good to support more than one policy?

@Earne
Copy link
Contributor Author

Earne commented Apr 6, 2016

@rxin The use case that motivate this is about below.

  • Java objects consume a factor of 2-5x more space than the “raw” data inside their fields.

  • Running graphx.LiveJournalPageRank example on a 8 nodes cluster (1 work as Master, each configured with 45GB memory for Spark running in legacy memory management mode). The dataset (about 30GB) is generated by HiBench, while running 5 iterations, time of each iteration is getting worse and worse.

  • By analyzing the log file, I realize that it is because memory space for cached RDD is not sufficient, and lots of partition with high recomputing cost is dropped. Recomputing these partitions brought in lots of time.

  • FIFO can be implemented by initialize entries with LinkedHashMap[BlockId, MemoryEntry[_]](32, 0.75f, false). And even FIFO can get much better performance than LRU.

  • Storage level such as MEMORY_AND_DISK may partial solve the problem, but the effect is not very good.

    An eviction strategy taken the computing cost into consideration may work well (even in unified memory mode or use the MEMORY_AND_DISK level). Some cost-aware replacement policy already exists in K-V stores, such as GD-Wheel(EuroSys’15).

This PR can be separated to below sub-task.

  • Refactor to support more than one policy (LRU, FIFO, LFU).
  • Add a policy that taken the computing cost into consideration.
  • Taken serialize and deserialize cost into consideration.

@mozinrat
Copy link

mozinrat commented Nov 8, 2016

@Earne is something relevant merged in spark 2.0.1, do we have FIFO eviction policy?.
If yes how can I leverage it?

@michaelmior
Copy link
Member

michaelmior commented May 5, 2017

This branch appears to be incomplete. The configuration parameter entryEvictionPolicy does not exist and there is a good chunk of the code that is never called.

@HyukjinKwon
Copy link
Member

@Earne, is it still active and any opinion on the comments above? Otherwise, I will propose to close this.

@mmakdessii
Copy link

I'm working on my thesis to improve cache management systems. But i don't know anything about Spark! I found this program and I don't know how to even run it. If possible, can someone refer to me a video or steps in order to run this file? If i can see a sample implementation of LRU and know how it's made step by step then I'll be able to implement my own algorithm. I would be very grateful if someone can offer their help!

@michaelmior
Copy link
Member

As best I can tell, the code that was pushed here is incomplete. However, Spark's default cache eviction policy is LRU. You can find the code which performs eviction here. It basically just works by storing all the data in a LinkedHashMap configured to track which elements were accessed most recently.

@Earne Earne deleted the SPARK-14289 branch December 21, 2017 13:14
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
## What changes were proposed in this pull request?

This PR proposes to close PRs ...

  - inactive to the review comments more than a month
  - WIP and inactive more than a month
  - with Jenkins build failure but inactive more than a month
  - suggested to be closed and no comment against that
  - obviously looking inappropriate (e.g., Branch 0.5)

To make sure, I left a comment for each PR about a week ago and I could not have a response back from the author in these PRs below:

Closes apache#11129
Closes apache#12085
Closes apache#12162
Closes apache#12419
Closes apache#12420
Closes apache#12491
Closes apache#13762
Closes apache#13837
Closes apache#13851
Closes apache#13881
Closes apache#13891
Closes apache#13959
Closes apache#14091
Closes apache#14481
Closes apache#14547
Closes apache#14557
Closes apache#14686
Closes apache#15594
Closes apache#15652
Closes apache#15850
Closes apache#15914
Closes apache#15918
Closes apache#16285
Closes apache#16389
Closes apache#16652
Closes apache#16743
Closes apache#16893
Closes apache#16975
Closes apache#17001
Closes apache#17088
Closes apache#17119
Closes apache#17272
Closes apache#17971

Added:
Closes apache#17778
Closes apache#17303
Closes apache#17872

## How was this patch tested?

N/A

Author: hyukjinkwon <[email protected]>

Closes apache#18017 from HyukjinKwon/close-inactive-prs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants