IPv4 的價錢

Hacker News 首頁上看到「IPv4 pricing (hetzner.com)」這篇,裡面的連結「IPv4 pricing」是 Hetzner 這個 hosting 通知 IPv4 將在八月漲價的資料...

可以看到「/24 IP subnet (254 usable IPs)」這組的價錢從「€ 215.13 / € 0 setup」漲到「€ 435.20 / € 4864.00 setup」,看起來是趁機漲了不少 setup fee 來綁使用者。

Hacker News 的討論裡面有提到 e-mail 的應用上還是得用 IPv4,至少 Microsoft 還是不愛 IPv6:

I remember while trying to figure out why Microsoft was blocking emails that IPv6 SMTP source addresses had a much higher risk of being blocked despite having done all the required stuff like PTR, SPF, DKIM. Microsoft's form to submit delisting an IP address does not even accept an IPv6 address: https://sender.office.com/

Stuff like this really hinders adoption.

hmmm,e-mail 的確是痛點 (尤其是 reputation 問題),但其他大多數的應用好像還好?

AWS 宣佈 EC2-Classic 退役的計畫

AWS 宣佈了歷史悠久的 EC2-Classic 的退役計畫:「EC2-Classic is Retiring – Here’s How to Prepare」。

EC2-Classic 是 VPC 出來之前的產物,後來出現 VPC 的設計讓整個網路架構更有彈性,而且後來的新機種也都出在 VPC 上,EC2-Classic 算是歷史產物。

目前宣佈的幾個時間點,首先是 2013 年年底的帳號已經是 VPC-only,除非有另外開 support ticket 要求要有 EC2-Classic:

All AWS accounts created after December 4, 2013 are already VPC-only, unless EC2-Classic was enabled as a result of a support request.

接下來是今年的十月底,如果 AWS 帳號沒有使用 EC2-Classic 就會自動關閉 EC2-Classic 的權限,另外也會停止販售 EC2-Classic 的 RI:

On October 30, 2021 we will disable EC2-Classic in Regions for AWS accounts that have no active EC2-Classic resources in the Region, as listed below. We will also stop selling 1-year and 3-year Reserved Instances for EC2-Classic.

最後會希望在 2022 年八月中的時候全部轉移完:

On August 15, 2022 we expect all migrations to be complete, with no remaining EC2-Classic resources present in any AWS account.

看起來沒用完的 RI 會退錢?

Cloudflare 開始在正式環境用 ARM server 了

在「Designing Edge Servers with Arm CPUs to Deliver 57% More Performance Per Watt」這邊 Cloudflare 提到了他們在正式環境用 ARM 架構了:

Our first Arm CPU was deployed in production earlier this month — July 2021.

記得測了很多年,其中遇到測試到一半看起來還不錯,但原廠商決定不繼續做的,直到後來又有廠商投入,到現在總算是有比較成熟的產品可以用。

隔壁棚 AWS 上的 ARM 伺服器用起來也是香到不行,還沒有用過的可以試看看,至少我這台 blog & wiki 也都是跑在上面。

另外文章裡有提到目前 x86 的效能,新一代的 AMD 大概只比前一代多了 39% 的每瓦效能,但如果是把 ARM 拿進來比的話會到 57%:

Our most recently deployed generation of edge servers, Gen X, used AMD Rome CPUs. Compared with that, the newest Arm based CPUs process an incredible 57% more Internet requests per watt. While AMD has a sequel, Milan (and which Cloudflare will also be deploying), it doesn’t achieve the same degree of energy efficiency that the Arm processor does — managing only 39% more requests per watt than Rome CPUs in our existing fleet.

開始推上 production 後應該會愈換愈快,而且代表 Cloudflare 也會開始針對 ARM 平台最佳化。

Amazon VPC 允許直接把整個網段配到某台 EC2 Instance 上了

看到「Amazon Virtual Private Cloud (VPC) customers can now assign IP prefixes to their EC2 instances」這邊的消息,VPC 可以把整個網段配到某台 EC2 Instance 上了。

之前也有其他方法可以做到類似的事情:

  • 用 VPC 提供的 Routing Table 把網段指到某台 EC2 的機器上。
  • 把這台 EC2 機器的「Enable Source/Destination Check」關閉。

目前就是用這個方法搞定 VPN server 的:我們希望機器連上 VPN 後拿到 10.x.x.x 的 IP address,而且可以被 VPC 內直接存取,而不要被 NAT 掉。

好像該開張票轉移過去...

LaTeX 的字型展示

Hacker News 首頁上看到「The LaTeX Font Catalogue (tug.org)」這個,提到 LaTeX 的字型:「The LaTeX Font Catalogue – Front Page」。

在 Hacker News 上的討論有人提到 LaTeX 的字型印出來很好看,但電腦上看就還好 (不差),這點我還蠻認同的,在螢幕上有其他更好看的字型可以用。

就目前看過的書籍來說,TeX 預設的字型 (Computer Modern 系列) 印出來真的超漂亮的,像是 Knuth 老大的 TAOCP

話說 Knuth 老大的 TAOCP... (說好不提 261?)

Facebook 把自家的 MySQL 升級到 8.0

Facebook Engineering 發了一篇將 MySQL 升級到 8.0 的說明:「Migrating Facebook to MySQL 8.0」。

先前的版本主要是 5.6,加上 MyRocks

