views:

139

answers:

11

My users use the site pretty equally 24/7. Is there a meme for build timing?

International audience, single cluster of servers on eastern time, but gets hit well into the morning, by international clients.

1 db, several web servers, so if no db, simple, whenever.

But when the site has to come down, when would you, as a programmer be least mad to see SO be down for say 15 minutes.

A: 

Use a second site, and hotswap as needed.

Nescio
+9  A: 

If there's truly no good time from the users' perspective, then I'd suggest doing it when your team has the most time to recover from any build-related disaster.

Marcel Levy
+1  A: 

What kind of an application is it? Most sites that I use tend to update around 2AM or 3AM.

Charles Graham
A: 

The issue with hot-swapping, is database would still be shared, and breaking changes would bring stand in down as well.

DevelopingChris
A: 

I guess you have to ask your clients.

In any case, there's the wee hours of the morning. If you're talking about a locally available website, I do not think users will mind if they get an "under maintenance" notice at 2 am in their time zone.

Jon Limjap
+3  A: 

Here's what I have done and its worked well for me:

  1. Get a site traffic analysis tool which will graph hourly user load
  2. Select low-point in graph for doing updates
A: 

Depends on your location: 4AM East Coast/1AM West Coast is typlically the lightest time.

Tom Carr
A: 

Pick a few times that you'd like to do it and offer them as choices to the decider-types. Whatever you do, put up a "down for routine maintenance" page while you deploy.

Kevin Conner
A: 
  • Check the time of least usage
  • Clone/copy/update latest production code to another directory
  • If there exists any database migrations to be done, perform any that are required, and non conflicting with the old code base
  • At time of least usage, move symlink to point to latest code
wish we had symlinks, windoze in prod
DevelopingChris
+2  A: 

If you're small, then yeah, find when your lowest usage period is, and do it then (for us personally, usually around 1AM-3AM PST is the lowest dip...but it never drops to 0 of course). Once you start growing to having a larger userbase, if you want people to take you seriously you'll need to design your application such that you can upgrade without downtime. This is not simple, and it often involves having multiple servers.

I've spent ages trying to get our application to this point, the best I've come up with so far is for a couple hours run both the old version and new version at the same time. Users logged in at the time of the switchover stay on the old version, until they log out. Next time they come in they go to the new version. Any users coming on after the switchover get sent straight to the new version. It's still not foolproof, but it's pretty good.

davr
A: 

First use an analysis tool to try and determine your typically "light" traffic times. Depending on the site and your location in the world in comparison to most of your users, it could be 4am, it could be 1pm, who knows. Then, once you have a good timeframe nailed down, make sure to have your deployment process as automated as possible, so that it happens quickly to minimize the downtime of your site.

bcwood