[
https://issues.apache.org/jira/browse/BEAM-5987?focusedWorklogId=181820&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-181820
]
ASF GitHub Bot logged work on BEAM-5987:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jan/19 15:02
Start Date: 07/Jan/19 15:02
Worklog Time Spent: 10m
Work Description: mareksimunek commented on issue #7091: [BEAM-5987]
Spark: Share cached side inputs between tasks.
URL: https://github.com/apache/beam/pull/7091#issuecomment-451961840
After trying several approaches we decided to keep it simple and go with
expireAfterAccess to drop values from cache.
Solution with weak values didn't bring desired behavior because when
`MultiDoFnFunction` finished for one executor, it immediately garbage collected
de-serialized side input (because it lost references due to end of life for
`CachedSideInputReader`). It kept side input in cache only if there was
overlapped running of multiple `MultiDoFnFunction` . In our case for one JVM it
a de-serialized side input up to 10x.
With [expireAfterAccess](
https://github.com/google/guava/wiki/CachesExplained#timed-eviction) side input
is de-serialized only once. I chose [5 min eviction
duration](https://github.com/apache/beam/pull/7091/files#diff-b123f0f1ca9646966a641a458b74cfbcR35)
as best compromise but I am open to discussion if it should be configurable.
Disadvantage for expireAfterAccess solution could be potential higher memory
consumption if `SideInputStorage` isn't access long time so nothing can be
evicted. I don't know how to recognize when `MultiDoFnFunction` is finished so
I can call cache.cleanup() to trigger eviction for expired items. Also not sure
if this is even a problem.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 181820)
Time Spent: 3h 50m (was: 3h 40m)
> Spark SideInputReader performance
> ---------------------------------
>
> Key: BEAM-5987
> URL: https://issues.apache.org/jira/browse/BEAM-5987
> Project: Beam
> Issue Type: Bug
> Components: runner-spark
> Affects Versions: 2.8.0
> Reporter: David Moravek
> Assignee: David Moravek
> Priority: Major
> Fix For: 2.9.0
>
> Attachments: Screen Shot 2018-11-06 at 13.05.36.png
>
> Time Spent: 3h 50m
> Remaining Estimate: 0h
>
> We did some profiling of a spark job and 90% of the application time was
> spent on side input deserialization.
> For spark, an easy fix is to cache materialized side inputs per bundle. This
> improved running time of the profiled job from 3 hours to 30 minutes.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)