iamfree

A modern guide for lookbusy on Oracle


What is lookbusy and why use it?

Lookbusy is a lightweight tool for generating synthetic load on a Linux system. It allows you to keep your system active by simulating CPU, Memory, and Disk activity at precise levels.

This is particularly useful for Oracle Cloud Infrastructure (OCI) users who want to keep their "Always Free" instances from being reclaimed. Lookbusy works by adjusting its own consumption in real-time to maintain a steady total system load, regardless of other background processes.


Reclamation of Oracle Cloud's Idle Instances

Oracle Cloud Infrastructure (OCI) may reclaim "Always Free" instances if they are deemed idle for 7 days. An instance is considered idle if:

  • CPU utilization for the 95th percentile is less than 20%
  • Network utilization is less than 20%
  • Memory utilization is less than 20% (applies to A1 shapes only)

Source: Oracle Documentation

Installation from Source (Ubuntu)

Run these commands to install dependencies, download, and compile lookbusy:

sudo apt update && sudo apt install -y curl build-essential
curl -L /downloads/lookbusy-latest.tar.gz -o lookbusy-latest.tar.gz
tar -xzvf lookbusy-latest.tar.gz
cd lookbusy-*/
./configure && make && sudo make install

Running as a Systemd Service

To ensure lookbusy starts automatically on boot and stays running in the background, first create the service file:

sudo systemctl edit --full --force lookbusy.service

Paste the following optimized configuration. We use Nice=19 to ensure lookbusy only uses CPU cycles that are not needed by other processes:

[Unit]
            Description=lookbusy - OCI Idle Prevention Service
            After=network.target

            [Service]
            Type=simple
            ExecStart=/usr/local/bin/lookbusy -c 20 -m 0MB
            Restart=always
            RestartSec=10
            KillSignal=SIGINT
            Nice=19

            # Security Hardening
            ProtectSystem=full
            ProtectHome=true
            NoNewPrivileges=true
            PrivateTmp=true

            [Install]
            WantedBy=multi-user.target

Finally, enable and start the service:

sudo systemctl enable --now lookbusy.service

Verification

Check if the service is running and view the current system load:

sudo systemctl status lookbusy.service
top

Configuration Examples for OCI

1. AMD EPYC Instance

(2 cores, 1 GB RAM)

Goal: 20% CPU on each core. No RAM required.

lookbusy -n 2 --cpu-util=20

2. Ampere A1 Instance

(4 cores, 24 GB RAM)

Goal: 20% CPU and 20% RAM (~4.8GB).

lookbusy -n 4 --cpu-util=20 -m 5GB

Alternative: Docker Usage

If you prefer a containerized approach:

sudo docker run -itd --name=lookbusy --restart=always \
    -e TZ=Europe/Paris \
    -e CPU_UTIL=10-25 \
    -e CPU_CORE=1 \
    -e MEM_UTIL=0 \
    -e SPEEDTEST_INTERVAL=120 \
    fogforest/lookbusy

Alternative: Docker Compose

Create a docker-compose.yml file:

version: '3'
services:
  lookbusy:
    image: fogforest/lookbusy
    container_name: lookbusy
    restart: always
    environment:
      - TZ=Europe/Paris
      - CPU_UTIL=10-25
      - CPU_CORE=1
      - MEM_UTIL=0
      - SPEEDTEST_INTERVAL=120

Then run:

sudo docker-compose up -d

Direct Downloads