既有的 VPC 可以增加更多 subnet 了

既有的 Amazon VPC 可以增加更多的 subnet 了:「Amazon Virtual Private Cloud (VPC) now allows customers to expand their existing VPCs」。

Amazon Virtual Private Cloud (VPC) now allows customers to expand their VPCs by adding secondary IPv4 address ranges (CIDRs) to their VPCs.

除了中國與 GovCloud 以外都支援了:

There is no additional charge to use this feature. This feature is available in all AWS regions except GovCloud and AWS China (Beijing) regions.

這樣就不用另外開一個 VPC 再用 peering 的方式打通...

Laravel 5.5 釋出,第二個 LTS 版本

Laravel 推出第二個 LTS 版本,5.5 版:「Laravel 5.5 LTS is Now Released」。

當初 Taylor Otwell 對 LTS 還蠻感冒的 (參考去年的 tweet),居然推出了...

有 LTS 對於商業應用的維護來說還是方便不少... 大概是考慮到這個原因,所以還是推出了 :o

Google Cloud Platform 的網路推出 Standard Tier 了

Google Cloud Platform (GCP) 的網路總算是推出 Standard Tier 了:「Introducing Network Service Tiers: Your cloud network, your way」。

之前 GCP 上的網路只有 Premium Tier,也就是封包從 GCP 的平台出來後一定要透過 Google 自己的網路,到離使用者最近的點後再送到使用者的電腦上... 這樣的好處是 Google 保證他們有很多備援線路,而且也確保 latency 夠低,但缺點就是服務提供者得付這些費用...

這次推出的 Standard Tier 就像其他雲端平台的作法,在 GCP 機房當地就跟網路業者交換,之後透過 Internet 傳到使用者的電腦上,這樣就會比較便宜:

With the new Network Tiers pricing (effective at GA), outbound traffic (GCP to internet) is priced 24-33% lower in Standard Tier than in Premium Tier for North America and Europe.

像是「其實我根本不在意美國以外的使用者」時,機房建在美國,但不會想要付 Premium Tier 的網路費用...

React 的專利授權議題

ASF (Apache Software Foundation) 全面禁止 Facebook 的 BSD+PATENTS 後 (「Apache Foundation 宣佈禁止使用 Facebook BSD+Patents 的軟體」),整件事情開始熱起來了...

簡單來說,Facebook 有意為之,而且不打算撤回這個有攻擊性的授權模式,參考「Explaining React's license」這邊官方的說明以及有人寫了一篇解讀:「If you’re a startup, you should not use React (reflecting on the BSD + patents license)」。

Facebook 內的意見其實也不一樣,像是 Yarn 之所以沒有 PATENTS 是因為爭取出來的:

接下來應該會有更多爭議討論了...

V8 對 Hash Flooding 的防禦措施

Hash Flooding 問題是指 Hash 這個資料結構是可以被預測 collision 所造成的問題,在隨機的情況下會是 O(1) 的操作,在特定挑選故意讓他 collision 而變成 O(n),當有 n 個元素時,乘起來就會變成 O(n^2)。這算是一種阻斷攻擊 (DoS attack)。

在「About that hash flooding vulnerability in Node.js...」這邊提到了 V8 之前為了避免 Hash Flooding 的問題,關掉了 Startup snapshot 而造成的效能問題,以及後續的很多故事,最後找了長期的解法。

這個解法已經併入 Node.js 裡,預定下個包括的版本是 8.3.0:

The patch to re-enable startup snapshot has been merged into Node.js. It is part of the recent Node.js v8.3.0 release.

不過這表示現有的 LTS (4.8.4 以及 6.11.2) 還是... XD

C++ 與組語的速度...

Hacker News Daily 上看到「Why is this C++ code faster than my hand-written assembly for testing the Collatz conjecture?」覺得很有趣...

作者寫了一段 assembly,但跑起來比用 C++ 同義的版本慢多了。目前最高分的答案給了很清楚的解釋...

even:
    mov rbx, 2
    xor rdx, rdx
    div rbx

上面這段 code 是作者寫的組語版本,用到 div 指令,這是非常慢的指令:

On Intel Haswell, div r64 is 36 uops, with a latency of 32-96 cycles, and a throughput of one per 21-74 cycles.

相較於 C++ 的版本,用到的是 shr (logical shift right,以位元方式往右平移,最高位補零),速度快太多:

shr rax, 1 does the same unsigned division: It's 1 uop, with 1c latency, and can run 2 per clock cycle.

這是用到無號整數透過 shr 平移一格剛好是除以二的特性,因為速度的關係,這個用法到現在還是很常被拿來用,但對於平常沒在寫 assembly 的人就會有上面的誤解 XDDD

PS4 下載速度很慢的原因

在「Why PS4 downloads are so slow」這篇作者花了不少力氣找出原因,發現 PS4 下載速度很慢是故意的... 另外討論了在什麼情況下會變慢,以及要怎麼避免的方式。

懶得看的人可以直接看 Conculsions 那段,主要的原因是 PS4 會因為背景程式而調整 TCP window size (就算背景程式在 idle 也會影響到下載的 TCP window size),進而影響速度:

If any applications are running, the PS4 appears to change the settings for PSN store downloads, artificially restricting their speed. Closing the other applications will remove the limit.

用 TCP window size 來調整速度也算是頗有「創意」的方法...

Anyway,遇到時的解決方法就是把所有在跑的程式都完整關掉,再下載就會正常多了...

Amazon 的 SES 推出 Dedicated IP Pool

Amazon SES 推出了 Dedicated IP Pool:「New – SES Dedicated IP Pools」,也就是發信時可以使用自己專屬的 IP address。

Today we released Dedicated IP Pools for Amazon Simple Email Service (SES). With dedicated IP pools, you can specify which dedicated IP addresses to use for sending different types of email.

價錢其實不算貴?每個 IP 的費用是 USD$24.95/month,對於量夠大的單位可以避免被其他人影響:

Dedicated IPs are $24.95 per address per month at the time of this writing – but you can find out more at the pricing page.

不過 SES 用起來最痛的問題還是在對於收信人不存在時的 bounce rate...

AWS 提供要回放掉的 Elastic IP 的功能

Twitter 上看到 AWS 可以要回放掉的 Elastic IP 了。當然,這不保證會成功:

文件在「Recovering an Elastic IP Address」這邊,目前只支援 API 以及對應的 command line 工具:

Currently, you can recover an Elastic IP address using the Amazon EC2 API or a command line tool only.

指令像這樣:

aws ec2 allocate-address --domain vpc --address 203.0.113.3

透過 AWS Budgets 管控 Reserved Instance 的使用率

現在可以透過 AWS Budgets 來看到 Reserved Instance 的使用率了:「Monitor your Reserved Instance utilization by receiving alerts via AWS Budgets」。

Starting today, customers can now monitor and receive alerts when their Reserved Instance (“RI”) utilization falls below the threshold they define.

算是個開頭,不過我更想請 AWS 分析有哪些機器是長年開著沒有 discount 的... 或者像是 GCP 那樣自動算 :o