Skip to main content
Clever Cloud Reaper
Cloud APIM · Otoroshi extension

Put the Clever Cloud apps nobody uses to sleep

Staging, demo and preview apps spend their nights and weekends waiting for someone. The Clever Cloud Reaper stops your Clever Cloud apps when they get no traffic, and wakes them up on the next request, right from the Otoroshi routes that serve them.

Watch, reap, wake

The reaper is a plugin on the routes of your apps, and a job that drives them through their lifecycle with the Clever Cloud API. Nothing else to deploy.

01It watches

Every request through a route under the reaper is an access, recorded in memory on the node that served it, and flushed every few seconds. No log pipeline, no analytics backend.

02It reaps

An app without traffic for its grace period, outside its must-be-up hours, is stopped through the Clever Cloud API. Its instances stop costing anything.

03It wakes

The next request starts it again. A browser gets a page that reloads itself once the app answers; an API call is held until the app is up, or gets a clean 503.

Every route, and where its app stands

A table of every route with the state of its app, and a page per route to tune it, act on it and read its history.

The routes table of the Clever Cloud ReaperThe waiting page a browser gets while its app wakes up

On Clever Cloud since day one

Otoroshi has been deployed on Clever Cloud since its very first day, and Clever Cloud now runs it as a managed service, Otoroshi with LLM. An Otoroshi in front of Clever Cloud apps is a common setup: it already sees every request those apps get, so it is the natural place to notice the ones nobody uses, and to wake them up when someone does.

The reaper talks to the Clever Cloud API with an API token, counts what sleeping saved with the Clever Cloud prices of each zone, and links every app to its page in the Clever Cloud console.

What the reaper gives you

Per route
All the settings in one plugin

Grace period, must-be-up hours, monitoring requests to ignore, what callers get while the app boots, a custom waiting page. Add the plugin to a route and you are done: no other entity to create.

Waking up
A waiting page that knows when to reload

The page polls its own URL and reloads the moment your app really answers it: not when a deployment says it is done, and not on a timer. Bring your own HTML if you like.

Waking up
Held requests for APIs

An API call on a sleeping app can simply wait, held open before the backend call, and go through once the app is up. To the caller it is a slow response, not an error.

Staying awake
Office hours and uptime checks

Keep apps up during the hours people use them, started before they arrive. Tell uptime checks and health probes apart from traffic: they neither keep an app awake nor wake it up.

Console
Every route, in the backoffice

A table of every route with the state of its app, and a page per route with its settings, its actions (wake up, put to sleep, reset) and the history of its app.

Cluster
Built for Otoroshi clusters

One job per cluster drives the apps, with a lock per app so nothing is ever started twice. Workers serve from memory and report their traffic to the leaders.

Safety
Hands off when in doubt

An app whose last deployment failed is never stopped. An app that fails to stop or start goes into error, raises an alert, and is left alone until someone looks at it.

Safety
Dry-run and a kill switch

Start in dry-run to read what would be put to sleep. Flip the kill switch from the console to stop all reaping across the cluster, at once, without a restart.

Observability
History, events, alerts

Every transition is kept per app and sent as an Otoroshi event, to route through any data exporter. An app in error raises an alert.

Five minutes to a first sleeping app

Download the jar, give it a Clever Cloud API token, and enable the reaper on a route from the console. The quickstart walks through it with a two minute grace period, so you see it happen.

# a clever cloud api token, for the reaper
clever tokens create "otoroshi reaper"

# otoroshi and the extension
curl -L -o otoroshi.jar \
'https://github.com/MAIF/otoroshi/releases/download/v18.0.0-rc1/otoroshi.jar'
curl -L -o reaper.jar \
'.../otoroshi-clevercloud-reaper/releases/download/<version>/otoroshi-clevercloud-reaper_3-<version>.jar'

# run them together
CLEVER_CLOUD_API_TOKEN='...' java -cp "./reaper.jar:./otoroshi.jar" \
play.core.server.ProdServerStart