1. 程式人生 > 實用技巧 >樑斌penny_Penny Pinching在雲中:Azure網站何時有意義?

樑斌penny_Penny Pinching在雲中:Azure網站何時有意義?

樑斌penny

樑斌penny

image

I had a great conversation on Twitter with Frans Bouma about pricing where he asked a number of questions that weren't easily answered in 140 characters. The pricing for these things isn't clear or easy. It's not clear or easy because it's complicated.

我在推特上與Frans Bouma進行了精彩的對話,談論定價問題,他問了很多不易用140個字元回答的問題。 這些東西的定價不清楚或不容易。 它不清楚或容易,因為它很複雜。

Frans is thinking about moving his product’s website over to Azure but he’s thinking it’s too expensive for his one website. Good question.

Frans正在考慮將其產品的網站移至Azure,但他認為這對於他的一個網站來說太貴了。 好問題。

Here's my own Q&A about Azure Websites and Pricing. Folks are always emailing me with confusion so I'm writing it up. If you email me questions from now on (since I have only so many

keysleft.com) I'm going to point you here.

這是我自己有關Azure網站和定價的問答。 人們總是給我發來混亂的電子郵件,所以我正在寫。 如果您從現在開始向我傳送問題(因為我只有那麼多的keyleft.com ),我將在這裡為您指出。

Disclaimer: This is written by me, not Marketing. I'm sure they'll be on the phone in a minute when they see this post. It doesn’t make it less true, though.

免責宣告:

這是我寫的,不是市場部的。 我確定他們看到此資訊後,他們會在一分鐘內給他打電話。 但是,這並沒有使它不那麼真實。

I wasn't an Azure fan until June of last year. I run all my sites on Azure except for this blog (which is at OrcsWeb where it's been for years).

直到去年六月我才是Azure粉絲。 除了該部落格(在OrcsWeb已有多年曆史了)之外,我都在Azure上運行了所有站點。

Today, I have 13 websites and two VMs (one Linux and one Windows) running in Azure. 11 sites run in one VM instances with Azure Websites in the West US, and the other two are in different datacenters.

今天,我在Azure中執行著13個網站和兩個VM(一個Linux和一個Windows)。 一個虛擬機器例項中有11個站點在美國西部的Azure網站上執行,另外兩個在不同的資料中心中。

Q: I have a small website on a custom domain that I'm paying US$5 a month for at FooHost. Should I move to Azure?

問:我在自定義域上有一個小型網站,我每月在FooHost上支付5美元。 我應該搬到Azure嗎?

A: Probably not. While you can get 10 free websites per data center (meaning, more than 10, technically) to play in Azure, if you want to point a custom domain at it you'll need at least one "shared" (multi-tenant, meaning you get a slice of a CPU) website. That's US$9.68 a month, running full time. If $9.68 is too rich for you, stick with your $5 host. However, you do get to use the same management tools and deployment subsystems even with just one shared site so it depends on what you find valuable. Free sites are great for development and test scenarios where you can experiment with new concepts before you start spending money.

答:可能不會。 雖然每個資料中心可以獲得10個免費網站(從技術上講,這意味著10個以上)可以在Azure中執行,但是如果要指向自定義域,則需要至少一個“共享”(多租戶,這意味著您將獲得一個CPU網站)。 這是每月9.68美元,全天候執行。 如果$ 9.68美元對您來說太富裕,請堅持使用$ 5美元的主機。 但是,即使只有一個共享站點,也必須使用相同的管理工具和部署子系統,因此這取決於您發現有價值的東西。 免費網站非常適合開發和測試場景,您可以在開始花錢之前嘗試新概念。

If you’re trying to get by with the minimum for a few bucks a month, I don’t think it’s fair to compare Azure to a random $4.99 PHP host. You get command line management tools, lots of deployment choices, elastic scale in minutes whenever you want, etc.

如果您試圖以每月至少幾美元的最低價來賺錢,我認為將Azure與隨機的$ 4.99 PHP主機進行比較是不公平的。 您可以使用命令列管理工具,許多部署選擇,可以在幾分鐘內隨意調整彈性規模等。

Q: What if I am OK with $10 a month? What do I get with one shared site?

問:如果我每月可以拿10美元,該如何辦? 一個共享站點我能得到什麼?

