Memory
RAM is a precious commodity - both to those on Hobby plans who want to remain within or near the free allowances, and to apps that want to scale to be able to handle a large number of concurrent connections. At some point you may find that you need more memory. There are two types: real and virtual. Real is faster, but more expensive. Virtual (swap) is slower and generally free. Some starting point recommendations:- 256MB is enough to run small applications with few users
- 512MB is a better place to start if you are doing image processing or have a moderate number of users.
- 1024MB is a minimum if you are running an application that uses puppeteer or otherwise makes use of chrome’s rendering engine.
JavaScript heap out of memory error, You can instruct it to use more by setting an environment variable in your fly.toml:
CPU Cores
By default, JavaScript applications (whether they be Node.js, Deno, or Bun) run on a single operating system thread and therefore won’t benefit from running with multiple cores. Node.js has a cluster module that can be used to address this. See Run a Node.js HTTP Express.js Server on Multiple CPU Cores for an example on how to use this module. Once your application is coded to take advantage of multiple cores, runfly machines list to see a list of your machines, and then
run fly machine update --vm-cpus to update the number of CPUs a single machine.