What is hibernation
Laravel Cloud hibernation is the legacy behavior that puts your environment into a dormant state when no HTTP requests arrive within a timeout window.On modern Flex compute, this has been succeeded by the faster Scale to Zero model. Legacy Flex hibernation can still reduce compute cost while dormant, but wake-up from HTTP requests typically takes 5–20 seconds. The new Scale to Zero starts in under 500ms and can also auto-start for scheduled tasks and queue processing while the app is sleeping.
What changed with Scale to Zero
With Scale to Zero on new Flex compute, major limitations of legacy hibernation are now reduced.| Category | Legacy Hibernation | New Scale to Zero |
|---|---|---|
| Wake-up on HTTP request | 5–20 seconds | Under 500ms |
| Scheduled Tasks | Not executed while sleeping | Auto-starts and executes while sleeping |
| Queue processing | Not executed while sleeping | Auto-starts while sleeping. Managed Queues are recommended |
| Recommended use | Cost-saving in legacy Flex setups | Current default architecture |
Legacy hibernation pauses scheduler and queue processing while asleep. Scale to Zero resolves this in most cases; queue processing is most reliable when combined with Managed Queues to ensure app sleep does not block job handling.
Enabling legacy hibernation
Open the App compute cluster
From your environment’s infrastructure canvas dashboard, click on the App compute cluster.
Limitations during legacy hibernation
When hibernation is enabled and the environment is hibernating, the following features do not run.| Feature | Behavior while hibernating |
|---|---|
| HTTP request handling | Stopped (processed after wake-up) |
| Task Scheduler | Not executed |
| Queue workers | Not executed |
| Custom background processes | Not executed |
These processes resume automatically after the environment wakes up. Scheduled jobs that were due while the environment was hibernating are not retroactively executed.
- Only Flex compute sizes support hibernation. Pro compute sizes cannot hibernate.
- Hibernation operates at the environment level. When an environment hibernates, all compute clusters in that environment hibernate, including Worker clusters.
Common causes of unwanted wake-ups
Any HTTP request will wake the environment, including those you did not intend to trigger:- Bots and crawlers — Search engines and security scanners automatically crawl pages.
- Slack and Teams link previews — Messaging apps fetch page metadata when a URL is shared.
- WordPress scanners — Automated scripts probe paths like
/wp-adminlooking for WordPress installations. - PHP file probing — Automated attacks scan for accessible PHP files.
*.laravel.cloud domains have an X-Robots-Tag: noindex, nofollow header to reduce indexing, but once a domain is discovered, this cannot fully prevent automated requests. Custom domains do not receive the noindex header.
Path Blocking to prevent unwanted wake-ups
Path Blocking lets Laravel Cloud block requests to specific file extensions and paths while the environment is hibernating, so those requests do not trigger a wake-up. The following extensions and paths are blocked by default: Blocked extensions:Laravel applications do not use
.php extension-based routing, so blocking these extensions has no impact on normal application behavior.Good fit vs. poor fit for legacy hibernation
Good fit
- Staging and development environments — Significant cost reduction since 24/7 uptime is not required.
- Personal blogs and portfolios — Low traffic and occasional access.
- Demo or proof-of-concept apps — On-demand wake-up is sufficient.
- Low-frequency internal tools — Limited usage windows.
Poor fit
- Workloads relying on Task Scheduler —
schedule:rundoes not execute while hibernating. - Workloads requiring regular queue processing — Queue workers stop during hibernation.
- Production apps with strict latency requirements — 5–20 second wake-up time may be unacceptable.
- Apps using WebSockets — Connections cannot be maintained and hibernation may be delayed.
In Scale to Zero, this is largely improved: Scheduled Tasks can auto-run while sleeping, and queue workloads can continue reliably when you use Managed Queues.
Summary
Hibernation can still reduce costs on legacy Flex setups, but Scale to Zero is now the practical default.- Legacy Flex bills by active runtime and enters sleep after timeout.
- Legacy hibernation wake-up takes 5–20 seconds.
- Scale to Zero starts in under 500ms.
- In Scale to Zero, Scheduled Tasks and Managed Queues can run while sleeping.
- Use Path Blocking to prevent bot-triggered wake-ups.
- Only Flex compute supports these sleep models.
Related pages
Scheduling
Task Scheduler configuration and how it works with Laravel Cloud.
Queues
Queue worker configuration and how to manage workers on Laravel Cloud.
Laravel Cloud overview
See Managed Queues, Scale to Zero, and pricing changes in one place.