Skip to main content

FixedSourceMultiMove

Move Type: Fixed Complexity: O(bundles × bundle_size) with parallel evaluation Primary Use: RAS stackable solve

Move bundles of related objects from a specific fixed source to hot container. The inverse of FixedDestMultiMove, designed for RAS local search.

Overview

FixedSourceMultiMove (also known as FIXED_SOURCE_MULTIPLE) evaluates moving bundles of related objects from a single predetermined source container to the hot (underutilized) container. Unlike FixedSource which moves one object at a time, this move type moves entire object bundles together.

Use when:

  • Using RAS stackable solve
  • Draining bundles from specific source
  • Know exactly which source to pull from
  • Objects must move as coordinated groups
  • Hot container needs filling with bundles
  • Want parallel evaluation of move sets

Avoid when:

  • Not using RAS local search
  • Objects can move independently (use FixedSource)
  • Don't know source (use Single)
  • Need to explore multiple sources
  • Want solver to find best sources

Quick Example

# Move object bundles from specific source to hot container
solver.addSolver(
SolverSpecs(
localSearchSolverSpec=LocalSearchSolverSpec(
moveTypeList=[
FixedSrcMultiMoveTypeSpec(
specialContainer="old_server", # Fixed source
),
]
)
)
)

Parameters

ParameterTypeRequiredDefaultDescription
specialContainerstringYesnullFixed source container name
maxSamplesPerEquivSetintNo5Max move sets to consider per equivalent set
rasLocalSearchMetadataRasLocalSearchMetadataNonullMetadata for RAS local search

Parameter Details

specialContainer:

  • Name of the specific source container
  • All object bundles will be pulled from this container only
  • Must be a valid container name

maxSamplesPerEquivSet:

  • Limits move sets evaluated per equivalent set
  • Equivalent sets are groups identical from local search perspective
  • Higher values = better quality, more computation
  • Default: 5 samples per equivalent set

rasLocalSearchMetadata:

  • Metadata specific to RAS stackable solve
  • Optional configuration for RAS local search behavior
  • Only relevant for RAS use cases

How It Works

Given a hot container (underutilized destination):

  1. Select bundle: Pick object bundle from specialContainer (source)
  2. Evaluate move: Test moving all objects in bundle to hot container
  3. Parallel evaluation: All move sets evaluated in parallel (multi-threading)
  4. Sample: Consider up to maxSamplesPerEquivSet per equivalent set
  5. Repeat: Try all bundles in special source container
  6. Apply best: Apply the bundle move that improves objective most

Visual Example

Before move:                          After bundle move from specialContainer:
┌──────────────┐ ┌──────────────┐
│ Hot │ │ Hot │
│ Container │ <────────── │ Container │
│ (empty) │ ┌──┤ Bundle1 ←───┼── Pulled from source!
└──────────────┘ │ │ • obj1 │
│ │ • obj2 │
┌──────────────┐ │ └──────────────┘
│ Special │ │
│ Container │ ────────────────┘ ┌──────────────┐
│ Bundle1 ────┼──┐ │ Special │
│ • obj1 │ │ │ Container │
│ • obj2 ────┼──┘ Source │ Bundle2 │
│ Bundle2 │ │ • obj3 │
│ • obj3 │ │ • obj4 │
│ • obj4 │ └──────────────┘
└──────────────┘

Entire bundle moves from specialContainer to hot container

Comparison with FixedDestMultiMove

AspectFixedDestMultiMoveFixedSourceMultiMove
FixedDestinationSource
Hot containerSource (gives)Destination (receives)
Use casePush bundles to destPull bundles from source
Move directionHot → FixedFixed → Hot

Complexity

Per iteration: O(B × S)

Where:

  • B = number of bundles in special source container
  • S = average bundle size (objects per bundle)

Sampling: Limited by maxSamplesPerEquivSet per equivalent set

Example - RAS draining:

  • Source container bundles: 20
  • Average bundle size: 4 objects
  • maxSamplesPerEquivSet: 5
  • Evaluations: ~20 bundles (limited by sampling), 4 objects each
  • Benefit: Parallel evaluation across bundles

Usage Patterns

Drain RAS Server

Pull RAS bundles from server being decommissioned:

# Drain RAS task bundles from server being decommissioned
solver.addSolver(
SolverSpecs(
localSearchSolverSpec=LocalSearchSolverSpec(
moveTypeList=[
FixedSrcMultiMoveTypeSpec(
specialContainer="old_ras_server", # Server to drain
),
]
)
)
)

Fill Underutilized Container

Pull bundles from specific source to fill hot container:

# Fill underutilized container by pulling bundles from specific source
solver = ProblemSolver(service_name="example", service_scope="test")

