Last weekend I moved the last bits of my sites off of Windows-based Azure app services, and all of the background stuff now runs on Azure Functions. Now that nearly a week has passed, I have some real metrics about what that means.
First off, I moved the forums from PointBuzz off of the main app and into the hosted POP Forums product earlier this year. The hosted product runs on two Azure B1 Linux app service instances, with the cheapest possible Redis instance to connect them. The forums use Redis more as a service bus (I know, potentially an anti-pattern) to copy cached data between the instances, kind of as a two-level cache, so I don't need a huge durable cache for this. I didn't invent this, it's what StackOverflow does. Meanwhile, the databases used in hosted forums are a SQL elastic pool running as "standard 50 DTU's," which is a crazy amount of compute given how much the app has been optimized over the years. Average CPU utilization for the app instances has been under 1%, RAM has been steady around 75% of 1.5 gigs (each instance), and they're serving around a peak of 20 pages per second. That's not a huge load at all, but it means that I could see a 100x increase and still be pretty safe, especially if I scaled up.
The elastic SQL pool is all of the databases on all of the sites, which is currently 13 databases that include CoasterBuzz, PointBuzz, this blog, test sites and other things I'm forgetting. Average "CPU" is under 3%, which is a relief because I used to see all kinds of weird spikes when I was using my own "search engine" to index the various forums. Again, plenty of room to grow and scale up if I had to. Having moved the search to ElasticSearch, which is running in Azure (not in the same region) by Elastic itself, queries are coming back in under 50ms on average across the sites, which is solid, and a bargain considering that I'm paying about $15 a month. Again, I'm at bargain basement scale.
The move last weekend was to get out of a Windows app service plan, bringing my cost from about $75 per month to $25. Everything now is running on .NET Core, which is generally faster than the full .NET Framework. Using only a single B2 instance, CoasterBuzz (including forums, busiest of the sites) and PointBuzz (not including forums, which is running in the hosted app), are averaging at most about 7% CPU and consistent page rendering well under 50ms. RAM usage is about 80% of the 3.5 gigs, but that makes sense because the local cache will use as much as it can until it starts evacuating aged cache entries. The big difference is the page rendering times, which for PointBuzz was consistently about 50ms. I wish I would have been more deliberate about benchmarks. But whatever, the point is it performs better at a third of the cost.
The forums, both the hosted app and CoasterBuzz, utilize Azure Functions to process all of the asynchronous stuff, specifically sending out email, search indexing, calculating point awards, cleaning up user session data and closing old topics twice a day (I don't use that last one). This "serverless" arrangement is crazy, because the total cost of this is going to average... a few cents per month. That's nuts, to be able to spin something up that is mostly idle but still does stuff thousands of times per day.
The biggest cost I have is by far the database pool, which by itself costs about $120 per month. The hosted forum app services (two B1 instances) and the other app service with everything else (a single B2) cost about $25 a month at the moment. The rest, storage, bandwidth and other stuff add up to around $210 per month, which still feels like a lot, but it comes with all of this redundancy and performance. It's a lot of cloud greatness for what it is. The hard thing right now is that ad revenue is just shit.
No comments yet.