Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Optimise Throttling Allocation Decider #13743

Closed
Bukhtawar opened this issue May 19, 2024 · 0 comments · Fixed by #13750
Closed

[Feature Request] Optimise Throttling Allocation Decider #13743

Bukhtawar opened this issue May 19, 2024 · 0 comments · Fixed by #13750
Labels
enhancement Enhancement or improvement to existing feature or request ShardManagement:Performance

Comments

@Bukhtawar
Copy link
Collaborator

Bukhtawar commented May 19, 2024

Is your feature request related to a problem? Please describe

 97.1% (19.4s out of 20s) cpu usage by thread 'opensearch[b869f183befc74cff9f3b5572821ec21][clusterManagerService#updateTask][T#1]'
     2/10 snapshots sharing following 25 elements
       [email protected]/java.util.Formatter.format(Formatter.java:2625)
       [email protected]/java.lang.String.format(String.java:4186)
       app//org.opensearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider.allocateNonInitialShardCopies(ThrottlingAllocationDecider.java:250)
       app//org.opensearch.cluster.routing.allocation.decider.ThrottlingAllocationDecider.canAllocate(ThrottlingAllocationDecider.java:200)
       app//org.opensearch.cluster.routing.allocation.decider.AllocationDeciders.canAllocate(AllocationDeciders.java:94)
       app//org.opensearch.cluster.routing.allocation.allocator.LocalShardsBalancer.decideAllocateUnassigned(LocalShardsBalancer.java:927)
       app//org.opensearch.cluster.routing.allocation.allocator.LocalShardsBalancer.allocateUnassigned(LocalShardsBalancer.java:813)
       app//org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.allocate(BalancedShardsAllocator.java:288)
       app//org.opensearch.cluster.routing.allocation.AllocationService.reroute(AllocationService.java:557)
       app//org.opensearch.cluster.routing.allocation.AllocationService.reroute(AllocationService.java:524)
       app//org.opensearch.node.Node$$Lambda$2608/0x0000008800a32948.apply(Unknown Source)
       app//org.opensearch.cluster.routing.BatchedRerouteService$1.execute(BatchedRerouteService.java:136)
       app//org.opensearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:67)
       app//org.opensearch.cluster.service.MasterService.executeTasks(MasterService.java:882)
       app//org.opensearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:434)
       app//org.opensearch.cluster.service.MasterService.runTasks(MasterService.java:301)
       app//org.opensearch.cluster.service.MasterService$Batcher.run(MasterService.java:212)
       app//org.opensearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:209)
       app//org.opensearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:247)
       app//org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:863)
       app//org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedOpenSearchThreadPoolExecutor.java:283)
       app//org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedOpenSearchThreadPoolExecutor.java:246)
       [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       [email protected]/java.lang.Thread.run(Thread.java:840)
     3/10 snapshots sharing following 23 elements
       app//org.opensearch.cluster.routing.allocation.decider.DiskThresholdDecider.canAllocate(DiskThresholdDecider.java:224)       app//org.opensearch.cluster.routing.allocation.decider.AllocationDeciders.canAllocate(AllocationDeciders.java:94)
       app//org.opensearch.cluster.routing.allocation.allocator.LocalShardsBalancer.decideAllocateUnassigned(LocalShardsBalancer.java:927)
       app//org.opensearch.cluster.routing.allocation.allocator.LocalShardsBalancer.allocateUnassigned(LocalShardsBalancer.java:813)
       app//org.opensearch.cluster.routing.allocation.allocator.BalancedShardsAllocator.allocate(BalancedShardsAllocator.java:288)
       app//org.opensearch.cluster.routing.allocation.AllocationService.reroute(AllocationService.java:557)
       app//org.opensearch.cluster.routing.allocation.AllocationService.reroute(AllocationService.java:524)
       app//org.opensearch.node.Node$$Lambda$2608/0x0000008800a32948.apply(Unknown Source)
       app//org.opensearch.cluster.routing.BatchedRerouteService$1.execute(BatchedRerouteService.java:136)
       app//org.opensearch.cluster.ClusterStateUpdateTask.execute(ClusterStateUpdateTask.java:67)
       app//org.opensearch.cluster.service.MasterService.executeTasks(MasterService.java:882)
       app//org.opensearch.cluster.service.MasterService.calculateTaskOutputs(MasterService.java:434)
       app//org.opensearch.cluster.service.MasterService.runTasks(MasterService.java:301)
       app//org.opensearch.cluster.service.MasterService$Batcher.run(MasterService.java:212)
       app//org.opensearch.cluster.service.TaskBatcher.runIfNotProcessed(TaskBatcher.java:209)
       app//org.opensearch.cluster.service.TaskBatcher$BatchedTask.run(TaskBatcher.java:247)
       app//org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:863)
       app//org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor$TieBreakingPrioritizedRunnable.runAndClean(PrioritizedOpenSearchThreadPoolExecutor.java:283)
       app//org.opensearch.common.util.concurrent.PrioritizedOpenSearchThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedOpenSearchThreadPoolExecutor.java:246)
       [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
       [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
       [email protected]/java.lang.Thread.run(Thread.java:840)

Describe the solution you'd like

  1. Avoid unnecessary String formats
  2. Optimise loops by caching static values

Related component

ShardManagement:Performance

Describe alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request ShardManagement:Performance
Projects
Status: ✅ Done
1 participant