Over the last couple of weeks, we've been rolling out an interesting new under-the-covers feature: Web worker pre-warming.
Previously, when AppHarbor deployed a new version of your application the platform would create new workers and then immediately switch over load from old to new workers. Old workers would be kept around for a while to ensure that any in-flight requests could finish processing.
Some web applications take a while to start up before they can start processing requests, even with view pre-compilation enabled. With the old platform deployment approach, your web application would not respond to new requests until after start-up had completed on the new web workers.
The new pre-warming feature changes this: Instead of switching load immediately after deploying a new application version, AppHarbor now monitors new workers by sending requests to the site root. Only when the platform can successfully connect to all new workers is the routing layer updated to switch load. With the new pre-warming feature, updating applications running on AppHarbor is a lot smoother and we're pleased with the effects it's had on the sites we ourselves run on the platform, including appharbor.com.
You don't need to do anything to take advantage of web worker pre-warming, all deploys on AppHarbor are now done this way.
Note that when designing deployment and migrations processes for apps that run on AppHarbor, you should take into consideration that both old and new version of your code may be running on different workers while a deploy is in progress. This was also the case before (because old workers were kept around to complete outstanding requests) but the two versions will now potentially run side-by-side for a greater length of time.
Image credit: Erin Brown-John.