Scale down an app?

Hi all.
I scaled an app a while ago, went up to 2 machines. I need to revert this back to use a single machine, but now when I scale count back down to 1, the app breaks.

I’m using fly scale count 1 to perform the operation, which does remove one of the machines, but also breaks the app.

I do have a volume on this app, and I noticed after scale count 1, i’m still left with 2 volumes.

I suspect this has something to do with the app not working after that. I’ve tried looking through the docs, but found nothing indicating this command should be modified for scaling an app with volumes… help please

What’s the error(s). Each volume is attached to a specific machine, so I doubt that’s the issue.
Do fly volumes --help to figure out how to delete the dangling volume.

The fly command doesn’t return an error. The machine looks like it goes into a boot loop instead.

As soon as I scale count back up to 2, everything works fine. If you suspect the dangling volume is not the issue, what else should I be looking for?

Did you look at your logs?

I looked at the live logs, but they were going so fast I couldn’t get anything significant out of them.

I think I figured out what the problem was though. It looked like one of the volumes had data and the other did not. the fly scale count 1 command destroyed the machine, but left both volumes, and the machine that remained was the one tied to the empty volume.

I ended up doing fly machine destroy and fly volume destroy targetting the stopped macine and the empty volume. Looks like that resolved the issue. The machine has since dissapeared from my dashboard, but the volume remains there, says ‘Pending_destroy’, but all seems to be well now.

Thanks

ah, so the machine w/ the empty volume wasn’t actually working then. You should identify the issue since you’ll reencounter it when you scale back up.

Looks like that was the issue indeed. I guess somehow, the scale command was destroying the machine tied to the volume that contained the data, so naturally, when the other came alive, it would not work because of the missing data. Scaling back up to 2 was resolving the issue because the volume containing the data was getting assigned to the new machine.

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