Resource-aware scheduler
A resource-aware scheduler helps users specify the amount of resources required for a single instance of any component (spout or bolt). We can enable the resource-aware scheduler by specifying the following property in the storm.yaml
file:
storm.scheduler: "org.apache.storm.scheduler.resource.ResourceAwareScheduler"
Component-level configuration
You can allocate the memory requirement to any component. Here are the methods available to allocate the memory to a single instance of any component:
public T setMemoryLoad(Number onHeap, Number offHeap)
Alternatively, you can use the following:
public T setMemoryLoad(Number onHeap)
The following is the definition of each argument:
onHeap
: The amount of on heap space an instance of this component will consume in megabytesoffHeap
: The amount of off heap space an instance of this component will consume in megabytes
The data type of both onHeap
and offHeap
is Number
, and the default value is 0.0
.
Memory usage example
Let's consider...