Skip to content

RH checking algorithm

Dilshat edited this page Oct 8, 2018 · 7 revisions

Containers have predefined sizes: TINY, SMALL, MEDIUM, LARGE, HUGE.

Each size has 3 limits for 3 resources: DISK, RAM and CPU.

The limits are:

TINY.ram=256MiB
TINY.cpu=10
TINY.disk=4GiB
SMALL.ram=512MiB
SMALL.cpu=25
SMALL.disk=10GiB
MEDIUM.ram=1024MiB
MEDIUM.cpu=50
MEDIUM.disk=20GiB
LARGE.ram=2048MiB
LARGE.cpu=75
LARGE.disk=40GiB
HUGE.ram=4096MiB
HUGE.cpu=100
HUGE.disk=100GiB

How check is made

Each new container creation request is summed up to requested amount. For example, if a TINY container is requested, its RAM size 256 MB is summed up to requestedRam variable, its DISK size 4 GB is summed up to requestedDisk variable, and its CPU size 10% is summed up to requestedCpu variable.

Then these sums are compared to available resources on an RH (availableRam, availableDisk and availableCpu). Note: availableCpu is calculated as numberOfCores * idleCpu

If there are existing containers on an RH, their historical resource consumption for the last hour is added to available resources variables and their sizes are added to requested resources variables before comparison.

If there are any quota changes for existing containers, new quota sizes are considered in the calculation.

When comparing, requested resources variables are also multiplied by ACCOMMODATION_OVERHEAD_FACTOR which is equal to 1.01.

If available resource variables are greater than or equal to requested resource variables, peer allows to create the requested containers.

Clone this wiki locally