Skip to content

Commit

Permalink
Update restart-strategies.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Dec 27, 2022
1 parent f654283 commit fabb15e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/features/restart-strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@ permalink: /docs/usage/restart-strategies/

## Restart strategies

A new restart mode has been implemented on PM2 Runtime, making your application restarts in a smarter way. Instead of restarting your application like crazy when exceptions happens (e.g. database is down), the *exponential backoff restart* will increase incrementally the time between restarts, reducing the pressure on your DB or your external provider... Pretty easy to use:
When starting application with PM2, application are automatically restarted on auto exit, event loop empty (node.js) or when application crash.
But you can also configure extra restart strategies like:

- Restart app at a specified CRON time
- Restart app when files have changed
- Restart when app reach a memory threshold
- Delay a start and automatic restart
- Disable auto restart (app are always restarted with PM2) when crashing or exiting by default)
- Restart application automatically at a specific exponential increasing time

## Restart at cron time

Via CLI:

```bash
$ pm2 start app.js --cron-restart="0 0 * * *"
Expand Down

0 comments on commit fabb15e

Please sign in to comment.