aws / aws/res

Enable machines to follow the schedule even if they aren't considered "idle"

Open
#171 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
115
Forks
35
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
The schedule feature only switches off machines considered idle. Currently we are unable to use the "idle" feature as the CPU utilisation needs to be set very high for it to work (see details below) but many of our users primarily use the GPU so the CPU utilisation remains low (around 6%) - this prevents us from being able to set a "safe" CPU utilisation %. What this means is the "schedule" feature never actually ever switches off the machines.

Background:
```
We configured the VDI (Ubuntu 22.04) auto-stop feature to stop after 15 minutes of idle time (defined as CPU utilization 30%) — but the VDI isn't stopping as expected. aws verified this by reviewing logs, testing different configurations (e.g., 5 minutes with 90%), and sharing these results with AWS support over several weeks. Based on AWS responses
Idle Time Resets:
Logs show the CPU occasionally exceeds 30% before reaching 900 seconds (15 minutes), which resets the idle timer. For example, one entry shows the timer reached ~839 seconds, but then got reset.
Buffer Time:
AWS adds an internal buffer (5 minutes) to idle time. So, a 15-minute idle timeout effectively becomes 20 minutes before action is taken.
CPU Metrics Discrepancy:
The script used to measure CPU (via psutil) operates at the OS level and is more sensitive than the EC2 hypervisor metrics. Hence, even if the EC2 dashboard shows low usage, psutil might show spikes that cross the 30% threshold.
Working Configuration:
You confirmed that 5 minutes idle + 90% CPU threshold worked as expected, validating that the auto-stop logic itself isn’t broken.
Background Processes:
Spikes in CPU may be caused by background OS processes, leading to false resets of the idle timer.

```
**Describe the solution you'd like**
Enable an option to enable the schedule even for machines not considered idle.

**Describe alternatives you've considered**
--

**Additional context**
--

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing the schedule and idle-detection logic, then identify where the schedule is gated on idle status; done means exposing an option that allows scheduled shutdowns for machines that are not considered idle, with coverage for both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, python
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.