CloudFront 的 Regional Edge Caches

Amazon CloudFront 前陣子宣佈了 two-tier 架構:「Announcing Regional Edge Caches for Amazon CloudFront」。

一般的 CDN 是 edge 收到後就打到 origin,這會使得 origin 的量比較大。而 two-tier 架構則是在中間疊一層降低對 origin 的量。這種架構對於直播時的 pattern 幫助很大:由於量很大,會需要用大量的 edge server 支撐,而 edge server 一多就對 origin 產生巨大的壓力。

一般直播 95% 的 hitrate 表示外面 20Gbps 的流量就會造成 origin 1Gbps 的流量,通常用 two-tier 可以拉到 98%+ (CDN vendor 有調整過可以到 99%+)。

這種技術在 Akamai 叫 Tiered Distribution,在 EdgeCast 叫 SuperPoP,而現在 CloudFront 也推出了,叫做 Regional Edge Cache:

The nine new Regional Edge Cache locations are in Northern Virginia, Oregon, São Paulo, Frankfurt, Singapore, Seoul, Tokyo, Mumbai, and Sydney.

edge 會先到這幾個 regional edge 再到 origin:

These locations sit between your origin webserver and the 68 global edge locations that serve traffic directly to your viewers.

然後預設都開啟了,沒有額外費用:

Regional Edge Caches are turned on by default for your CloudFront distributions; you do not need to make any changes to your distributions to take advantage of this feature. There are also no additional charges to use this feature.

不過這個架構對於 latency 應該不會太好,沒得關閉有點奇怪...

Debian 的 CloudFront

剛剛看到 Debian Mirrors via CloudFront 這個,原來 AWS 幫忙付掉了:

This service is kindly hosted by and paid for by Amazon Web Services, and we thank them for their contribution to Debian.

翻了 mailing list 發現是在 2013 年五月的時候弄出來的:「Debian archive distribution via CloudFront CDN」。

在 AWS 上跑 Consul 與 Vault 的介紹

HashiCorp 這邊看到在 AWS 上跑 ConsulVault 的介紹文章:「Consul and Vault on AWS: Quick Start Guides」。

Consul 負責 service discovery 與 health check (還有簡單的 key-value 功能);Vault 則負責管理各種 secret (像是資料庫的帳號密碼之類的資訊)。

這些資料分別可以在「HashiCorp Consul on AWS」與「HashiCorp Vault on AWS」看到,打開 PDF 後可以發現是 AWS 與 HashiCorp 的人合作生出來的文件,要在上面實作的人可以看一看,應該是可以少走冤枉路...

CloudWatch 的降價

更早之前就公告了,但剛剛才翻到:「AWS Price Reduction – CloudWatch Metrics」。

CloudWatch 從 2011 年這次的降幅算比較大的,最低的降幅都有 40%,而超過一萬個 metrics 的部分則是 80%,然後不同級距有不同降幅,最高到 96% (也就是原來的 4% 價錢)...

Amazon EC2 的 CloudWatch 用了七個 metrics,所以如果有開 CloudWatch 進階版本的情況下,價錢從 $3.50 降到 $2.10:

If you have EC2 Detailed Monitoring enabled you will also see a price reduction with per-month charges reduced from $3.50 per instance per month to $2.10 or lower based on the volume tier.

在服務金額裡面的量通常不會太大,不過這次降價不無小補...

VPC 環境下的 EC2 支援 IPv6

AWS 總算是把 EC2 推上 IPv6 了:「New – IPv6 Support for EC2 Instances in Virtual Private Clouds」。

不過只有在 US East (Ohio) (us-east-2) 有,而且 m3.*g2.* 目前都還不支援:

IPv6 support for EC2 is now available in the US East (Ohio) Region and you can start using it today at no extra charge. It works with all current-generation EC2 instance types with the exception of M3 and G2, and will be supported on upcoming instance types as well.

看得到吃不到 XDDD

Amazon Pinpoint:對 Amazon Mobile 得到的資料設定條件發推播

這次 AWSAmazon Mobile 收到的資料定義條件發出推播:「Amazon Pinpoint – Hit your Targets with AWS」。

功能是陽春了一些 (其他競爭對手應該還可以發 mail 之類的),但以 AWS 的名字放出來,等於又殺了一票市場上還沒爬起來的競爭對手...

在 CloudFront 的 edge 上跑 Lambda

所以 Amazon CloudFront 讓使用者在 edge 上跑程式了 (雖然目前是 limited preview):「Lambda@Edge – Preview」。

分成 Viewer Request、Origin Request、Origin Response 以及 Viewer Response 四個階段可以插入修改。另外有些限制:

Because your JavaScript code will be part of the request/response path, it must be lean, mean, and self-contained. It cannot make calls to other web services and it cannot access other AWS resources. It must run within 128 MB of memory, and complete within 50 ms.

要在 128MB 內搞定,而且不能呼叫其他資源。不過這樣已經可以做很多事了... 基本上就是一台 turing machine 了 :o

Amazon S3 的改善

其實老牌的 Amazon S3 也改了不少東西:「Revolutionizing S3 Storage Management with 4 new features」。

其中的「S3 Object Tagging」讓管理可以透過 tag 處理,管理上會多一些選擇。而「S3 Analytics, Storage Class Analysis」則是可以分析存取的 pattern,藉此重新規劃 policy。

看到之前的同事說 CloudFront 要支援 2-tier cache,但卻還沒看到公告,不知道是怎麼樣的實作方式... 這對大型的 live streaming 幫助很大啊,後面的壓力會小很多。

Amazon Polly 與 Amazon Lex:人機介面中的語音處理

AWS 這次推出的這兩個服務剛好成對:「Amazon Polly – Text to Speech in 47 Voices and 24 Languages」、「Amazon Lex – Build Conversational Voice & Text Interfaces」。

Amazon Polly 負責把文字唸出來變成語音,而 Amazon Lex 則是將語音辨識回文字,不過目前都還不支援中文... 但畢竟讓 user interface 這塊變得更親民了,算是基礎建設中服務,讓 startup 專心在產品本身上。