My app needs about 4GB ram while booting for building an index, but then runs comfortably on less than 1GB. However swap_size_mb
line in fly.toml doesn’t seem to be parsed properly. Here is my fly.toml:
primary_region = 'eze'
[build]
[http_service]
internal_port = 8080
force_https = true
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
processes = ['app']
[[vm]]
memory = '1gb'
cpu_kind = 'shared'
cpus = 1
swap_size_mb = 4096
I save the file, run fly deploy
aaaaaannd… nothing happens. The machine fails (out of memory) and the settings don’t show any added swap memory. Does anybody know what could be the problem? Also RootFS
appears “awaiting sync”.
Here’s the log:
2024-08-23T20:09:09.781 app[9080e50ecd77e8] eze [info] 2024-08-23T20:09:09.780970504 [01J60DH0E7TKN461NW99C2XNW4:main] Running Firecracker v1.7.0
2024-08-23T20:09:10.102 app[9080e50ecd77e8] eze [info] [ 0.273477] PCI: Fatal: No config space access function found
2024-08-23T20:09:10.421 app[9080e50ecd77e8] eze [info] INFO Starting init (commit: 20f21dc5f)...
2024-08-23T20:09:10.454 app[9080e50ecd77e8] eze [info] INFO Preparing to run: `uvicorn src.main:app --host 0.0.0.0 --port 8080` as root
2024-08-23T20:09:10.460 app[9080e50ecd77e8] eze [info] INFO [fly api proxy] listening at /.fly/api
2024-08-23T20:09:10.467 app[9080e50ecd77e8] eze [info] 2024/08/23 20:09:10 INFO SSH listening listen_address=[fdaa:1:d1b1:a7b:148:38d5:9032:2]:22 dns_server=[fdaa::3]:53
2024-08-23T20:09:10.507 runner[9080e50ecd77e8] eze [info] Machine started in 777ms
2024-08-23T20:09:15.535 app[9080e50ecd77e8] eze [info] [ 5.703096] Out of memory: Killed process 322 (uvicorn) total-vm:1146888kB, anon-rss:853308kB, file-rss:4kB, shmem-rss:0kB, UID:0 pgtables:1924kB oom_score_adj:0
2024-08-23T20:09:16.468 app[9080e50ecd77e8] eze [info] INFO Main child exited with signal (with signal 'SIGKILL', core dumped? false)
2024-08-23T20:09:16.469 app[9080e50ecd77e8] eze [info] INFO Process appears to have been OOM killed!
2024-08-23T20:09:16.469 app[9080e50ecd77e8] eze [info] INFO Starting clean up.
2024-08-23T20:09:16.470 app[9080e50ecd77e8] eze [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2024-08-23T20:09:16.471 app[9080e50ecd77e8] eze [info] [ 6.640452] reboot: Restarting system
2024-08-23T20:09:16.621 app[9080e50ecd77e8] eze [info] Out of memory: Killed process
2024-08-23T20:09:16.650 runner[9080e50ecd77e8] eze [info] machine has reached its max restart count (10)