A: Whether it's 1 site or 500, all websites get Git deployment (and redeployment, also known as the "oh shit button") as well as deployment from Visual Studio and TFS. Everyone gets the same infrastructure and control panel. You can also scale out to up to 6 shared instances if you need.

答:無論是1個站點還是500個站點,所有網站都可以進行Git部署(以及重新部署,也稱為“哦,糟糕”按鈕),還可以從Visual Studio和TFS進行部署。 每個人都擁有相同的基礎架構和控制面板。 如果需要,您還可以擴充套件到最多6個共享例項。

Each instance is a copy of your code running on a different shared server with its own quota of CPU and memory. We chose to limit the number of instances to 6 since having more than 6 instances ends up being more expensive than having one Standard server. You can have up to a 100 sites in Shared mode per data center, each site can have up to 6 instances.

每個例項都是在具有自己的CPU和記憶體配額的不同共享伺服器上執行的程式碼的副本。 我們選擇將例項數限制為6,因為擁有6個以上的例項最終會比擁有一臺Standard伺服器更昂貴。 每個資料中心在共享模式下最多可以有100個站點,每個站點最多可以有6個例項。

Q: What about running my own VM and not using managed Websites?

問:如何執行自己的虛擬機器而不使用託管網站?

A: If you know what you're doing, you can run your Website in a VM, but you need to setup IIS and manage it yourself. You need to keep the VM updated, and configure it however you want. But, you can get an extra small VM for $15 a month with 768MB RAM, which is nice. I run an instance of MySQL in one of these as well as PHP on Apache.

答:如果您知道自己在做什麼,則可以在VM中執行網站,但是需要自行設定IIS並對其進行管理。 您需要保持虛擬機器更新,並根據需要進行配置。 但是,您可以以每月15美元的價格獲得具有768MB RAM的額外小型VM,這很好。 我在其中之一以及MySQL在Apache上執行MySQL的例項。

image

Q: When would I run a VM over a Website?

問:何時可以在網站上執行VM?

A. It comes down to what you want to manage. If you're cool with managing a VM and you want the flexibility, do that. If you want the OS and updates handled for you, as well as the deployment choices and scale out, use web sites.

答:這取決於您要管理的內容。 如果您對管理虛擬機器很滿意並且想要靈活性,請執行此操作。 如果要為您處理作業系統和更新,以及選擇部署和擴充套件,請使用網站。

image

Q: There's Free, Shared and Standard Websites. What's the difference?

問:有免費,共享和標準的網站。 有什麼不同?

A. Free means it's free, there's no uptime guarantee and you're low priority. I put demos and tests and dev on free stuff. I also run some services where it doesn't matter what the URL is because no one can see it. You can't use custom domains or SSL with free.

答:免費意味著它是免費的,沒有正常執行時間保證,您的優先順序較低。 我把演示,測試和開發放在免費的東西上。 我還會在一些URL無關緊要的地方執行一些服務,因為沒人能看到它。 您不能免費使用自定義域或SSL。

Shared means you're getting a slice of a computer and you're packed in with a lot of other folks on the shared plans. Most small websites (<20,000 PV) work just fine with shared.

共享意味著您將擁有一臺計算機,並且在共享計劃中擠滿了很多其他人。 大多數小型網站(<20,000 PV)與共享網站都可以正常工作。

Standard used to be called Reserved. You get your own VM and you can run ASP.NET, nodejs, PHP, etc (the same things you can run on Free and Standard). You can go from 1 core and 1.75G of RAM all the way up to 4 cores and 7G of RAM. I run all my sites in 1 standard small instance. Even with small I've got almost 2 gigs of ram and even though some of my sites (like Hanselminutes) do caching and may use 100-300 megs of RAM on a busy day, I've never had any issues.

標準曾經被稱為保留。 您擁有自己的VM,並且可以執行ASP.NET,nodejs,PHP等(可以在Free和Standard上執行的相同功能)。 您可以從1核和1.75G RAM一直到4核和7G RAM。 我在1個標準的小型例項中執行所有站點。 即使體積很小,我也有將近2 gig的ram,即使我的某些站點(例如Hanselminutes )可以快取,並且在忙碌的一天中可能會使用100-300 meg的RAM,但我從來沒有遇到任何問題。

