|By Stackify Blog||
|February 2, 2017 10:37 AM EST|
Microsoft Azure provides a powerful set of services to help developers build and deploy their apps. Azure makes it so easy to use… that you can quickly let your Azure hosting costs get out of control…
At Stackify, we have been using Azure for over 4 years. We have grown up with Azure as we like to say. We leverage a wide array of different Azure services and spend a small fortune on it every year. We are writing this article to share some of our best tips to lower your azure pricing and optimize your overall Azure costs.
We are going to focus on 5 different ways to lower your costs
- Lower your actual azure prices
- Figure out what your current costs are
- Optimize how you deploy your apps
- Improve the performance of your app
- Other tips
How to lower Microsoft Azure pricing & effective Azure cost management
One of the easiest thing you can do is simply get some discounts on your bill or get something for free!
1. Pre-pay to get a discount, even on a pay-as-you-go account
Microsoft has offered discounts of 2.5-5% based on 6 or 12 months pre-payment. Check to see if you can take advantage of this. However, an EA agreement may be a better option.
2. Get an EA Agreement for maximum azure discounts
EA agreements require selecting an annual monetary commitment and that locks in a discount rate. You are then billed quarterly for any overages beyond your annual commit.
An EA agreement can save you up to 30% or so for some Azure products. Be warned, the discounting rate schedules are a mess. Just as an example, your discount rate on SQL Azure could be 5% but Cloud Services could be 30% and it is different for every single SKU they sell. There are thousands of SKUs. So be sure to know what Azure services you really need and maximize the discount on those SKUs in your EA agreement.
3. Can you sign up for Bizspark?
4. Can you switch Azure regions for better azure pricing?
Azure pricing varies from one region to another, even in the US. Double check the pricing in various regions to see if you can save a little.
Example: A2 VM in West US is $133.92 but $126.48 in West US 2. Australia East is $168.14
5. Get free money from Microsoft by working with an Azure partner on a project
If you have a big project to move to Azure, you can get some discounts to help incentivize and pay for a Microsoft partner to assist making it happen. We were able to do this to help do a bunch of work with Chef as one example.
Figure out what your current Azure costs are, and organize reporting
Odds are, you don’t know what you don’t know when it comes to how much you are spending and what you are spending it on. It is so each with Azure to spin up new resources and simply forget about them.
6. Know how much you spend on what, which is hard without a tool for it
Microsoft has a couple tools you can use to analyze your billing:
- Azure billing portal
- EA portal – https://ea.azure.com/
Both of these leave a lot to be desired for any advanced level of reporting. You can connect your EA data to PowerBI which opens up some more opportunities for crunching the data, but you really need to segment the data by project, departments and etc to get more insights in to it.
There are a lot of third party tools available, although appallingly, many of them over $1,000 a month! We recommend using a service called Azure Costs (https://azure-costs.com/) which is inexpensive and does a great job. It has a free tier and paid options from $29 – $199 a month.
Just to give you an idea, you can group the reporting a bunch of different ways to understand if you are spending a lot on VMs, SQL Azure, App Services, etc.
7. Assign Azure spending by project, environment, or client for better reporting
At Stackify we host our production, pre-production, QA, development, and test apps all Azure. When looking at our bill at a high level, there is no good way to know how much we are spending on which environment, which is important to us.
How much we spend in production impacts our margins as a business and we want to also minimize costs in dev/test environments.
We use Azure Costs to organize what we are spending money on. We simply tag each Azure resource and then we can get reporting by the tags to easily see expenses per environment.
We can then get reporting by each tag to understand how we are spending our money
Optimize how you to deploy your apps to save money on Azure
If you are moving an application to Azure, there are a few ways to save money that you may not even be thinking of. Also want to give you some tips on optimizing App Services, Cloud Services, etc.
8. Pick the right type and size of Virtual Machines
If you are using Azure for hosting Virtual Machines, make sure you pick the correct type of instance. There are literally dozens of different types and sizes. Make sure you select the right type based on if you need more memory, CPU, faster disk, etc.
9. Use Azure DevTest Labs to ensure test VMs get auto shutdown to save money
Nothing is more annoying than someone setting up a test server and finding out later you have been paying for it for months and months. Azure DevTest Labs is awesome for creating servers that you need occasionally or just certain hours of the day.
DevTest Labs can automatically turn them on and shut them down on a schedule. This helps a lot with solving the issue of your QA team forgetting to shut down servers before they leave for the day or weekend.
Note: DevTest Labs does not cost anything additional to use. You simply pay for the VMs themselves.
10. Avoid paying for staging slots on Cloud Services
With Azure Cloud Services for Web and Worker roles, you pay the full price for staging slots just like you do production slots. It is a good idea to deploy to staging slots and then swap staging into production to minimize downtime.
Be sure you delete the staging slots as fast possible. Nothing makes me more mad then logging into Azure and seeing a bunch of stuff deployed in staging slots sitting there for no reason.
11. Combine web apps with Azure App Service Plans to reduce server count
One of the absolute best features of Azure is App Services. You can create an App Service Plan which represents 2-3 or more servers and then pack as many web applications as you want on to them.
This is a huge advantage over paying for an entire server for a web application that hardly does anything. We have used Cloud Service Web Roles forever and in some cases have 3 instances for high availability on a web app that gets virtually no traffic. It is a huge waste.
12. Stop using Cloud Service Web Roles unless you have to
Unless you have to use Azure Cloud Services for Web Roles, I would work towards switching your apps to App Services to take advantage of combining multiple apps to fewer servers.
Cloud Services also take FOREVER to deploy to. App Services are light years faster for deploying to.
13. Use Azure Service Fabric or Container Service to combine apps
For the exact same reasons I mention above with App Services and Web roles, look at moving your Worker Roles to Service Fabric or Container Service. Both follow the pattern like App Service Plans where you basically provision a group of servers and then throw a bunch of apps on them.
14. Use auto scaling to reduce costs during off hours
Most apps have busier and slower periods throughout a week or day. Take advantage of auto scaling built into Azure to save some money during slow periods.
These deployment types all support auto scaling:
- Cloud Services
- App Services
- VM Scale Sets (Including Batch, Service Fabric, Container Service)
15. Use Azure PaaS features, don’t roll your own on VMs, unless you have to
I have talked to several people who use Azure and their version of using Azure is setting up some VMs and hosting their app and SQL Server on those VMs.
Leveraging Azure for virtual machines and IaaS is fine, but you are missing out on a lot of opportunity to reduce management costs and lower azure costs as a whole. Unless you have a really, really good reason to use SQL in a VM, buy some third party load balancer running in a VM and other scenarios, just don’t.
At Stackify we leverage every PaaS feature of Azure we can. Including SQL Azure, Redis, Table Storage, Service Bus, etc. The thought of setting up VMs for Redis or some other queuing service seems like a really terrible idea. The only exception to that for us is elasticsearch.
Azure Search is available and is a basic elasticsearch PaaS offering. Due to the sheer size and scale of our elasticsearch cluster, it makes more sense to manage it ourselves.
16. Use SQL Elastic Pools
If you have a lot of databases, you should consider SQL Elastic pools.
With Azure you have to pick a performance tier for each individual database. This works very well and provides a predictable level of performance. However, it also results in over provisioning performance in a lot of cases.
Think of an Azure SQL Elastic Pool as more of a server and you can get assign a bunch of databases to that server. That allows the performance of each database to ebb and flow within the total resources of the server.
At Stackify every one of our clients has their own SQL databases. We literally have hundreds of them and we add new ones and deprovision some every single day. SQL Elastic Pools are critical for us to manage that many databases at scale.
Improve the performance of your application itself
OK, if you have maximized how much you spend on Azure when it comes to your overall azure pricing and how you deploy your apps, it is time to start doing some performance tuning.
17. Time to get out the profilers!
If you want to optimize the performance of your code, you need to do some code profiling. There are three different types of profilers and you may need all three to really improve your code.
- Standard profiler – profile your code on your workstation to look for slow methods in your code
- Transaction tracing – capture complete web requests via an ASP.NET profiler and review what is happening
- APM – Track the overall performance of your application and it’s dependencies
18. Identify your most used and slowest web requests or transactions
Look for requests that are taking a lot of time or happen a moderate number of times but take way too long. Look at ASP.NET transaction traces to see if too many SQL queries are happening, slow web services, etc.
Most modern applications are more bound by database or web service calls. If your code itself may be slow, you probably want to use a standard .NET profiler, like the Visual Studio profiler to try and figure out why.
19. Optimize SQL database performance
Every busy application can usually benefit from some basic SQL tuning. SQL Azure has some great basic functionality for performance reporting and index tuning recommendations.
If you need to go deeper, be sure to query the DMVs in SQL to identify which queries are accessed the most, use the most IO, take the longest, etc. Also be careful to see how long the queries take from the point of view from your app.
You can also leverage your APM tool to identify which queries are used the most and what actions in your software are calling them.
20. Track usage and performance of all application dependencies
Beyond just SQL server, you application probably makes web service calls, uses queues, caching, and other dependencies, including other Azure features like DocumentDB, Azure Storage, etc.
Other Ideas to lower azure costs
Here are some other ideas to consider to help lower how much you are spending on azure.
21. Can use a CDN?
A CDN like Cloudflare makes it really easy to add caching of all your static files with no code changes. Cloudflare also has a ton of cool features that can be used to optimize performance.
Azure does have a very simple CDN offering as well that you can try, but it doesn’t do what Cloudflare does.
22. Can use the new Azure cold storage option?
Azure now offers warm and cold Azure storage. Warm is designed for data that is used frequently and cold for data that is rarely used. If you have a lot of data that is hardly used, backups, archives, or other data, be sure to check out cold storage.
Optimizing azure cloud hosting costs
I hope you found this list to be helpful. Be sure to start with some of the simplest ideas to implement and leave optimizing your code for last.
Optimizing your code is by far the hardest part to do and can take an enormous amount of time and regression testing. At Stackify we have APIs that get called millions and millions of times a day. If you have code that gets called as many times as ours, it is definitely worth investing in the low level code optimizations, otherwise… maybe not.
Have any other tips on how to save money on your Azure bill? Please tell us in the comments below!
The post 22 tips to lower Azure pricing and optimize hosting costs appeared first on Stackify.
SYS-CON Events announced today that Linux Academy, the foremost online Linux and cloud training platform and community, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Linux Academy was founded on the belief that providing high-quality, in-depth training should be available at an affordable price. Industry leaders in quality training, provided services, and student certification passes, its goal is to c...
Mar. 30, 2017 04:15 PM EDT Reads: 4,335
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm. In his Day 3 Keynote at 20th Cloud Expo, Chris Brown, a Solutions Marketing Manager at Nutanix, will explore t...
Mar. 30, 2017 04:15 PM EDT Reads: 3,329
Providing the needed data for application development and testing is a huge headache for most organizations. The problems are often the same across companies - speed, quality, cost, and control. Provisioning data can take days or weeks, every time a refresh is required. Using dummy data leads to quality problems. Creating physical copies of large data sets and sending them to distributed teams of developers eats up expensive storage and bandwidth resources. And, all of these copies proliferating...
Mar. 30, 2017 03:45 PM EDT Reads: 6,736
SYS-CON Events announced today that SoftLayer, an IBM Company, has been named “Gold Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. SoftLayer, an IBM Company, provides cloud infrastructure as a service from a growing number of data centers and network points of presence around the world. SoftLayer’s customers range from Web startups to global enterprises.
Mar. 30, 2017 03:30 PM EDT Reads: 2,365
SYS-CON Events announced today that StorageCraft Technology Corp, a global leader in backup and disaster, will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. The StorageCraft family of companies, founded in 2003, provides award-winning backup, disaster recovery, system migration and data protection solutions for servers, desktops and laptops in addition to powerful data analytics.
Mar. 30, 2017 03:17 PM EDT Reads: 108
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
Mar. 30, 2017 03:15 PM EDT Reads: 1,025
SYS-CON Events announced today that Auditwerx will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Auditwerx specializes in SOC 1, SOC 2, and SOC 3 attestation services throughout the U.S. and Canada. As a division of Carr, Riggs & Ingram (CRI), one of the top 20 largest CPA firms nationally, you can expect the resources, skills, and experience of a much larger firm combined with the accessibility and attent...
Mar. 30, 2017 02:45 PM EDT Reads: 944
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
Mar. 30, 2017 02:45 PM EDT Reads: 3,980
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
Mar. 30, 2017 02:45 PM EDT Reads: 2,409
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend @CloudExpo | @ThingsExpo, June 6-8, 2017, at the Javits Center in New York City, NY and October 31 - November 2, 2017, Santa Clara Convention Center, CA. Learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Mar. 30, 2017 02:00 PM EDT Reads: 9,003
HyperConvergence came to market with the objective of being simple, flexible and to help drive down operating expenses. It reduced the footprint by bundling the compute/storage/network into one box. This brought a new set of challenges as the HyperConverged vendors are very focused on their own proprietary building blocks. If you want to scale in a certain way, let’s say you identified a need for more storage and want to add a device that is not sold by the HyperConverged vendor, forget about it...
Mar. 30, 2017 01:58 PM EDT Reads: 144
FinTech is the sum of financial and technology, and it’s one of the fastest growing tech industries. Total global investments in FinTech almost reached $50 billion last year, but there is still a great deal of confusion over what it is and what it means – especially as it applies to retirement. Building financial startups is not simple, but with the right team, technology and an innovative approach it can be an extremely interesting domain to disrupt. FinTech heralds a financial revolution that...
Mar. 30, 2017 01:45 PM EDT Reads: 3,201
What if you could build a web application that could support true web-scale traffic without having to ever provision or manage a single server? Sounds magical, and it is! In his session at 20th Cloud Expo, Chris Munns, Senior Developer Advocate for Serverless Applications at Amazon Web Services, will show how to build a serverless website that scales automatically using services like AWS Lambda, Amazon API Gateway, and Amazon S3. We will review several frameworks that can help you build serverle...
Mar. 30, 2017 01:45 PM EDT Reads: 2,369
Most companies are adopting or evaluating container technology - Docker in particular - to speed up application deployment, drive down cost, ease management and make application delivery more flexible overall. As with most new architectures, this dream takes a lot of work to become a reality. Even when you do get your application componentized enough and packaged properly, there are still challenges for DevOps teams to making the shift to continuous delivery and achieving that reduction in cost ...
Mar. 30, 2017 01:45 PM EDT Reads: 560
SYS-CON Events announced today that Loom Systems will exhibit at SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Mar. 30, 2017 01:45 PM EDT Reads: 1,878