# Can I set processor/memory for Laravel cron and worker machines in fly.yaml?

**URL:** <https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226>\
**Category:** Laravel\
**Tags:** machines, login-only\
**Created:** [March 13, 2025, 1:36am UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226 "2025-03-13T01:36:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RC-Ryan](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@RC-Ryan](https://community.fly.io/u/RC-Ryan)\
**Post date:** [March 13, 2025, 1:36am UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226/1 "2025-03-13T01:36:44Z")

</div>

When I launch my app, Fly automatically creates machines to handle cron and workers, resulting in three servers at the same settings of my app servers, which run at shared-cpu-4x@8192MB. They could both probably run at 2x@4096 instead of 4x@8192. Do I need to manually scale those down after launch, or can I set that in my fly.yaml file so I don’t need to add it to my manual steps?

---

<div class="post-metadata">

**Author:** ![halfer](https://avatars.discourse-cdn.com/v4/letter/h/df705f/32.png) [@halfer](https://community.fly.io/u/halfer)\
**Post date:** [March 13, 2025, 8:32pm UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226/5 "2025-03-13T20:32:40Z")

</div>

Would you show readers your TOML config file that you have now?

---

<div class="post-metadata">

**Author:** ![RC-Ryan](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@RC-Ryan](https://community.fly.io/u/RC-Ryan)\
**Post date:** [March 15, 2025, 10:41pm UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226/6 "2025-03-15T22:41:59Z")

</div>

[build]  
[build.args]  
NODE\_VERSION = ‘22’  
PHP\_VERSION = ‘8.4’

[http\_service]  
internal\_port = 8080  
force\_https = true  
auto\_stop\_machines = ‘stop’  
auto\_start\_machines = true  
min\_machines\_running = 1  
processes = [‘app’]

[[vm]]  
memory = ‘8gb’  
cpu\_kind = ‘shared’  
cpus = 4

[processes]  
app = “”  
cron = “cron -f”  
worker = “php artisan horizon”

---

<div class="post-metadata">

**Author:** ![mayailurus](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mayailurus/32/17593_2.png) [@mayailurus](https://community.fly.io/u/mayailurus)\
**Post date:** [March 16, 2025, 3:53am UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226/7 "2025-03-16T03:53:44Z")

</div>

The reason the syntax is `[[vm]]` (allowing multiple) instead of `[vm]` (single-only) is exactly to make it possible to customize by process group:

[https://fly.io/docs/reference/configuration/#processes-2](https://fly.io/docs/reference/configuration/#processes-2)

> You can even specify two different `[[vm]]` sections to have different compute requirements per process group.
> 
> […]
> 
> For example the following snippet uses `shared-cpu-4x` for `app` and `other` process groups but `performance-1x` for `worker` group.
> 
> ```
> [processes]
> app = "/start-app"
> worker = "/start-worker"
> other = "/start-other"
> 
> [[vm]]
> size = "shared-cpu-4x"
> 
> [[vm]]
> size = "performance-1x"
> processes = ["worker"]
> ```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [March 23, 2025, 3:53am UTC](https://community.fly.io/t/can-i-set-processor-memory-for-laravel-cron-and-worker-machines-in-fly-yaml/24226/8 "2025-03-23T03:53:46Z")

</div>

Closed on March 23, 2025, 3:53am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
