My fellow MVP Jiří Činčura wrote a nice blog post about hosting ASP.NET Core applications on Azure B-series small virtual machines: Running ASP.NET Core app on Azure B1ls VM (penny pinching). It’s the cheapest option on Azure for small applications. In this blog post I give you some additional advice about smallest B1-series virtual machines so you can build up a little safety net for your applications to make sure they don’t run out from resources.
Azure B-series virtual machines. The B-series VMs are ideal for workloads that do not need the full performance of the CPU continuously, like web servers, proof of concepts, small databases and development build environments. These workloads typically have burstable performance requirements. The B-series provides you with the ability to purchase a VM size with baseline performance and the VM instance builds up credits when it is using less than its baseline. Source: B-series burstable virtual machine sizes (Microsoft)
By my own experiences I agree with Jiří Činčura – B1ls VM-s are great for hosting small applications that doesn’t expect big number of visitors. Also applications hosted on those small VM-s shouldn’t be resource eaters. And it’s just 3.20 EUR/month for Linux VM that is alive 24/7.
Optimizing small virtual machines
Still things may get out of hand if we push it to the limits and I have some advice to build simple safety net for your application to avoid bad surprises:
- Use SSD disk – SSD disks are more stable and reliable than regular HDD-s.
- Create swap file – if your application needs more memory then without swap file your VM will be unresponsive black hole for more than half an hour. Swap file is not magic bullet – don’t forget there’s tight IOPS limit. Also programs may need physical memory and run out of it although swap file is available with enough space.
- Keep static content on blob storage – don’t forget you have only small number of IOPS to spend. Static files like images, styles and scripts can be held on Azure blob storage if they put too much load on VM.
- Use Network Security group rules – if you know IP-s from where users come then limit access to your VM to these IP-s. You can use Network security group of your VM to do that. This way bots and malicious scripts doesn’t hit your application and doesn’t make it consume resources.
- Disable OMS agent – OMS agent monitors your VM on guest level and sometimes it takes too much resources. I had to uninstall it from few of my small VM-s. You can do it from VM settings. Just open Extensions page from left menu. Of course, disable OMS agent only if you really need to do so.
B1ls VM-s are not good choice for public web servers and reverse proxies. There are many malicious bots and nasty spammers lurking around in internet and they can be active enough to make web server run out from resources.
Keep the secret, please :) I know few public sites that use B-series VM-s. B1s enough to run WordPress behing reverse proxy and B1ms is enough to have reverse proxy with caching and security modules. It’s easy to hide WordPress from public web and make it accessible only through reverse proxy. If it seems interesting then do it only on your own responsibility.
Sizes of small B-series virtual machines
Here’s the table with smaller B-series virtual machines and their prices. Notice that prices may differ by region.
Size | vCPUs | RAM | IOPS | Price |
---|---|---|---|---|
B1ls | 1 | 0.5 | 160 | 3.20 EUR |
B1s | 1 | 1 | 320 | 6.40 EUR |
B1ms | 1 | 2 | 640 | 12.74 EUR |
B2s | 2 | 4 | 1280 | 25.61 EUR |
B2ms | 2 | 8 | 1920 | 51.22 EUR |
B4s | 4 | 16 | 2880 | 102.19 EUR |
If you grow out from B1ls then it’s possible to jump to B1s or B1ms. The trick is simple – always take next size and see if it works out well. Of course, it’s also clever to compare prices of other VM series to see if there’s some better option than what B-series has to offer.
Even more penny-picking. You can make VM automatically shut down at given time of day. There is setting for this in Azure portal. If you want VM to automatically wake up in the morning then you must write some script. By example, you can use az vm start command from Azure CLI to start virtual machine. Now you even less as your VM consumes resources only when it runs.
Wrapping up
B-series virtual machines on Azure are cheapest ones to host applications. But with low costs come also very limited resources. Running public sites on cheapest VM-s is risky business and in my experience you need a good game plan to do it. Applications with restricted access are better choice as you don’t have to consider unexpected surprises from public web. B-series VM-s allow your application to grow the cheap way as VM size next to current gives you more resources with small raise in expenses.
View Comments (189)
Bulgurlu su kaçağı tespiti Beklenenden Hızlı Çözüm: Sorunun bu kadar hızlı çözüleceğini tahmin etmemiştik. Çok teşekkürler! http://sorceryofindianfood.com/uskudar-tesisatci-kacak-tespiti/
Your article helped me a lot, is there any more related content? Thanks!
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Your article helped me a lot, is there any more related content? Thanks!
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
q996dy
qz56qx
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
I don't think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Your article helped me a lot, is there any more related content? Thanks!
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
먹튀검증사이트 추천
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
먹튀검증사이트 추천
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
advz8g
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
eu6af2
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
vqbm6y
Thanks for sharing. I read many of your blog posts, cool, your blog is very good. https://www.binance.info/it/join?ref=S5H7X3LP
l75ast
80vmhd
zh8w4f
2tf6g8
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
f9m9fs
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
What's up friends, its great paragraph concerning teachingand completely defined, keep it up all the
time.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
mb17st
gunnarpeipman.com
gunnarpeipman.com
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
gunnarpeipman.com
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you very much for sharing, I learned a lot from your article. Very cool. Thanks.
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Have you ever thought about writing an e-book or guest
authoring on other blogs? I have a blog based upon on the same information you discuss and
would really like to have you share some
stories/information. I know my readers would appreciate your work.
If you are even remotely interested, feel free to send
me an e-mail.
Your blog is a beacon of light in the often murky waters of online content. Your thoughtful analysis and insightful commentary never fail to leave a lasting impression. Keep up the amazing work!
constantly i used to read smaller content that as well clear their motive, and that is
also happening with this piece of writing which I am reading now.
555
555
1'"
hw8mbg
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thank you, your article surprised me, there is such an excellent point of view. Thank you for sharing, I learned a lot.
It’s actually a cool and helpful piece of info. I am happy that you just shared this helpful info with us. Please keep us informed like this. Thank you for sharing.
pqsx4e
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Your article helped me a lot, is there any more related content? Thanks!
Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://www.binance.com/pt-PT/join?ref=YY80CKRN
nlpiyb
gunnarpeipman.com
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
x6cx37
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
I don't think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.
snxd2d
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
77h809
gunnarpeipman.com
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
I have learn several good stuff here. Definitely price bookmarking for revisiting. I surprise how so much effort you put to make this sort of wonderful informative web site.
zzbxn6
Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.
I don't think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Hello.This post was extremely fascinating, especially since I was browsing for thoughts on this subject last couple of days.
e79nki
I do not even know how I ended up here but I thought this post was great I do not know who you are but certainly youre going to a famous blogger if you are not already Cheers
Howdy this is kinda of off topic but I was wondering if blogs use
WYSIWYG editors or if you have to manually code with HTML.
I'm starting a blog soon but have no coding expertise so
I wanted to get advice from someone with experience. Any
help would be greatly appreciated!
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
i72w1w
gwjv7j
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Hosting applications on Azure B-series virtual machines
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?
Your article helped me a lot, is there any more related content? Thanks!
I don't think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.