Scaling memory in multiple processes does not work

I’ve already posted in the other topic, but I’m guessing it didn’t get noticed because it’s marked as resolved.

This bug is blocking my attempted migration from Heroku to Fly, because I keep getting OOM errors in my Rails app :sweat_smile: I’d love to raise the memory for web group but it’s not possible. Not via the command line, nor via the website.

No matter what I scale it to, it does not remember the setting and does not scale to that.

Can you please share the flyctl commands you ran? You’d need to use --group <proc-name> directive for some (see also).

To be sure, multi-process apps are in preview (likely not for long) and has rough edges. So, it is likely you’ve ran into some bug.

I wrote them in the post I linked above but here again:

❯ fly scale show
VM Resources for visualizer
        VM Size: shared-cpu-1x
      VM Memory: 256 MB
          Count: web=1 worker=1
 Max Per Region: web=0 worker=0

❯ flyctl scale memory 512 --group web
Scaled VM Memory size to 512 MB
      CPU Cores: 1
         Memory: 512 MB

❯ fly scale show
VM Resources for visualizer
        VM Size: shared-cpu-1x
      VM Memory: 256 MB
          Count: web=1 worker=1
 Max Per Region: web=0 worker=0

And just to reiterate: this also happens when I do it via the online Dashboard. No matter what I choose and submit, when I refresh the page I’m back to 256.

1 Like

Not sure if you’re still running into this but, from my own digging, it looks like changing the memory is working. There are some issues showing it in the UI. Free memory on the instance updates in the metrics and you can double check on the instance with free.

On the Web UI, when you first load the page, it seems to pick some value (maybe the default?). Selecting a different process group and switching back will show the correct value for memory.

The CLI is weird because it only has one field for the memory so it has to pick something. The CLI should show memory and cpu per process type.

1 Like

When I fly ssh console and I try free I get

# free -h
/bin/sh: 2: free: not found

But you seem to be right! The web UI selecting different and switching back seems to be working. Would be great if it worked out of the box or if it would show current state somewhere clearly. Also, yes, the CLI needs to be improved to show it by group.

Thanks!

Yeah, flyctl is all over the place with multi-process apps: how does scaling work? - #6 by hovancik


Edit: @miharekar Filed Incorrect flyctl scale show output for multi-process apps · Issue #1294 · superfly/flyctl · GitHub (feel free to report other flyctl bugs for multi-process apps on github).

I’ve bumped into this as well, only flyctl reports the memory I set it to using fly scale. However, running htop on the machine, via ssh console, reports 221M capacity…?

Update: Nevermind, I see ssh console was connecting to the incorrect machine (multi-process).