--- myst: html_meta: "description lang=en": "Learn how to configure AutoScale Scheduling in Kasm Workspaces to dynamically manage compute resources based on predefined active times. Reduce costs by automating resource scaling based on business hours, off-peak periods, and user demand." "keywords": "Kasm, AutoScale, scheduling, autoscaling, resource management, compute optimization, business hours, cost reduction" "property=og:locale": "en_US" --- ```{title} AutoScale Scheduling ``` # AutoScale Scheduling Kasm AutoScaling configurations have the capability of being scheduled for active times. This capability allows customers to save compute costs by turning off Kasm AutoScaling when that extra compute is not needed. AutoScale schedules are available as a tab when editing an AutoScale configuration. If no schedule is defined then the AutoScale configuration is considered active unless disabled. Kasm will not scale down a server that has active sessions on it, so the administrator can be assured they will not disrupt any existing Kasm sessions when the schedule becomes inactive. When an AutoScale configuration for **Docker Agents** is inactive any unused staged sessions will be removed and no new sessions (staged or user created) will be assigned to any **Docker Agents** that are part of the inactive AutoScale configuration. Since an AutoScale configuration with an inactive schedule will not provision any compute resources, the administrator may want two AutoScale configurations: one that has minimal standby compute available to minimize compute costs and one that has more substantial resources configured. This will allow users to always get a session even if it takes extra time on off hours. The administrator can even configure 0 for the standby cpu/memory/gpu during the off hours and allow session resource provisioning to be fulfilled fully on demand. ```{image} /images/compute/autoscale_schedule_tab.png :align: center :scale: 70% ``` Click on **Add Schedule** to create a new schedule for the AutoScaling configuration. On the **Add Schedule** screen there are fields for what days of the week this schedule should be active as well as both a start time, end time, and a timezone. Kasm will convert the time from the Kasm database to match the timezone specified when determining if a schedule is active or not. Multiple schedules can be defined for each AutoScale configuration. ```{image} /images/compute/add_new_autoscale_schedule_config.png :align: center :scale: 70% ``` ## Example AutoScale Schedules Here are a few examples of how AutoScale schedules can be leveraged. ```{eval-rst} .. dropdown:: Basic Example (Traditional Business Schedule) :animate: fade-in This example is for a business whose core hours are 8 a.m. to 5 p.m., Monday through Friday. Each weekday, this configuration turns on autoscaling at 7 a.m. and turns it off at 6 p.m. This way, all compute is available well before the 8 a.m. start time and costs are reduced overnight and over the weekend, when there is no business need for the compute. The **Add Schedule** screen would look similar to this: .. figure:: /images/compute/basic_autoscale_schedule.png :align: center Basic AutoScale Schedule ``` ```{eval-rst} .. dropdown:: Multiple Continuous Days Schedule :animate: fade-in A more complicated example would be if an Administrator wanted compute resources to come online at 3 p.m. Wednesday, and stay on until 11 a.m. Friday. For this the administrator would create three separate schedules on the autoscale config which would provide the desired functionality. The first schedule the administrator would select only wednesday, start time 3:00 p.m., and end time 11:59 p.m. .. figure:: /images/compute/continuous_autoscale_schedule_wednesday.png :align: center Wednesday Start AutoScale Schedule The second schedule the administrator would select Thursday, with start time 12:00 a.m. and end time 11:59 p.m. .. figure:: /images/compute/continuous_autoscale_schedule_thursday.png :align: center Thursday All Day AutoScale Schedule The third schedule the administrator would select Friday, with start time 12:00 a.m. and end time 11:00 a.m. .. figure:: /images/compute/continuous_autoscale_schedule_friday.png :align: center Friday End AutoScale Schedule .. figure:: /images/compute/continuous_autoscale_schedules.png :align: center Set of Schedules For Multi-Day AutoScale Scheduling ``` ```{eval-rst} .. dropdown:: Overnight schedule :animate: fade-in Here is an example of an overnight schedule where the start time is later than the end time. This will result in an overnight schedule. It will become active on the start time on the day(s) of the week selected, and will become inactive at the end time of the following day. In the following example the Autoscale configuration will become active on Tuesday and Thursday at 9:00 p.m. and will deactivate on Wednesday and Friday at 5:00 a.m. .. figure:: /images/compute/autoscale_schedule_overnight.png :align: center Overnight AutoScale Schedule ``` ```{eval-rst} .. dropdown:: Multiple Time Periods Within a Day :animate: fade-in By using multiple schedules it is possible to configure multiple active times within a single day. Here morning shift is configured from 8:00 a.m. until 12:00 p.m. on Monday, Wednesday and Friday. .. figure:: /images/compute/autoscale_schedule_split_day_morning.png :align: center Multiple Time Periods Morning AutoScale Schedule The afternoon shift is configured from 2:00 p.m. until 6:00 p.m. on the same days. .. figure:: /images/compute/autoscale_schedule_split_day_afternoon.png :align: center Multiple Time Periods Afternoon AutoScale Schedule .. figure:: /images/compute/autoscale_schedule_split_day.png :align: center List of AutoScale Schedules for Multiple Time Periods Within a Day ```