Uh oh!
There was an error while loading. Please reload this page.
[SPARK-3030] [PySpark] Reuse Python worker - #2259
Conversation
There was a problem hiding this comment.
Looks like this change got pulled in by accident?
SparkQA
commented
Sep 4, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 4, 2014
QA tests have finished for PR 2259 at commit
|
davies
commented
Sep 5, 2014
Jenkins, retest this please. |
davies
commented
Sep 6, 2014
Jenkins, test this please. |
SparkQA
commented
Sep 6, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 6, 2014
QA tests have finished for PR 2259 at commit
|
davies
commented
Sep 6, 2014
Jenkins, retest this please. On Sat, Sep 6, 2014 at 12:40 AM, Apache Spark QA notifications@github.com
|
JoshRosen
commented
Sep 6, 2014
Jenkins, retest this please. |
JoshRosen
commented
Sep 6, 2014
Do you think worker re-use should be enabled by default? The only problem that I anticipate is for applications that share a single SparkContext with both Python and Scala processes; in these cases, the Python tasks may continue to hog resources (memory that's not used for caching RDDs) even after they complete. This seems like a rare use-case, though, so we could document this change and advise those users to disable this setting. I'm inclined to have it on by default, since it will be a huge performance win for the vast majority of PySpark users. |
JoshRosen
commented
Sep 6, 2014
It would be interesting to measure the end-to-end performance impact for more realistic jobs, especially ones that make use of large numbers of tasks and large broadcast variables. |
davies
commented
Sep 7, 2014
It's already enabled by default. I had added benchmark result in the description. |
SparkQA
commented
Sep 7, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 7, 2014
QA tests have finished for PR 2259 at commit
|
SparkQA
commented
Sep 7, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 7, 2014
QA tests have finished for PR 2259 at commit
|
davies
commented
Sep 7, 2014
Jenkins, retest this please. |
SparkQA
commented
Sep 7, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 7, 2014
Tests timed out after a configured wait of |
JoshRosen
commented
Sep 7, 2014
Jenkins, retest this please. |
SparkQA
commented
Sep 7, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 7, 2014
Tests timed out after a configured wait of |
mateiz
commented
Sep 8, 2014
You guys should time out the worker after some time period to avoid it always consuming resources. If we have that, I think it should be on by default -- in general it's best to minimize the number of different run configurations. However we may need to add a setting to keep the old behavior if some users have code that assumes the worker will shut down. |
davies
commented
Sep 8, 2014
@mateiz It will time out the worker after 1 minute. It will reuse worker by default, can be disabled by 'spark.python.worker.reuse = false', then it will shut down the worker after task complete immediately. |
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
Tests timed out after a configured wait of |
SparkQA
commented
Sep 10, 2014
Tests timed out after a configured wait of |
JoshRosen
commented
Sep 10, 2014
Hmm, I wonder why we're seeing these timeouts. It looks like both tests failed in |
davies
commented
Sep 10, 2014
yeah, I will investigate it locally. On Tue, Sep 9, 2014 at 8:53 PM, Josh Rosen notifications@github.com wrote:
|
davies
commented
Sep 10, 2014
Jenkins, retest this please. |
davies
commented
Sep 10, 2014
@JoshRosen The problem that will cause hanging has been fixed. |
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have finished for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have finished for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have finished for PR 2259 at commit
|
SparkQA
commented
Sep 10, 2014
QA tests have finished for PR 2259 at commit
|
Conflicts: python/pyspark/serializers.py
SparkQA
commented
Sep 13, 2014
QA tests have started for PR 2259 at commit
|
SparkQA
commented
Sep 13, 2014
QA tests have finished for PR 2259 at commit
|
JoshRosen
commented
Sep 13, 2014
This looks good to me; merging it into master now. I wonder if we'll see a net reduction in Jenkins flakiness due to using significantly fewer ephemeral ports in PySpark after this patch... |
nchammas
commented
Sep 13, 2014
Yeah, the bad diffs are especially weird. |
Reuse Python worker to avoid the overhead of fork() Python process for each tasks. It also tracks the broadcasts for each worker, avoid sending repeated broadcasts.
This can reduce the time for dummy task from 22ms to 13ms (-40%). It can help to reduce the latency for Spark Streaming.
For a job with broadcast (43M after compress):
It will finish in 281s without reused worker, and it will finish in 65s with reused worker(4 CPUs). After reusing the worker, it can save about 9 seconds for transfer and deserialize the broadcast for each tasks.
It's enabled by default, could be disabled by
spark.python.worker.reuse = false.