When is a rebuild needed, and can we speed it up?


(Mark Hamstra) #1

In trying to get SSL up and running I’ve been doing a fair bit of ./launcher rebuild app which takes several minutes each time, and also takes the forum offline entirely while it’s running.

Is there any documentation on when a rebuild is needed, and are there any ways of speeding that up?

Finally, is there any suggested way to provide some kind of maintenance page while the rebuild is happening? We haven’t launched the forum officially yet so I can rebuild whenever, but I’d rather not do these rebuilds after we’ve launched as there is zero feedback for users on what is happening.


(Stephen) #2

The two cases I’ve encountered are for docker upgrades and any changes to the YML.


(Barry Parr) #3

I’m also surprised there’s no way to notify users that site is down for maintenance and will be back up shortly.


(Stephen) #4

It’s not hugely different to servicing any other web app. If you use something like Cloudflare the TTL is already nice and low, it’s easy to repoint DNS for a bit.

Rebuilding isn’t exactly a regular operation. I’ve only done it a handful of times in nine months, if that.


(Mittineague) #5

I have only a localhost development set up,so I don’t know for certain.
But isn’t that what putting the forum into “read only” is for?
Or is it totally down during rebuilds?

Seems there must be a way to have a read only instance live while another is being rebuilt that could be switched on once completed.
Probably would be more trouble than it’s worth though.


(Chris Saenz) #6

Yes, its 100% down, not even “we’re doing maintenance”. Just a 503 error.

Doesn’t upgrading via the admin/upgrade page do a rebuild? Watching the code scroll by looks pretty similar… Discourse never goes down during an upgrade via the web interface, but it does for manual rebuilds.


(Stephen) #7

If you ./launcher rebuild app then the whole application is down. The application isn’t there to respond.

Hence my suggestion when doing something as fundamental as taking the app down and building it from scratch that DNS be repointed. If you either set a low TTL or use the likes of Cloudflare you can swing the A record to and from your Discourse instance in a few minutes.

Rebuild is a fairly radical operation, a new copy of everything is grabbed from github and the app is rebuilt using the current configuration held in the yml. I’m not sure what you expect to be listening to respond.

No. Rebuild app rebuilds the container from scratch, /admin/upgrade updates a single component. You should be resorting to it very rarely. The only routine updates which require it are when the docker image is upgraded.


(Sam Saffron) #9

Rebuild can be mostly benign if you split out your containers and have data container and a web container separately. If the outage is a concern to you strongly recommend splitting.

Needing to do rebuild is fairly rare (perhaps once in 3 months)

That said I like the idea of spinning up a webserver that says “offline” while a rebuild is happening.


(Benjamin lupton) #10

is there any guides for this splitting that you would recommend?


(Sam Saffron) #11