Application Scaling now in Beta
We have always touted seamless scaling as a reason to host your app on AppHarbor. We are excited to announce general beta-availability to all our users! Scaling was actually built into the platform almost from the beginning, but only appharbor.com and a few test sites have been deployed to multiple application instances until now. Check out this January blog post to get an idea of how we scale your applications.
We are launching scaling with a few limitations: You can only add one additional instance (contact us if you require more) and you have to enter valid credit card details on your account. The good news is that we won't start charging you just yet, and we promise to announce well in advance before doing so. Once you have entered your credit card details, you can add an additional instance in the application interface.
Adding additional instances gives your AppHarbor application a higher maximum request throughput. On top of that, when you add additional instances, we make sure those instances run on redundant servers. This makes your application tolerant of individual application server failures (if your application has only one instance and if the underlying server crashes, the AppHarbor platform will redeploy it, but it may take some time). We are currently investigating running application servers in multiple AWS availability zones for even greater resilience.
There are some interesting implications of running your application on multiple instances. The most pertinent limitation is that you can't expect consecutive requests from the same client to be served by the same instance (i.e. no "sticky sessions"). This means you should never rely on any state stored on individual instances. We recommend using Amazon S3 instead of the local file system for any storage requirements other than caching. caching minified .css and .js on the instance filesystem is acceptable, for example, and does not require use of S3. For session state, we recommend trying the Memcached provider in combination with our Memcacher add-on. We have written a guide on setting up the Memcached provider on AppHarbor.
If your web.config does not include a machineKey
element or if the machineKey
is configured to AutoGenerate
, we will automatically insert pre-generated machinekeys. This means that encrypted forms-authentication cookies generated by one application instance will also be accepted by other instances hosting your app. We always insert the same keys for your application so that sessions are valid across deploys.
Go add your additional free instance right now and help us shake out any scaling bugs. Scaling happens from the Settings
dashboard on your AppHarbor applications. If you encounter problems, drop us a line at support@appharbor.com.