You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Dmitro Lisnichenko <dl...@hortonworks.com> on 2015/12/29 16:44:45 UTC

Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/
-----------------------------------------------------------

Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.


Bugs: AMBARI-14520
    https://issues.apache.org/jira/browse/AMBARI-14520


Repository: ambari


Description
-------

On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
{noformat}
POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions

{"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
{noformat}


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 

Diff: https://reviews.apache.org/r/41774/diff/


Testing
-------

mvn clean test

Current request execution time: 0m22.678s

With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.


Thanks,

Dmitro Lisnichenko


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Jayush Luniya <jl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112325
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java (line 1205)
<https://reviews.apache.org/r/41774/#comment172773>

    Add params description.


- Jayush Luniya


On Dec. 30, 2015, 10:41 a.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 30, 2015, 10:41 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review113124
-----------------------------------------------------------

Ship it!


Ship It!

- Jonathan Hurley


On Jan. 6, 2016, 12:22 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Jan. 6, 2016, 12:22 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java 0188702 
>   ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java 7b20600 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/
-----------------------------------------------------------

(Updated Jan. 6, 2016, 7:22 p.m.)


Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.


Changes
-------

Fixed few unit test failing on branch-2.2

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] Ambari Views ...................................... SUCCESS [1.557s]
[INFO] Ambari Metrics Common ............................. SUCCESS [1.265s]
[INFO] Ambari Server ..................................... SUCCESS [1:36:37.775s]
[INFO] Ambari Agent ...................................... SUCCESS [10.704s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:36:51.617s
[INFO] Finished at: Wed Jan 06 19:03:32 EET 2016
[INFO] Final Memory: 71M/911M
[INFO] ------------------------------------------------------------------------


Bugs: AMBARI-14520
    https://issues.apache.org/jira/browse/AMBARI-14520


Repository: ambari


Description
-------

On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
{noformat}
POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions

{"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
{noformat}


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProviderTest.java 0188702 
  ambari-server/src/test/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProviderTest.java 7b20600 

Diff: https://reviews.apache.org/r/41774/diff/


Testing
-------

mvn clean test

Current request execution time: 0m22.678s

With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.


Thanks,

Dmitro Lisnichenko


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Jonathan Hurley <jh...@hortonworks.com>.

> On Jan. 4, 2016, 11:08 a.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java, line 373
> > <https://reviews.apache.org/r/41774/diff/4/?file=1180186#file1180186line373>
> >
> >     Any reason we're using a Gson instance from another class here? Seems like we can just inject it directly into the ResourceProvider
> 
> Dmitro Lisnichenko wrote:
>     This method is used 60+ times over different code. There is no docs in utility class regarding that, but I assume that it is done either to avoid frequent creation of Gson instances (code was committed due to perf jira AMBARI-1539), or to be able to manage json generation parameters in one place.

Seems wrong. GSON is bound as a singleton via Guice (from ControllerModule)
`bind(Gson.class).in(Scopes.SINGLETON);` So that any injected GSON incurs no initialization overhead.


- Jonathan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112590
-----------------------------------------------------------


On Dec. 31, 2015, 10:47 a.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 10:47 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.

> On Jan. 4, 2016, 6:08 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java, line 373
> > <https://reviews.apache.org/r/41774/diff/4/?file=1180186#file1180186line373>
> >
> >     Any reason we're using a Gson instance from another class here? Seems like we can just inject it directly into the ResourceProvider

This method is used 60+ times over different code. There is no docs in utility class regarding that, but I assume that it is done either to avoid frequent creation of Gson instances (code was committed due to perf jira AMBARI-1539), or to be able to manage json generation parameters in one place.


- Dmitro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112590
-----------------------------------------------------------


On Dec. 31, 2015, 5:47 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 5:47 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.

> On Jan. 4, 2016, 6:08 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java, line 373
> > <https://reviews.apache.org/r/41774/diff/4/?file=1180186#file1180186line373>
> >
> >     Any reason we're using a Gson instance from another class here? Seems like we can just inject it directly into the ResourceProvider
> 
> Dmitro Lisnichenko wrote:
>     This method is used 60+ times over different code. There is no docs in utility class regarding that, but I assume that it is done either to avoid frequent creation of Gson instances (code was committed due to perf jira AMBARI-1539), or to be able to manage json generation parameters in one place.
> 
> Jonathan Hurley wrote:
>     Seems wrong. GSON is bound as a singleton via Guice (from ControllerModule)
>     `bind(Gson.class).in(Scopes.SINGLETON);` So that any injected GSON incurs no initialization overhead.

You are right, but I was looking on source code of org.apache.ambari.server.utils.StageUtils#getGson
It creates it's own instance:
  gson = new Gson();
I can change using gson instance from StageUtils to injection in my patch, or open a jira for a comprehensive fix


- Dmitro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112590
-----------------------------------------------------------


On Dec. 31, 2015, 5:47 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 5:47 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112590
-----------------------------------------------------------

Ship it!


Just the one comment about setting the cluster host info.


ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java (line 373)
<https://reviews.apache.org/r/41774/#comment173090>

    Any reason we're using a Gson instance from another class here? Seems like we can just inject it directly into the ResourceProvider


- Jonathan Hurley


On Dec. 31, 2015, 10:47 a.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 10:47 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112638
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Dec. 31, 2015, 10:47 a.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 10:47 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.

> On Jan. 4, 2016, 3:38 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java, lines 435-439
> > <https://reviews.apache.org/r/41774/diff/4/?file=1180185#file1180185line435>
> >
> >     This seems dangerous.  This had to have been added because some custom commands require the cluster topology to work correctly (not just for installing packages?).  Maybe check if the object exists and is zero-size and add it if it's not there?

we don't need this info for installing packages. Myroslav says that execCmd.setClusterHostInfo() is obsolete and should not be used, since we are always setting/using clusterHostInfo on stage level. So it is not required at all, and slows down every addExecutionCommandsToStage() call
I checked org.apache.ambari.server.controller.AmbariActionExecutionHelper#addExecutionCommandsToStage() calls, and at all places we are setting per-stage clusterHostInfo json when creating a stage


- Dmitro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112569
-----------------------------------------------------------


On Dec. 31, 2015, 5:47 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 5:47 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112569
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 
<https://reviews.apache.org/r/41774/#comment173068>

    This seems dangerous.  This had to have been added because some custom commands require the cluster topology to work correctly (not just for installing packages?).  Maybe check if the object exists and is zero-size and add it if it's not there?


- Nate Cole


On Dec. 31, 2015, 10:47 a.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 31, 2015, 10:47 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/
-----------------------------------------------------------

(Updated Dec. 31, 2015, 5:47 p.m.)


Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.


Changes
-------

Updated javadoc


Bugs: AMBARI-14520
    https://issues.apache.org/jira/browse/AMBARI-14520


Repository: ambari


Description
-------

On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
{noformat}
POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions

{"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
{noformat}


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 

Diff: https://reviews.apache.org/r/41774/diff/


Testing
-------

mvn clean test

Current request execution time: 0m22.678s

With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.


Thanks,

Dmitro Lisnichenko


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112302
-----------------------------------------------------------



ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 
<https://reviews.apache.org/r/41774/#comment172738>

    This code was obsolete. We set clusterHostInfo on stage level, and don't need it on command level



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java (line 371)
<https://reviews.apache.org/r/41774/#comment172732>

    Now we generate clusterHostInfo once instead of doing that 900 times. It's a costy operation, it was the slowest place when processing request



ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java (line 466)
<https://reviews.apache.org/r/41774/#comment172734>

    Avoid parsing json multiple times, minor optimization



ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java (line 1193)
<https://reviews.apache.org/r/41774/#comment172731>

    Here we avoid opening/closing transaction on every host version update, gives considerable performance boost on big cluster



ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java (line 863)
<https://reviews.apache.org/r/41774/#comment172736>

    Avoid parsing json multiple times, minor optimization


- Dmitro Lisnichenko


On Dec. 30, 2015, 12:41 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 30, 2015, 12:41 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/
-----------------------------------------------------------

(Updated Dec. 30, 2015, 12:41 p.m.)


Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.


Changes
-------

Now should be the correct patch


Bugs: AMBARI-14520
    https://issues.apache.org/jira/browse/AMBARI-14520


Repository: ambari


Description
-------

On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
{noformat}
POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions

{"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
{noformat}


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 

Diff: https://reviews.apache.org/r/41774/diff/


Testing
-------

mvn clean test

Current request execution time: 0m22.678s

With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.


Thanks,

Dmitro Lisnichenko


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/
-----------------------------------------------------------

(Updated Dec. 30, 2015, 12:31 p.m.)


Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.


Changes
-------

attached correct patch


Bugs: AMBARI-14520
    https://issues.apache.org/jira/browse/AMBARI-14520


Repository: ambari


Description
-------

On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
{noformat}
POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions

{"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
{noformat}


Diffs (updated)
-----

  ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
  ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
  ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
  ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 

Diff: https://reviews.apache.org/r/41774/diff/


Testing
-------

mvn clean test

Current request execution time: 0m22.678s

With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.


Thanks,

Dmitro Lisnichenko


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Dmitro Lisnichenko <dl...@hortonworks.com>.

> On Dec. 30, 2015, 1:03 a.m., Alejandro Fernandez wrote:
> > What is the improvement with this?

sorry, attached incomplete patch


- Dmitro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112244
-----------------------------------------------------------


On Dec. 30, 2015, 12:31 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 30, 2015, 12:31 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java 3358e8c 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>


Re: Review Request 41774: BE: Install packages call takes more than 3 minutes on 900 node cluster

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41774/#review112244
-----------------------------------------------------------


What is the improvement with this?

- Alejandro Fernandez


On Dec. 29, 2015, 3:44 p.m., Dmitro Lisnichenko wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41774/
> -----------------------------------------------------------
> 
> (Updated Dec. 29, 2015, 3:44 p.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez, Dmytro Grinenko, Jonathan Hurley, Jayush Luniya, Nate Cole, and Yusaku Sako.
> 
> 
> Bugs: AMBARI-14520
>     https://issues.apache.org/jira/browse/AMBARI-14520
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On 900 host cluster the call to install packages took like 3 minutes 20 seconds which is kind of long.
> {noformat}
> POST http://perf-a-1:8080/api/v1/clusters/c1/stack_versions
> 
> {"ClusterStackVersions":{"stack":"HDP","version":"2.2","repository_version":"2.2.9.0-3393"}}:
> {noformat}
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariActionExecutionHelper.java 6e7e06b 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClusterStackVersionResourceProvider.java b6ac291 
>   ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostStackVersionResourceProvider.java 43a4423 
>   ambari-server/src/main/java/org/apache/ambari/server/state/host/HostImpl.java c56d7ce 
> 
> Diff: https://reviews.apache.org/r/41774/diff/
> 
> 
> Testing
> -------
> 
> mvn clean test
> 
> Current request execution time: 0m22.678s
> 
> With current patch, most time (about 40%) is consumed by findConfigurationTagsWithOverrides(cluster, hostname), but it seems to be inevitable even with batching addExecutionCommandsToStage() calls into a single invocation. I've tried inserting logging statements to verify that number of invocations equals to number of hosts.
> Rest of time is mostly consumed by org.apache.ambari.server.actionmanager.Stage.addHostRoleExecutionCommand() (20% of time) and by N invocations of ClustersImpl.getHostsForCluster() (19% of time). The latter calls can not be cached in method, so I can only rewrite method signature AmbariActionExecutionHelper.addExecutionCommandsToStage(ActionExecutionContext, Stage) and cache it in ClusterStackVersionResourceProvider. Seems to be a bad deal considering 1-3 seconds (on large clusters ) of performance boost for a rare call vs readability/maintainability of code.
> 
> 
> Thanks,
> 
> Dmitro Lisnichenko
> 
>