solver.addSolver(
SolverSpecs(
localSearchSolverSpec=LocalSearchSolverSpec(
moveTypeList=[
FixedSrcMultiMoveTypeSpec(
specialContainer="overloaded_server",
),
]
)
)
)

Sampling Control

Control sampling of equivalent sets:

# Limit evaluations by sampling equivalent sets
solver = ProblemSolver(service_name="example", service_scope="test")

solver.addSolver(
SolverSpecs(
localSearchSolverSpec=LocalSearchSolverSpec(
moveTypeList=[
FixedSrcMultiMoveTypeSpec(
specialContainer="source_server",
maxSamplesPerEquivSet=10, # Evaluate up to 10 per equiv set
),
]
)
)
)

With RAS Metadata

Configure with RAS local search metadata:

# RAS stackable solve with metadata
solver = ProblemSolver(service_name="example", service_scope="test")

from rebalancer.interface.thrift.v2.SolverSpecs.thrift_types import (
RasLocalSearchMetadata,
)

solver.addSolver(
SolverSpecs(
localSearchSolverSpec=LocalSearchSolverSpec(
moveTypeList=[
FixedSrcMultiMoveTypeSpec(
specialContainer="ras_source",
maxSamplesPerEquivSet=5,
rasLocalSearchMetadata=RasLocalSearchMetadata(),
),
]
)
)
)

Performance Characteristics

Speedup Analysis

BundlesBundle SizeFixedSourceMultiMoveSingleSpeedup
20480100K~1250×
5084001M~2500×
100101K10M~10000×

Benefits:

  • Parallel evaluation: All move sets evaluated concurrently
  • Bundle efficiency: Move related objects together
  • Sampling control: maxSamplesPerEquivSet limits computation
  • Fixed source: No source exploration overhead

When Does It Help?

FixedSourceMultiMove helps when:

  • RAS stackable solve: Designed for RAS local search
  • Bundle coordination: Objects must move together
  • Known source: Exactly which source to drain
  • Filling hot container: Underutilized container needs bundles
  • Parallel benefits: Can leverage multi-threading

FixedSourceMultiMove does NOT help when:

  • Not RAS: Use FixedSource for single objects
  • Independent objects: Objects can move separately
  • Unknown source: Need solver to find best source
  • Exploring options: Want to try multiple sources

Comparison with Variants

Move TypeDestinationSourceMove UnitUse Case
FixedSourceHot containerFixed specificSingle objectGeneral pull from source
FixedSourceMultiMoveHot containerFixed specificObject bundleRAS pull from source
FixedDestMultiMoveFixed specificHot containerObject bundleRAS push to dest
FixedDestSwapMultiMoveFixed specificHot containerBundle swapRAS swaps

Decision tree:

  1. RAS stackable + know source?FixedSourceMultiMove
  2. RAS stackable + know dest?FixedDestMultiMove
  3. Single objects + know source?FixedSource
  4. Neither?Single

Troubleshooting

Problem: No improving moves found

Diagnosis: Bundles can't beneficially move from source to hot container

Solutions:

  • Verify specialContainer is correct source
  • Check capacity constraints on hot container
  • Bundle sizes may be too large for destination
  • May already be optimal
  • Try different source or Single

Problem: Wrong bundles moving

Diagnosis: Bundle formation or objective function issue

Solutions:

  • Verify bundle formation logic is correct
  • Check objective function rewards correct bundle moves
  • Review equivalent set definitions
  • May need different objective or constraints
  • Examine which bundles the solver is selecting

Problem: Too many evaluations

Diagnosis: Too many bundles or large equivalent sets

Solutions:

  • Reduce maxSamplesPerEquivSet (default: 5)
  • Start with smaller sample (e.g., 2-3 per set)
  • Review bundle formation to reduce bundle count
  • Check if bundles can be simplified

Problem: Hot container not filling

Diagnosis: Capacity constraints or bundles don't fit

Solutions:

  • Verify hot container has capacity for bundles
  • Check objective function rewards filling hot container
  • Bundle sizes may exceed hot container capacity
  • May need different source
  • Review capacity constraints

When to Use FixedSourceMultiMove

DO use when:

  • Using RAS stackable solve
  • Draining bundles from specific source
  • Know exactly which source to pull from
  • Objects must move as coordinated groups
  • Hot container needs filling with bundles

DO NOT use when:

  • Not using RAS local search
  • Objects can move independently (use FixedSource)
  • Don't know source
  • Need to explore multiple sources
  • General optimization (use Single)

Fixed bundle variants:

RAS move types:

  • All three above are used exclusively for RAS stackable solve
  • Work together in RAS local search strategies

General alternatives:

Source Code

Next Steps