You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat(policy): add new fixedBuffer autoscaling
The new policy will add a buffer of rooms of fixed size/amount
on top of the occupied rooms. Instead of relying on relative
occupancy to determine the amount of rooms in the system
* feat(api): new fixedBuffer policy to API
Managament API can receive a new policy type for scheduler autoscaling
which is the 'fixedBuffer' one. The validations were moved to a struct-level
validation so we can infere nested field values based on policy type
* chore(docker): remove no_cache from local dev
* fix(policy): refactor fixedBuffer map
* fix(metrics): default zero on game room metrics
* chore(worker): reduce log ingestion
Copy file name to clipboardExpand all lines: docs/tutorials/Autoscaling.md
+123Lines changed: 123 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,6 +111,8 @@ autoscaling:
111
111
Maestro has a set of predefined policy types that can be used to configure the autoscaling, each policy will implement
112
112
a specific strategy for calculating the desired number of rooms and will have its configurable parameters.
113
113
114
+
**Note:** Policy types are mutually exclusive. The parameters used will depend on the value of `autoscaling.policy.type`.
115
+
114
116
### Room Occupancy Policy
115
117
The basic concept of this policy is to scale the scheduler up or down based on the actual room occupancy rate, by defining a "buffer" percentage
116
118
of ready rooms that Maestro must keep. The desired number of rooms will be given by the following formula:
@@ -190,3 +192,124 @@ Below are some simulated examples of how the room occupancy policy will behave:
190
192
| 1 | 1 | 0.3 | 2 | Scale Up: +1 |
191
193
| 2 | 2 | 0.9 | 20 | Scale Up: +18 |
192
194
195
+
### Fixed Buffer Amount Policy
196
+
The Fixed Buffer Amount policy maintains a fixed number of rooms on top of the currently occupied rooms. This policy is useful when you want to ensure a consistent buffer of available rooms regardless of the occupancy rate.
197
+
198
+
The desired number of rooms will be given by the following formula:
if autoscaling.Max != -1 && desiredNumberOfRooms > autoscaling.Max {
212
+
desiredNumberOfRooms = autoscaling.Max
213
+
}
214
+
```
215
+
216
+
Maestro will constantly try to maintain the specified fixed amount of rooms in addition to the occupied rooms, ensuring there are always enough rooms available for new players.
217
+
218
+
#### Fixed Buffer Policy Parameters
219
+
220
+
-**fixedBufferAmount**[integer]: The fixed number of rooms that Maestro should maintain on top of the occupied rooms. Must be a value greater than 0 and less than the maximum number of rooms (max) when max is greater than 0.
// Amount represents an integer of the amount of rooms that a scheduler should maintain at ready state at all times, it must be provided if Policy Type is Fixed.
88
+
// +optional
89
+
FixedBuffer*FixedBufferParams
84
90
}
85
91
86
92
// RoomOccupancyParams represents the parameters accepted by rooms occupancy autoscaling properties.
@@ -90,3 +96,9 @@ type RoomOccupancyParams struct {
90
96
// DownThreshold indicates the percentage of occupied rooms a scheduler should have to trigger a downscale event.
91
97
DownThresholdfloat64`validate:"gt=0,lt=1"`
92
98
}
99
+
100
+
// FixedBufferParams represents the parameters accepted by fixed buffer autoscaling properties.
101
+
typeFixedBufferParamsstruct {
102
+
// Amount indicates the amount of rooms that a scheduler should maintain at ready state at all times.
0 commit comments