I'm incredibly happy to announce that my blog - and all 750 other blogs running under weblogs.asp.net - are now powered by Orchard and Azure Web Sites! That's 750 blogs, all hosted in 4 Azure Web Sites all running on only one large virtual machine.
A bit of nostalgia
I've been blogging on weblogs.asp.net since May 2003 - over eleven years. Back then it was called dotnetweblogs and ran on an open source blogging platform called .Text. Over the years, it got moved through varivous versions of Community Server, and had been stuck on an old, customized version of Community Server for almost seven years. It was hard to take myself seriously when blogging about web standards when my blog was being forced to quirks mode in IE due to an ancient HTML header.
I'd campaigned internally a few times to get the blog platform updated, but understood it was a big job to update several hundred weblogs - with history, and without downtime. Fortunately there's another very high profile blogger on the weblogs.asp.net platform; that may have had something to do with getting the update to happen. :-)
So I was extremely happy to hear that there was finally an effort underway to make the move!
Disclaimer: I did not do any of the dev work for this migration. In fact, I was one of the top whiny customers - my blog was one of the test cases for the migration, and I gave Sebastien Ros and the Neudesic dev team (Peter Fuerte, Samir Patel, Zac Hall, and Terri Morton) tons of feedback and piles of feature requests.
Orchard is hosted as Azure Websites on a single basic large instance using using 4 websites on a single instance to scale out the memory limit on 32 bits.
We use 4 Azure SQL Database instances, Business edition set to 10GB. Each azure website points to a SQL Azure database, and each database contains around 200 blog using table prefixes.
Each website points to an Azure Cache Service for output caching
All blogs point to the same blob storage account
An Azure Queue is used to synchronize the main portal and the blogs
One ARR proxy in an Azure VM is used to route the requests to the Azure websites. We set it up this way because we already had this VM set up to do the proxy work for the rest of *.asp.net.
Here's a general diagram (stolen with permission from Sebastien's talk at the Orchard Harvest conference this week):
Here are our monthly estimated statistics for weblogs.asp.net:
- Bandwidth out – 17 terrabytes
- Page Views – 1.3 million
- Unique Visitors – 750,000
- Visits – 1.1 million
Here's the thing: Azure Web Sites is fast and efficient. I was already convinced of that, having run a lot of sites on it over the past few years. But Orchard is crazy efficient, too. I did not know that. I recently saw Sebastien give a presentation on Orchard, and it blew my mind. If you had heard or read that Orchard is slow, bloated or inefficient, you owe it to yourself to look again. I've been shocked by how fast and efficient the current release of Orchard is.
The Orchard output cache module includes pretty moderate caching but delivers pretty extreme CPU performance benefits, as shown in the CPU charts from the production site below. Notice we're hovering around 20% CPU most of the time:
Hosting Cost Summary
It's incredibly cheap to host all 750 weblogs on Azure Web Sites, SQL Database, Storage and Cache. Here's a per-month cost estimate (keep the above stats in mind when you read these):
|Item||Usage to Date||Cost to Date||Estimated Cost Per Month|
Data Transfer OUT (GB) - Zone 1
Data Transfer IN (GB) - Zone 1
Database Units (in 10s) - Business Edition
0.54 DB Units (10s)
Storage Transactions (in 10,000s) - Data Management
Basic (128 MB) - Cache
2.52 (128 MB)
Data Transfer (GB) - Zone 1
Standard IO - Block Blob (GB) - Geo Redundant
Large Basic Web Sites Hours - Web Sites
|Grand Total|| |
This works out to under about 70 cents per blog per month, which is pretty impressive.
What was changed in Orchard to support multi-blog
Multi-tenancy is a native capability of Orchard CMS. It is the primary reason we chose Orchard as the platform. So that's neat.
We're using 4 websites on a single Azure instance to scale out the memory limit on 32 bits, and any optimizations that were made to Orchard itself for this project were rolled back into the core platform (for v.22.214.171.124 and later).
Migrating 750 weblogs (with more than 75k posts and 250k comments)
weblogs.asp.net supported BlogML export and import. BlogML is an open format for Blog content, and it includes everything you'd need to migrate eleven years of blogging - including posts, comments and tags. It's not a slam dunk, though. Years ago, I tried to export my blog and the requests kept timing out because the export (including comment spam) was something like 5 or 6 MB. A year ago I was sick with a flu so I decided to do some blog spam analysis; Terri and team incorporated the results into their spam filters which cut the spam levels quite significantly. Still, lots of data.
On the Orchard side, they took advantage of custom Orchard recipes to handle the import. Recipes are great - they include everything you'd need to initialize a new site, including blogs, users, etc. And they can be based off a template, so you can create multiple (say, 750) recipes from one template. Slick.
At a high level (because I didn't write the code), Sebastien and friends tackled the problem like this:
- Export all sites to BlogML
- Convert the BlogML to custom Orchard recipes to create the new blogs including:
- New passwords
- Generate custom commands to automate the recipe processing
Automation was important, because they reran this migration several times.
One other neat thing about the import: they used the VM Berserker technique (my name, I hope it sticks). You may have read about this approach before on Troy Hunt's post titled Working with 154 million records on Azure Table Storage – the story of “Have I been pwned?”
The VM Berserker technique takes advantages of one of the most unappreciated values of cloud computing: the ability to develop cheaply, scale way up for a short time, and then turn off. This lets you do big things for less than the cost of a cup of coffee. Scaling up is nice. Scaling up and then back down is even nicer. So for this migration, they tested things out on a VM, then scaled it up to handle the migration, then turned it off (to stop paying). Done. Oh, and by running in an Azure VM they were running the processing in the same datacenter as the data, so it was really fast.
This is the kind of thing that tells me that cloud computing is the future. Sure, it's great to spin up sites and VM's and worker roles and stuff in the cloud. It's great that I can amp them up when I want. But often lost in the discussion is the power of being able to scale hard for an hour or two, then shut down. The cost-per-awesome on that transaction hasn't sunk in with most developers yet.
Sebastien announced at the Orchard Harvest conference this week that the tools that were written to migrate the content from the old system to Orchard (running Orchard recipes against BlogML export files) will be released publicly very soon.
New Blog Goodness
So much good stuff!!!
New Bootstrap blog theme
This is probably my favorite. In the past I'd written a few custom or inline styles, but now the system's running on a great framework. Bootstrap's tons of fun. There are individual styles and components that make things look better, so I can throw in a Bootstrap table style or grid whenever it's useful.
Plus, it's easy to drop in a new theme from time to time. I grabbed one off Bootswatch to get started, but am looking forward to tinkering with it.
Mobile friendly display
Since Bootstrap 3 is a mobile first framework, it always looks good on smaller displays. Posts automatically scale down for mobile devices using media queries.
More Authoring Options
I've always been a fan of Live Writer, and that's still supported. And there's HTML support, which is good. But Orchard also introduces Markdown editing support, which I'm told will cause my pants to shrink and my beard to grow out. So that's something.
As I was beta testing, I asked Sebastien if we could move the comments from the content to an after content module so I could insert custom HTML widgets above the comments, and he set that up. So far, the widgets have been incredibly flexible. No complaints at all there.
As I mentioned earlier, the spam was a bit out of hand before. Orchard adds ReCAPTCHA support. No messing around now, I can barely pass it.
Social Media Tag support
Orchard automatically includes support for all the fancy og:tags that are so hot these days. Sebastien wrote a post with more information.
Custom Script Support
I have already admitted to jamming script tags in HTML areas on the previous site. The new site includes the ability to add custom scripts for analytics, syntax highlighting, etc. It's supported, and I can include them in the header or footer as appropriate.
Site Nav Integration
Now new pages can be integrated into the site navigation. Cool.
There's a lot more! If you're running a blog that's hosted on weblogs.asp.net, see the updated support here. If you'd like to learn more about Orchard - or contribute, as it's an open source project - check out the Orchard Project. I'll be posting more about some things I've learned in customizing my blog a bit, including the code formatting.