You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xianjin YE (JIRA)" <ji...@apache.org> on 2018/04/18 05:13:00 UTC

[jira] [Updated] (SPARK-24006) ExecutorAllocationManager.onExecutorAdded is an O(n) operation

     [ https://issues.apache.org/jira/browse/SPARK-24006?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xianjin YE updated SPARK-24006:
-------------------------------
    Description: 
The ExecutorAllocationManager.onExecutorAdded is an O(n) operations, I believe it will be a problem when scaling out with large number of Executors as it effectively makes adding N executors at time complexity O(N^2).

 

I propose to invoke onExecutorIdle guarded by 
{code:java}
if (executorIds.size - executorsPendingToRemove.size >= minNumExecutors +1) { // Since we only need to re-remark idle executors when low bound
    executorIds.filter(listener.isExecutorIdle).foreach(onExecutorIdle)
} else {
    onExecutorIdle(executorId)
}{code}
cc [~zsxwing]

  was:
The ExecutorAllocationManager.onExecutorAdded is an O(n) operations, I believe it will be a problem when scaling out with large number of Executors as it effectively makes adding N executors at time complexity O(N^2).

 

I propose to invoke onExecutorIdle guarded by 
{code:java}
if (executorIds.size - executorsPendingToRemove.size >= minNumExecutors +1) { // Since we only need to re-remark idle executors when low bound
    executorIds.filter(listener.isExecutorIdle).foreach(onExecutorIdle)
}{code}
cc [~zsxwing]


> ExecutorAllocationManager.onExecutorAdded is an O(n) operation
> --------------------------------------------------------------
>
>                 Key: SPARK-24006
>                 URL: https://issues.apache.org/jira/browse/SPARK-24006
>             Project: Spark
>          Issue Type: Improvement
>          Components: Spark Core
>    Affects Versions: 2.3.0
>            Reporter: Xianjin YE
>            Priority: Major
>
> The ExecutorAllocationManager.onExecutorAdded is an O(n) operations, I believe it will be a problem when scaling out with large number of Executors as it effectively makes adding N executors at time complexity O(N^2).
>  
> I propose to invoke onExecutorIdle guarded by 
> {code:java}
> if (executorIds.size - executorsPendingToRemove.size >= minNumExecutors +1) { // Since we only need to re-remark idle executors when low bound
>     executorIds.filter(listener.isExecutorIdle).foreach(onExecutorIdle)
> } else {
>     onExecutorIdle(executorId)
> }{code}
> cc [~zsxwing]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org