Hacker News 上對實體機房的討論 (雲與地的討論)

看到 Hacker News 上的「Ask HN: Is your company sticking to on-premise servers? Why?」這邊在討論為什麼還是有公司使用傳統的實體機房。

用雲的價值在於彈性,因為雲上加機器的時間成本比傳統實體機房低很多:加的量小的時候,主要的成本就是簽核需要的時間 (即使是電子簽) 與 setup 的時間 (如果沒有自動化),量大的時候可能會需要另外採購。

另外很多雲端服務的廠商除了 IaaS 以外也提供了很多 SaaS 的服務,這點對於建制的成本又降低了不少。

相反的,如果你的需求已經很固定了 (變動不大),而且又已經有一定的規模了,用傳統實體機房自己搭建會便宜很多,即使包含人力維護成本也都還是低很多。

另外討論裡也有提到雲端的頻寬費用,這一直都是雲端的痛點:目前雲上面的頻寬都超貴,所以用規模大一點的雲端公司會透過架構上的設計,把大的流量利用 HTTP/HTTPS 的 CDN 省下來。像是使用 AWSNetflix 設計了 Open Connect,藉以降低頻寬成本。

不過說到頻寬,AWS 的 Amazon Lightsail 就是個有趣的東西了,一樣是在 AWS 的架構內,但帳務上面把整包費用包的跟外面的 VPS 一樣...

EC2 宣佈 Reserved Instances 降價

Amazon EC2 的 Reserved Instances 宣佈降價:「EC2 Price Reduction – For EC2 Instance Saving Plans and Standard Reserved Instances」。

文章裡先列出 M5/C5/R5 的:

可以看到 R5 在一年是完全沒動,然後有些也是 0%,不過大多數應該是都有降:

Below I’ve given a snapshot of some of the savings across the M5, C5, and R5 instance types, however there are also price reductions for the instance types C5n, C5d, M5a, M5n, M5ad, M5dn, R5a, R5n, R5d, R5ad, R5dn, T3, T3a, Z1d, and A1.

以這些資料看起來是降了一些,但實際想要翻 T3a 系列機器的歷史資料時發現不好找,用搜尋引擎可以在「Where can I find Amazon EC2 price history?」這邊看到「https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/AmazonEC2/current/index.csv」這個地方,看起來是「New – AWS Price List API」這邊的資訊,不過看起來沒有 RI 的資料,只有 AmazonEC2 的資料 (所以對應到的都是 $0.00)。

之後看看有沒有其他地方有留這些資訊好了...

GitHub 擴大免費版功能,以及付費版降價

GitHub 宣佈了提昇免費版的功能,以及付費版的降價消息:「GitHub is now free for teams」。

昨天是這樣:(從這邊撈的,然後發現好像有人寫了個機器人,每天都叫 web.archive.org 去撈一份...)

現在變成:

本來付費的個人方案 (Pro) 的功能都直接下放到免費版本了,而一般公司用的 Team 版本從 $9/m/user 降到 $4/m/user。有個富爸爸之後就可以任性...

Cloudflare 改用自己的 CAPTCHA 服務 hCaptcha

CloudflareGooglereCAPTCHA 改用自家的 hCaptcha:「Moving from reCAPTCHA to hCaptcha」。

看起來其實就是錢的問題,reCAPTCHA 要收費了,而以 Cloudflare 的量會太貴:

Earlier this year, Google informed us that they were going to begin charging for reCAPTCHA. That is entirely within their right. Cloudflare, given our volume, no doubt imposed significant costs on the reCAPTCHA service, even for Google.

另外 hCaptcha 有提供免費版本給一般網站用,剛出來這幾天等白老鼠寫心得後,再決定要不要跳進去測試...

花最多錢的 API call

昨天看到這個有趣的討論,要怎麼樣在一個 API call 裡面花最多錢:「How to burn the most money with a single click in Azure」。

主要是這篇開始,在 AWS 上面買 RDS 的 RI,這一個 API call 可以花三百多萬美金:

然後作者試著在 Azure 上找到 Cosmos DB 可以花到九百多萬美金:

另外一個是用 Blob Storage 撐量出來,一億六千多萬美金:

然後最終極的方法是 999 台 instance 的 RI,可以到八億 XDDD:

不過後面這些方法應該買不下去,雲端服務預留的 capacity 應該不夠這樣搞...

Lambda 被放進 Savings Plans 了

前幾天才在 Ptt 上回了一些對 Lambda 與 Serverless 的想法,結果剛剛看到 Lambda 被納入 Savings Plans 裡面了:「Savings Plan Update: Save Up to 17% On Your Lambda Workloads」。

最多 17% 的折扣,看起來比其他的低不少,應該是因為 Lambda 比起 EC2 或是 Fargate 更動態的關係:

Today I am happy to be able to tell you that Compute Savings Plans now apply to the compute time consumed by your AWS Lambda functions, with savings of up to 17%.

現有的 Savings Plans 如果沒有用完的部份也會自動套用進去。先放著看看...

Amazon EKS 降價 50%

Amazon EKS 宣佈降價 50%:「Amazon EKS Price Reduction」。

開頭這段就講了重點:

[...] We are reducing the price by 50%.