Our last major version upgrade, to MySQL 5.6, took more than a year to roll out. When version 5.7 was released, we were still in the midst of developing our LSM-Tree storage engine, MyRocks, on version 5.6. Since upgrading to 5.7 while simultaneously building a new storage engine would have significantly slowed the progress on MyRocks, we opted to stay with 5.6 until MyRocks was complete. MySQL 8.0 was announced as we were finishing the rollout of MyRocks to our user database (UDB) service tier.

GitHub 上是有 facebook/mysql-8.0,但看起來從 2017 後就沒更新了,所以應該是沒有 open source 出來。

看看就好 XD

Cloudflare 在巴西的佈點

看到 Cloudflare 在講他們打算在巴西佈 25 個點:「Expanding Cloudflare to 25+ Cities in Brazil」,目前可以看出來是八個點:

比較了領土的大小,跟美國扣掉阿拉斯加差不多等級:

人口的話美國是 328M 左右 (阿拉斯加不到 1M,不太影響感覺),巴西 215M,依照 Cloudflare 在美國目前有 39 個 PoP 來說,的確是可以拉上去,不過看起來應該是因為有大的 ISP 合作的關係:

Today, we are excited to announce an expansion we’ve been working on behind the scenes for the last two years: a 25+ city partnership with one of the largest ISPs in Brazil.

不過沒提到是哪個 ISP,之後看看有沒有消息...

AWS 宣佈 EBS io2 的新花樣 Block Express Volumes

看到「AWS Announces General Availability of Amazon EBS io2 Block Express Volumes」這篇,在 EBSio2 上面又推出了新的花樣 Block Express Volumes:

Today AWS announced general availability of io2 Block Express volumes that deliver up to 4x higher throughput, IOPS, and capacity than io2 volumes, and are designed to deliver sub-millisecond latency and 99.999% durability.

要再提供更高的效能,在 R5b 的機種下,單個 volume 可以拉到 256k IOPS 與 4000MB/sec 的傳輸速度,以及在 well-tuned 的環境下 (應該是多個 volume) 可以拉到 260k IOPS (多一點點) 與 7500MB/sec (將近原來的兩倍) 的傳輸速度:

Using R5b instances customers can now provision a single io2 volume with up to 256,000 IOPS, 4000 MB/s of throughput, and storage capacity of 64 TiB.

R5b instances are well-suited to run business-critical and storage-intensive applications as they offer the highest EBS-optimized performance of up to 260,000 IOPS and 7,500 MB/s throughput.

是個用錢炸效能的東西,用的到的就用...

快速產生 SQLite 資料的方式:一分鐘內產生十億筆資料

在「Towards Inserting One Billion Rows in SQLite Under A Minute」這邊看到作者想要在一分鐘內在 MBP 2019 上面寫 1B 筆資料進 SQLite,裡面有些方法還蠻值得玩一下的,這台 MBP 2019 機器的規格是:

The machine I am using is MacBook Pro, 2019 (2.4 GHz Quad Core i5, 8GB, 256GB SSD, Big Sur 11.1)

第一版是 Python 寫的,塞 10M 筆花了 15 分鐘:

In this script, I tried to insert 10M rows, one by one, in a for loop. This version took close to 15 minutes, sparked my curiosity and made me explore further to reduce the time.

加了五個 PRAGMA 的版本變成 100M 筆十分鐘:

The naive for loop version took about 10 minutes to insert 100M rows.

用批次處理則可以降到八分半:

The batched version took about 8.5 minutes to insert 100M rows.

再來是拿經典神器 PyPy 出來用,降到兩分半:

All I had to do was run my existing code, without any change, using PyPy. It worked and the speed bump was phenomenal. The batched version took only 2.5 minutes to insert 100M rows. I got close to 3.5x speed :)

接下來就是跳槽到 Rust 了,中間也有不少 tuning 相關的討論,但直接先跳到最後面好了... 最後 100M 只用了 33 秒:

I created a threaded version, where I had one writer thread that received data from a channel and four other threads which pushed data to the channel. This is the current best version which took about 32.37 seconds.

能用 PyPy 的地方還是可以考慮一下的...

在 ESP32 跑 Linux 作業系統

Hacker News 首頁上看到在有中國的開發者在 ESP32 上跑 Linux 作業系統:「Linux 5.0 shown to boot on ESP32 processor」,對應的討論在「Linux 5.0 shown to boot on ESP32 processor (cnx-software.com)」這邊可以看到。

文章最後面有提到這不是第一次在 ESP32 上跑 Linux:

Note it’s not the first time somebody runs Linux on ESP32, as last year the older Ubuntu 9.04 was demonstrated on ESP32.

看起來應該是作者覺得很有趣,所以還是提出來... 機器是 8MB PSRAM 與 2MB SPI flash:

ESP32 IoT processor supports up to 8MB PSRAM which makes it just enough to run a minimal version of Linux. There’s little practical application for it, but it may be fun to try, and one developer apparently managed to boot Linux 5.0.0 on a board with an ESP32 dual-core Xtensa processor connected to 8MB PSRAM and a 2MB SPI flash.

如果以 8MB RAM 來推算的話,大概是 i386 (80386) 到 i486 (80486) 時代的電腦?不過 ESP32 的 CPU 時脈快不少 (雖然架構不同不太能直接比較)。