Spectivis Cloud
Sleep and wake
Environments with no visitors sleep and use no credit, and wake on the next request.
An environment with no visitors goes to sleep and uses no credit while asleep. The next request wakes it. That is what makes a small plan go a long way for apps that are not busy all day.
Every environment has a “Sleep when idle” switch. It is on by default. Any plan can turn it off. An environment that never sleeps uses credit all month at its size’s price, for example $2.50 for 1 GB.
When an environment is idle
Section titled “When an environment is idle”An environment is idle when it has had no web requests for 10 minutes and has no open connections.
These count as activity, so they keep it awake:
- A request in progress.
- An open WebSocket connection.
- A command you are running from the Commands tab, or an open terminal.
These do not count: the queue worker looking for jobs, and the scheduler’s ticks. If they did, a Laravel app would never sleep.
The three stages
Section titled “The three stages”| Stage | When | How long a wake takes |
|---|---|---|
| Frozen | After 10 minutes idle | Under a third of a second |
| Frozen, with memory moved out of the way | After 1 hour asleep | Under a second more than the page usually takes |
| Stopped | After 7 days asleep | A cold start, 2 to 8 seconds. The panel marks the environment “slow first load”. |
Every stage costs nothing. The visitor who wakes the app waits a little longer than usual. While the app wakes, Cloud holds the request for up to 10 seconds. If the app needs longer, the visitor sees a page that says the site is starting and reloads on its own.
A deploy, the “Wake now” button, a command and opening the WordPress or Magento page also wake the environment.
Queue jobs and scheduled tasks pause while asleep
Section titled “Queue jobs and scheduled tasks pause while asleep”While an environment is asleep, its queue worker and its scheduler are asleep with it. Queue jobs and scheduled tasks pause. They continue when the environment wakes up.
If your app needs them to run on time, turn off “Sleep when idle”. The switch says so:
Queue jobs and scheduled tasks pause while the app sleeps. Turn sleep off to keep them running.
Examples that need sleep turned off: a task that sends a daily report at 8:00, a queue that must send email within a minute, a worker that polls another service.
What you see
Section titled “What you see”An asleep environment shows the grey badge “Asleep” and a banner that says it wakes on the next request, with a Wake now button.
The Metrics page shows how long waking took as “Cold start” next to the response time, with how many requests woke the app. Those requests are not counted in the median and 95th percentile, so a wake does not make your app look slow.
Static sites
Section titled “Static sites”Static sites have no instance. They do not sleep and there is nothing to wake.
Other ways an environment is not running
Section titled “Other ways an environment is not running”| Status | Why | Wakes on a request |
|---|---|---|
| Asleep | No visitors | Yes |
| Stopped | You stopped it, or a downgrade left it larger than the new plan allows | No |
| Paused | The organization has no credit left | No |
| Suspended | The plan is suspended | No |