If you need more than one server to run your sites you can scale out to 10 instances of your Standard server, if you need more than 10 server instances you can contact support services and they’ll work something out.

如果您需要一臺以上的伺服器來執行站點,則可以擴充套件到標準伺服器的10個例項,如果您需要10個以上的伺服器例項,則可以聯絡支援服務,他們將為您解決問題。

Here's the thing about clouds generally and Azure specifically. If you're not packing things densely you're not going to save money.

這是關於一般雲,尤其是Azure的事情。 如果您不密集地包裝東西,那麼您將不會省錢。

You can put up to 500 websites into a single instance using Azure Websites. That's not a typo. The more you put in the more value you get from your VM/standard instance.

使用Azure網站,您最多可以將500個網站放到一個例項中。 那不是錯字。 投入越多,您從VM /標準例項獲得的價值就越大。

image

Tip: Pack sites in tight. To be clear, if you are going to run more than 8 websites in Azure, you're a tool to not move into Standard/Reserved. It's just cheaper. Plus, if you have a bunch of sites in one Data Center (like, I had 10+ in West US) you want to put them all in the same VM. If you can keep serving traffic then effectively all sites you can put comfortably in your existing instance are "free." You're paying for the instance, use it.

提示:將網站收緊。 需要明確的是,如果要在Azure中執行8個以上的網站,則是一個不進入標準/保留狀態的工具。 便宜一點。 另外,如果您在一個數據中心中有很多站點(例如,我在美國西部擁有10多個站點),則您希望將它們全部放在同一虛擬機器中。 如果您可以繼續提供流量,那麼實際上可以放心地放置在現有例項中的所有站點都是“免費的”。 您需要為例項付費,使用它。

Q. You're insane, what kind of sites could provide value and also be packed that tight?

問:您太瘋狂了,什麼樣的網站可以提供價值,而且打包得如此緊湊?

A. There's lots of little sites, like my podcasts for example, that get a few tens of thousands or even hundreds of thousands hits a month. If you're working for a digital agency and putting together simple sites, you can start saving big money after about 6 to 8 sites.

答:有很多小的站點,例如我的播客,每個月都有數萬甚至數十萬的點選。 如果您正在為一家數字代理機構工作,並且將簡單的站點放在一起,則可以在大約6到8個站點之後開始節省大量資金

Here's the Azure Pricing Calculator. In my opinion it's silly that it goes past 8 in Shared mode. Anything more than 8 shared sites is a waste of money.

這是Azure定價計算器。 我認為在共享模式下超過8是很愚蠢的。 超過8個共享站點都是浪費金錢。

image

You might look at this and thing, 8 for $77? That's real money and too rich for me. I'm going to stick with my $5 host. And you probably should if you can pack 8 sites onto that $5 machine.

您可能會看這個東西,77美元的價格是8美元嗎? 那是真錢,對我來說太富有了。 我要堅持5美元的房東。 而且,如果您可以將8個站點打包到這臺5美元的機器上,就應該這樣做。

However, things get cheap when you move to Standard mode. Once you have 1 standard website VM you can put lots of stuff on that one machine.

但是,當您進入標準模式時,事情變得便宜了。 一旦擁有1個標準網站虛擬機器,就可以在一臺計算機上放置很多東西。

image

Again, each web site is all alone, isolated and separately deployable and manageable, but they share your 1 VM. But the value is that you never think about the management of the VM. It's always up to date, they're looking for malware, patching the OS, handling stuff. Web Sites sits above the VM and you use FTP, Git Deploy or MS Deploy to get your site there. You can run ASP.NET, PHP, node.js, Python, hell, Classic ASP if you want to.

同樣,每個網站都是單獨的,獨立的,可分別部署和管理的,但是它們共享您的1個VM。 但價值在於您無需考慮虛擬機器的管理。 它始終是最新的,他們正在尋找惡意軟體,修補作業系統,處理內容。 網站位於VM上方,您可以使用FTP,Git Deploy或MS Deploy來將您的網站放置在該位置。 您可以根據需要執行ASP.NET,PHP,node.js,Python,地獄,經典ASP。

