0d4e3e70c1
* tasks no longer inside a group in the side menu (and added “cron”) * Delay using a timezone * Added React Not Defined error to the troubleshooting page * Improved the React common problem * Link to v2 docs * New Development section and entry in Common Problems * Concurrently running the terminal * Fixed the .env weirdness * Added section on creating PATs for Github actions * Improved the Machine spec and limits page * Quick start steps now have nice images * Added a diagram for the lifecycle functions * Added note about onFailure * CRON -> cron/Cron * Updated the cli-dev steps for the concurrently package * Fixed capital letter * Updated diagram text * Removed dead page
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
---
|
|
title: "Machines"
|
|
description: "Configure the number of vCPUs and GBs of RAM you want the task to use."
|
|
---
|
|
|
|
The `machine` configuration is optional. Using higher spec machines will increase the cost of running the task but can also improve the performance of the task if it is CPU or memory bound.
|
|
|
|
```ts /trigger/heavy-task.ts
|
|
export const heavyTask = task({
|
|
id: "heavy-task",
|
|
machine: {
|
|
preset: "large-1x",
|
|
},
|
|
run: async ({ payload, ctx }) => {
|
|
//...
|
|
},
|
|
});
|
|
```
|
|
|
|
The default machine is `small-1x` which has 0.5 vCPU and 0.5 GB of RAM. You can change the default machine in your `trigger.config.ts` file:
|
|
|
|
```ts trigger.config.ts
|
|
import type { TriggerConfig } from "@trigger.dev/sdk/v3";
|
|
|
|
export const config: TriggerConfig = {
|
|
machine: "small-2x",
|
|
// ... other config
|
|
};
|
|
```
|
|
|
|
## Machine configurations
|
|
|
|
| Preset | vCPU | Memory | Disk space |
|
|
| ------------------- | ---- | ------ | ---------- |
|
|
| micro | 0.25 | 0.25 | 10GB |
|
|
| small-1x (default) | 0.5 | 0.5 | 10GB |
|
|
| small-2x | 1 | 1 | 10GB |
|
|
| medium-1x | 1 | 2 | 10GB |
|
|
| medium-2x | 2 | 4 | 10GB |
|
|
| large-1x | 4 | 8 | 10GB |
|
|
| large-2x | 8 | 16 | 10GB |
|
|
|
|
You can view the Trigger.dev cloud pricing for these machines [here](https://trigger.dev/pricing#computePricing).
|