Amazon EC2 推出新機種:m4.*

Amazon EC2 推出新的一般性機種 m4.* 了:「The New M4 Instance Type (Bonus: Price Reduction on M3 & C4)」。

亮眼在 m4.10xlarge 這組可以控制 C-state 與 P-state,可以利用這兩個對 latency 與整體 performance 調整。

拿 m4.large 與 m3.large 比較,m4 便宜一些,而且 m4 記憶體比 m3 大一點,但是 m3 有內掛 SSD,m4 需要 EBS。如果 I/O 比較重的應用還是用 m3 還是比較好。

另外一個發表的是 m3.* 在某些地區有些微的降價 (約 5%),就當作撿到的...?

AWS 北京開了第二個 AZ

官方的公告在這邊:「更新:AWS中国北京区域推出第二个EC2可用区」。

我以為每個地區都是直接開兩個以上的 AZ?(就之前其他地區看到的經驗) 沒想到北京現在才開第二個 AZ...

目前還是在 Limited Preview,要申請的人要自己找管道去要...

EC2 Instance 的發展紀錄

Jeff Barr 被問到有沒有 Amazon EC2 每種 instance 的發表時間,結果連他手上都沒有完整的資料... 這是他目前整理出來的資訊:「EC2 Instance History」。

Update:畢竟還是 AWS 的高層,應該是從內部抓出資料後再去找什麼時候公佈的,目前的表格補齊了。

其中 m1.small 在的 2006 年八月是歷史性的一刻,Amazon EC2 的發表,雲端服務的里程碑:「Amazon EC2 Beta」。

CloudFront 支援 Wildcard Invalidation

在「Amazon CloudFront Makes it Easier to Invalidate Multiple Objects」這邊看到的消息,Amazon CloudFront 總算是支援 Wildcard Invalidation 了。價錢與 Single Object Invalidation 相同,都是每次 USD$0.005。

依照 Invalidating Objects (Web Distributions Only) 這邊的說明,Wildcard 的部份只能用在結尾:

