Get past Oracle's low resource purge warning (Yes fake load)

Ubaada 18-04-2023 124 views |

Update: It doesn't work.

If you're hosting something on an oracle's free tier VM that doesn't put particularly high load you might have received the following warning:

As a reminder, Oracle Cloud Infrastructure (OCI) will soon be reclaiming idle Always Free compute resources from Always Free customers only … instances in your account had been idle for 7 days. If these instances continue to be identified as idle, they will be stopped on [date] If your idle Always Free compute instance is stopped …

The oracle cloud documentation defines idle VMs as the instances with "CPU utilization for the 95th percentile is less than 10%" (as far as compute is concerned anyway). So we need >10% CPU utilization for >1h 12m if my math is right. We'll mock a 20% load for 2h to be on the safe side.

How?

SSH into your VM & install the stress test tool.

sudo yum install stress-ng

Open the cron job list in terminal to configure a daily automatic dummy load.

crontab -e

Add the following line to schedule an even 20% stress load for 2 hours. It runs at 3am in this example. Choose any unbusy time.

0 3 * * * stress-ng --cpu 0 --cpu-load 20 --timeout 2h

Result:

Did it work?

It's past the dooms day date and the VM wasn't killed so … probably yes.