As of the 21st of January, the price will reduce from $0.20 per hour for each Amazon EKS cluster to $0.10 per hour. This new price is for all new and existing Amazon EKS clusters.

本來的價錢換算成月費大約是 USD$144/month,現在降到 USD$72/month,看起來好像很多,但因為這其實只是 kubernetes 的 controller 費用,實際跑 pod 的 EC2 instance 還是照舊,所以應該是還好...

對於每個 cluster 的量都夠大的人來說其實沒有太多感覺,主要是對於每個 cluster 量不大的人會好很多...

省頻寬的方法:終極版本...

看到「Three ways to reduce the costs of your HTTP(S) API on AWS」這邊介紹在 AWS 上省頻寬費用的方法,看了只能一直笑 XD

第一個是降低 HTTP response 裡沒有用到的 header,因為每天有五十億個 HTTP request,所以只要省 1byte 就是省下 USD$0.25/day:

Since we would send this five billion times per day, every byte we could shave off would save five gigabytes of outgoing data, for a saving of 25 cents per day per byte removed.

然後調了一些參數後省下 USD$1,500/month:

Sending 109 bytes instead of 333 means saving $56 per day, or a bit over $1,500 per month.

第二個是想辦法在 TLS 這邊下手,一開始其中一個方向是利用 TLS session resumption 降低第二次連線的成本,但他們發現沒有什麼參數可以調整:

One thing that reduces handshake transfer size is TLS session resumption. Basically, when a client connects to the service for the second time, it can ask the server to resume the previous TLS session instead of starting a new one, meaning that it doesn’t have to send the certificate again. By looking at access logs, we found that 11% of requests were using a reused TLS session. However, we have a very diverse set of clients that we don’t have much control over, and we also couldn’t find any settings for the AWS Application Load Balancer for session cache size or similar, so there isn’t really anything we can do to affect this.

所以改成把 idle 時間拉長 (避免重新連線):

That leaves reducing the number of handshakes required by reducing the number of connections that the clients need to establish. The default setting for AWS load balancers is to close idle connections after 60 seconds, but it seems to be beneficial to raise this to 10 minutes. This reduced data transfer costs by an additional 8%.

再來是 AWS 本身發的 SSL certification 太肥,所以他們換成 DigiCert 發的,大幅降低憑證本身的大小,反而省下 USD$200/day:

So given that the clients establish approximately two billion connections per day, we’d expect to save four terabytes of outgoing data every day. The actual savings were closer to three terabytes, but this still reduced data transfer costs for a typical day by almost $200.

這些方法真的是頗有趣的 XDDD

不過這些方法也是在想辦法壓榨降低與 client 之間的傳輸量啦,比起成本來說反而是提昇網路反應速度...

Backblaze 採購硬碟的策略

在「How Backblaze Buys Hard Drives」這篇裡面提到了 Backblaze 採購硬碟的策略,可以看到完全都是偏成本走向,所以裡面的策略一般個人用不太到,一般企業也不應該照抄,但拿來看看還蠻有趣的...

像是因為硬碟太多,所以硬碟的使用電量是他們在評估成本時蠻重要的一環,這點在一般的情境下不太會考慮到:

Power draw is a very important metric for us and the high speed enterprise drives are expensive in terms of power cost. We now total around 1.5 megawatts in power consumption in our centers, and I can tell you that every watt matters for reducing costs.

另外也提到了 SMR 硬碟的特性,在單位成本雖然有比較高的容量,但導致架構面需要配合 (cache),而也會有工程端的成本提昇,所以不是很愛:

SMR would give us a 10-15% capacity-to-dollar boost, but it also requires host-level management of sequential data writing. Additionally, the new archive type of drives require a flash-based caching layer. Both of these requirements would mean significant increases in engineering resources to support and thereby even more investment. So all-in-all, SMR isn’t cost-effective in our system.

成本面上,他們觀察到的現象是每季會降 5%~10%:

Ideally, I can achieve a 5-10% cost reduction per terabyte per quarter, which is a number based on historical price trends and our performance for the past 10 years.

另外提到了用 SAS controller 可以接多個 SATA 硬碟的事情 (雖然還是成本考量),但這塊也蠻有趣的:

Longer term, one thing we’re looking toward is phasing out SATA controller/port multiplier combo. This might be more technical than some of our readers want to go, but: SAS controllers are a more commonly used method in dense storage servers. Using SATA drives with SAS controllers can provide as much as a 2x improvement in system throughput vs SATA, which is important to me, even though serial ATA (SATA) port multipliers are slightly less expensive. When we started our Storage Pod construction, using SATA controller/port multiplier combo was a great way to keep costs down. But since then, the cost for using SAS controllers and backplanes has come down significantly.

Rasmus 的平價 VPS 測試

Rasmus Lerdorf 整理的資料 (就是生出 PHP 的那個 @rasmus),關於平價 VPS 的測試:「Low-Cost VPS Testing」。

因為是 PHP 的大頭,所以把編 PHP 當作是 benchmark 的項目之一也不算太意外。另外還是有比較常見的 dd 與 iperf3 測試資料可以看。

算是一個挖掘的點,之後也可以租幾台測試看看...