trevorpan's avatar

Can Envoyer and mainentance mode prevent zero downtime when upsizing server?

Had an interesting day yesterday.

Here are the steps I took. There was downtime.

  1. Made a backup of a linode.
  2. Learned you can put the server in maintenance mode by ssh'g into server and running php artisan down. Ok. Well, indeed the server went down and displayed a 503.
  3. I upgraded the server size/ram, etc.
  4. After the server was resized I first ran php artisan up.

The site did not return. It took a few hours w tech support, restarting mysql, nginx, etc.. (I wish that envoyer had a progress bar for the services, so you'd know when you can restart the next service. It would also be awesome to know what order to run things. I still am unclear on the order of things)

I was able to get the site back up and running when calling php artisan up again. This was after fiddling around with other services. It seems like perhaps one of the services was preventing up from executing. At any rate. Site is backup.

Can we upsize a server with zero downtime?

0 likes
5 replies
Snapey's avatar
Snapey
Best Answer
Level 122

Your fix is the same as what you tried earlier?

Can we up size a server with zero downtime?

it depends on the platform architecture rather than your application or Laravel - probably no (unless running lambda/vapor)

trevorpan's avatar

Again congratulations on #1 contributor! @snapey

Ok. I was thinking maybe making a clone, upsizing the clone and then re-assign the new ip to the clone and delete the original. But it seems like those kind of events have to have "some" downtime.

What are other common maintenance procedures requiring php artisan down?

e.g. if I do a new update, and all tests pass, envoyer folds that in nicely without a glitch - so there's no need for the down command.

Snapey's avatar

Suppose you needed to run a database migration that required moving the data from one structure to another, you might need to stop users accessing the site for a while, but at the same time, you can run the migration.

Is that what you meant?

I use a zero downtime script that deploys code to a new folder and swaps the symlink across for 'Live'. With database based sessions, users see no downtime since changing the symlink is atomic. The result of this is that it is rare for me to use down.

My sites are simple though...

Snapey's avatar

ps, thanks for the congrats.

Can you edit your question so that its clear how you fixed it? It does not make sense at the moment.

1 like
trevorpan's avatar

Sorry, I have a hard time explaining these things. How's the above now?

Please or to participate in this conversation.