To invalidate objects, you can specify either the path for individual objects or a path that ends with the * wildcard, which might apply to one object or to many, as shown in the following examples:

  • /images/image1.jpg
  • /images/image*
  • /images/*

不過還是有些限制,包括了 Single Object Invalidation 的同時最多 3000 條的限制:

If you're invalidating objects individually, you can have invalidation requests for up to 3,000 objects per distribution in progress at one time. This can be one invalidation request for up to 3,000 objects, up to 3,000 requests for one object each, or any other combination that doesn't exceed 3,000 objects. For example, you can submit 30 invalidation requests that invalidate 100 objects each. As long as all 30 invalidation requests are still in progress, you can't submit any more invalidation requests. If you exceed the limit, CloudFront returns an error message.

以及 Wildcard Invalidation 的同時 15 條限制:

If you're using the * wildcard, you can have requests for up to 15 invalidation paths in progress at one time.

而且每次 invalidate 可能都要 10~15 分鐘:

It usually takes 10 to 15 minutes for CloudFront to complete your invalidation request, depending on the number of invalidation paths that you included in the request.

所以也不是付錢就可以解決所有事情... :o

AWS 處理這次的 Leap Second...

2015/06/30 到 2015/07/01 會有 Leap Second (閏秒),而這次 AWS 處理的方法也公告出來了:「Look Before You Leap – The Coming Leap Second and AWS」。

EC2 由於每個 instance 有自己的 clock,所以需要自己實作:如果對閏秒不會有問題的系統就放著,而對閏秒敏感的系統可以自己跑 ntpd 之類的程式校正。

而其他 AWS 的系統會用 24 個小時攤平多出來的閏秒,從 2015/06/30 的中午 12:00:00 開始,到 2015/07/01 的中午 12:00:00 結束 (都是 UTC):

也就是說不會出現 23:59:60 這種時間,而在這 24 小時調整區間內的誤差最多 0.5 秒。

Google Cloud Platform 也推出了類似 Spot Instance 的產品

Google Cloud Platform 推出了類似於 Amazon EC2 的 Spot Instance 的產品,叫做 Preemptible VM:「Introducing Preemptible VMs, a new class of compute available at 70% off standard pricing」。

不同的是,沒有引入競價系統,而是固定的 discount。另外有一些限制,像是最多持續 24 小時:

The tradeoff is that Preemptible VMs are limited to a 24 hour runtime, and will sometimes be preempted (shut down) earlier than that.

而停機通知時間比 Spot Instance 短,只有 30 秒 (相較於 Spot Instance 有兩分鐘):

When Preemptible VMs are terminated, they'll receive a 30 second notice allowing you to shutdown cleanly (including saving work, if applicable).

Amazon VPC 的 Private Subnet 不需要透過 NAT 去 Amazon S3 抓資料了

在今天之前,Amazon VPC 裡 Private Subnet 的機器需要透過 NAT 才能連到 Amazon S3 的 Endpoint API 上操作:(NAT instance 會放在 Public Subnet 裡)

出自「NAT Instances」的說明。

但在這個架構中,如果 NAT instance 不夠大台,甚至是流量需求超過 10Gbps 時就會有效能瓶頸了。而目前沒有比較簡單的方法可以解決。(一種解法是拆多個 subnet 跑,透過多個不同的 NAT instance 連出去,但這樣架構又變複雜了)

今天則是公佈了讓內部可以直接存取 Amazon S3 的方式:「New – VPC Endpoint for Amazon S3」。第一波是美國 (扣除美國政府用的區域)、歐洲、亞洲、澳洲。所以是巴西與美國政府兩個區域還沒上:

Amazon VPC Endpoints for Amazon S3 are available now in the US East (Northern Virginia) (for access to the US Standard region), US West (Oregon), US West (Northern California), Europe (Ireland), Europe (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Singapore), and Asia Pacific (Sydney) regions.

這樣是解了不少問題,不過如果可以直接解決 NAT infrastructure 的問題應該會更痛快?

CloudFlare 對 Go 上面加解密系統的改善

CloudFlare 發佈了自己版本的 Go,修改了其中的 crypto subsystem:「Go crypto: bridging the performance gap」。

文章花了不少篇幅介紹 AEAD (Authenticated Encryption with Associated Data),而目前 CloudFlare 支援的是 AES-GCM 與 ChaCha20-Poly1305,也是兩大主流,分別佔了 60% 與 10% 的 HTTPS 流量:

As such today more than 60% of our client facing traffic is encrypted with AES-GCM, and about 10% is encrypted with ChaCha20-Poly1305.

CloudFlare 提供的改進使得速度快很多,並且有考慮到 side-channel attack 的問題:

Both implementations are constant-time and side-channel protected.

                         CloudFlare          Go 1.4.2        Speedup
AES-128-GCM           2,138.4 MB/sec          91.4 MB/sec     23.4X

P256 operations:
Base Multiply           26,249 ns/op        737,363 ns/op     28.1X
Multiply/ECDH comp     110,003 ns/op      1,995,365 ns/op     18.1X
Generate Key/ECDH gen   31,824 ns/op        753,174 ns/op     23.7X
ECDSA Sign              48,741 ns/op      1,015,006 ns/op     20.8X
ECDSA Verify           146,991 ns/op      3,086,282 ns/op     21.0X

RSA2048:
Sign                 3,733,747 ns/op      7,979,705 ns/op      2.1X
Sign 3-prime         1,973,009 ns/op      5,035,561 ns/op      2.6X

AES-GCM 與 EC 的改善主要是利用 CPU 指令集加速:

[T]herefore we created assembly implementations of Elliptic Curves and AES-GCM for Go on the amd64 architecture, supporting the AES and CLMUL NI to bring performance up to par with the OpenSSL implementation we use for Universal SSL.

不過 RSA 的部份雖然幅度也不小 (比起 AES 與 EC 的部份是不大,不過純就數字來看,快了一倍多也不少),不過沒提到怎麼改善,只稍微帶過:

In addition the fork includes small improvements to Go's RSA implementation.

Amazon 首次公佈 Amazon Web Services (AWS) 的財報資訊

在「Amazon Finally Discloses Cloud Services Sales, Showing 49% Jump」這篇提到 Amazon 首次在財報上公開 AWS 的營收資訊:

The first-ever disclosure of results from the Amazon Web Services division showed revenue increased 49 percent from a year earlier. AWS cranked out operating income of $265 million for Amazon, helping offset losses in other businesses. Net losses for the enlarged company came in at $57 million.

Amazon 的公開資訊可以參考「Amazon.com Announces First Quarter Sales up 15% to $22.72 Billion」這篇。可以看得出來到處在燒錢,但 AWS 本身是賺錢的...