You're paying for the compute time, 0.10/hr and you're being billed as it's running. If it runs all month long it's $74.40. I run all my sites inside this VM. It's actually a little large, and I could probably get away with an "Extra Small VM" if they would make one for Web Sites (the team is telling me that this is coming soon). Note that I am charged 0.10/hr even if my sites get no traffic, I am essentially paying for “renting” the CPU from Azure.

您需要支付0.10 /小時的計算時間,並且在執行時需要付費。 如果它運行了整整一個月,則為74.40美元。 我在此虛擬機器中執行所有站點。 它實際上有點大,如果他們可以為網站製作一個“超小型VM”,我可能會放棄(團隊告訴我這很快就會出現)。 請注意,即使我的網站沒有流量,我也要支付每小時0.10的費用,我實際上是為從Azure中“租用” CPU付費。

Q. When do I scale, and how?

問:我什麼時候縮放,如何縮放?

A. I talk to customers a lot and most of the ones doing public sites always overstate their traffic. What they want is the ability to scale IF it becomes popular. You can scale UP (bigger instance) or scale OUT (more instances).

答:我經常與客戶交流,大多數在公共網站上的客戶總是誇大其流量。 他們想要的是在流行的情況下進行擴充套件的能力。 您可以向上擴充套件(更大的例項)或向外擴充套件(更多的例項)。

You can set you sites to auto-scale if you get on Hacker News or your startup becomes popular. Azure will add (and remove!) instances to make sure traffic gets handled. It will never go above or below the settings you choose.

如果您收到“黑客新聞”或您的創業公司很受歡迎,則可以將網站設定為自動縮放。 Azure將新增(並刪除!)例項以確保流量得到處理。 它永遠不會高於或低於您選擇的設定。

image

This is a way to control costs. In this screenshot, I will never go above 3 instances, so my site can fall over if it gets slammed, but I decide how hard it tries to scale. I want to balance costs with availability. I could change this however I want from just 1 small VM to 10 large ones, so that's 1 core to 40, as I like.

這是控制成本的一種方式。 在此螢幕截圖中,我將永遠不會超過3個例項,因此,如果我的網站遭到猛烈抨擊,它可能倒塌,但是我決定了它嘗試擴充套件的難度。 我想在成本和可用性之間取得平衡。 我可以將其更改,但是我想從1個小型VM更改為10個大型VM,所以我希望將1個核心虛擬機器更改為40個。

Q: Are Azure Websites running all the time, 24/7?

問:Azure網站是否始終在24/7全天候執行?

A: If you have a standard VM with a bunch of websites in them, the VM is running all the time and you're paying for that VM. If one of the web sites isn't used for some large number of hours, it will be put to sleep, freeing up resources for other sites on the same VM. If you're worried about the web site not warming up quickly, you can use the build in Monitoring feature to not only ensure they are always up but that they are always warm.

答:如果您有一個帶有一堆網站的標準VM,則該VM一直都在執行,您需要為該VM付費。 如果其中一個網站長時間不使用,它將進入睡眠狀態,從而為同一VM上的其他網站釋放資源。 如果您擔心網站無法快速預熱,則可以使用“內建”監視功能來確保它們始終處於預熱狀態,並且始終處於預熱狀態。

image

Q: I’ve got an MSDN Subscription, what does that get me?

問:我有一個MSDN訂閱,那對我有什麼幫助?

Link your MSDN and Azure accounts and you can get up to $150 a month in Azure credits, so up to two free VMs running all day for a month.

連結您的MSDN和Azure帳戶,您每月最多可以獲得150美元的Azure信用額,因此最多兩個免費VM可以全天執行一個月。

I've done a few posts on "Penny Pinching in the Cloud" that you may enjoy.

我已經發表了一些您可能會喜歡的文章“ Penny Pinching in the Cloud”。

關於斯科特(About Scott)

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

斯科特·漢塞爾曼(Scott Hanselman)是前教授,前金融首席架構師,現在是演講者,顧問,父親,糖尿病患者和Microsoft員工。 他是一位失敗的單口相聲漫畫家,一個玉米種植者和一本書的作者。

facebook twitter subscribe About 關於 Newsletter 時事通訊 Hosting By 主持人 Hosted in an Azure App Service

翻譯自: https://www.hanselman.com/blog/penny-pinching-in-the-cloud-when-do-azure-websites-make-sense

樑斌penny