MariaDB 12.3 對 InnoDB 的大改進

看到 Mark Callaghan 寫的「MariaDB innovation: binlog_storage_engine」、「MariaDB innovation: binlog_storage_engine, small server, Insert Benchmark」這篇,裡面提到了 MariaDB 12.3 (還沒 GA) 的 InnoDB 改了很底層的架構,從本來的 binlog + InnoDB 的架構整合到只有 InnoDB,連帶也降低了 fsync 呼叫的次數:

MariaDB 12.3 has a new feature enabled by the option binlog_storage_engine. When enabled it uses InnoDB instead of raw files to store the binlog. A big benefit from this is reducing the number of fsync calls per commit from 2 to 1 because it reduces the number of resource managers from 2 (binlog, InnoDB) to 1 (InnoDB).

這個是 MySQL InnoDB 架構上很久的問題,binlog 與 InnoDB 本身兩次的寫入會需要呼叫兩次 fsync,而 fsync 本身就有很高的 latency (需要等到 i/o 完成)。

Mark Callaghan 用手邊的機器測試發現,改進甚至比想像中的大,無論是 cpu bounded 或是 i/o bounded 的情況:

tl;dr for a CPU-bound workload

* Enabling sync on commit for InnoDB and the binlog has a large impact on throughput for the write-heavy steps -- l.i0, l.i1 and l.i2.
* When sync on commit is enabled, then also enabling the binlog_storage_engine is great for performance as throughput on the write-heavy steps is 1.75X larger for l.i0 (load) and 4X or more larger on the random write steps (l.i1, l.i2)

tl;dr for an IO-bound workload

* Enabling sync on commit for InnoDB and the binlog has a large impact on throughput for the write-heavy steps -- l.i0, l.i1 and l.i2. It also has a large impact on qp1000, which is the most write-heavy of the query+write steps.
* When sync on commit is enabled, then also enabling the binlog_storage_engine is great for performance as throughput on the write-heavy steps is 4.74X larger for l.i0 (load), 1.50X larger for l.i1 (random writes) and 2.99X larger for l.i2 (random writes)

如果在大台 server 上面也有類似的效果,這個有機會是 InnoDB 這十年來在寫入效能上最大的改進?上次應該是壓縮了...

Let's Encrypt 推出 DNS-PERSIST-01

Let's Encrypt 前天推出了 DNS-PERSIST-01 的認證方式:「DNS-PERSIST-01: A New Model for DNS-based Challenge Validation」。

跟本來 DNS-01 的方式最大的差異在於 DNS-01 在每次呼叫時都需要寫入 DNS record 的權限:

With DNS-01, the sensitive asset is DNS write access.

DNS-PERSIST-01 的方式變成直接授權給某些 Let's Encrypt 的帳號,像是這樣:

_validation-persist.example.com. IN TXT (
  "letsencrypt.org;"
  " accounturi=https://acme-v02.api.letsencrypt.org/acme/acct/1234567890"
)

就不需要寫回 DNS record 讓 Let's Encrypt 驗證了。

另外支援兩個重要的參數,一個是 wildcard:

_validation-persist.example.com. IN TXT (
  "letsencrypt.org;"
  " accounturi=https://acme-v02.api.letsencrypt.org/acme/acct/1234567890;"
  " policy=wildcard"
)

另外一個是 persistUntil:

_validation-persist.example.com. IN TXT (
  "letsencrypt.org;"
  " accounturi=https://acme-v02.api.letsencrypt.org/acme/acct/1234567890;"
  " persistUntil=1767225600"
)

這樣的確是比以前方便不少,接下來就是各家第三方 client 的支援了,甚至是讓 VaultOpenBao 這些工具支援?

Anthropic 推出 Claude Sonnet 4.6

先前有提到小道消息說 Anthropic 要出的 Claude Sonnet 5 (「小道消息說這個禮拜會出 Sonnet 5」) 看起來比較像是這次出的 Claude Sonnet 4.6:「Introducing Claude Sonnet 4.6」。

從 benchmark 的數字可以看到跟 Sonnet 4.5 比起來又成長一大截,是可以跟 Opus 4.5 對打的:

之前 Opus 4.5 已經算是很強了,升級到 Opus 4.6 我感覺還好 (就還是很強);剛剛用 Sonnet 4.6 寫了一些小東西感覺還行,重點是反應速度很快,這幾天剛好有個東西想要重寫,剛好可以測試大一點的東西。

而價錢上面跟之前的 Sonnet 4.5 一樣,所以就還是 Opus 系列的 60% 價錢:

For those on our Free and Pro plans, Claude Sonnet 4.6 is now the default model in claude.ai and Claude Cowork. Pricing remains the same as Sonnet 4.5, starting at $3/$15 per million tokens.

接下來的 Haiku 不曉得會不會也出 4.6?如果會的話好像也可以期待一下看看會成長到什麼程度...

Limelight Networks 與 Edgecast 在 2025 年的時候收掉了

剛剛找資料才發現的,先前 2022 年的時候 Limelight NetworksEdgecast 後改名為 Edgio:「今年三月的時候 Limelight Networks 買了 Edgecast,改名為 Edgio」。

2024 年的時候 Edgio 破產拍賣,Akamai 買了部分 Edgio 的合約與專利:「Bankruptcy Court Approves Winning Akamai Bid for Select Assets of Edgio」。

Delaware has approved its bid to acquire select assets from Edgio, including certain customer contracts from Edgio’s businesses in content delivery and security, and non-exclusive license rights to patents in Edgio's portfolio. The transaction does not include the acquisition of Edgio personnel, technology, or assets related to the Edgio network.

然後 Parler 則是買了 CDN 的基礎建設部分:「Parler Cloud Technologies Acquires Edgio’s EdgeCast Assets

Parler Cloud Technologies (PCT) acquired Edgio’s EdgeCast CDN assets across 25 global locations, expanding its data centers from 5 to 25 in 7 countries.

沒跟到這塊新聞,來補一下...

Debian 13 (trixie) + XFCE 上從 PulseAudio 換到 PipeWire

家裡的電腦的音效部分是透過 USB 接到 DAC 上面 (中間還有個 DDC,不過對 Linux 來說就是 USB audio),而不是直接用主機板上面的輸出,加上手上買的音檔大多都是 96KHz,所以習慣都把 PulseAudio 輸出成 96KHz,遇到 44.1KHz 或是 48KHz 的就讓 Pulse 自己 resampling 上去。

幾個月前把系統從 Ubuntu 22.04 換到 Debian 後 (一開始用 testing,後來維持 trixie),就遇到 PulseAudio 的 /etc/pulse/daemon.conf 內的 default-sample-rate 最高只能開到 48000 的問題,當時找資料的時候找到「No sound with pulseaudio after kernel 5.17.4+」這篇很像是類似的問題,但當時用了一些方法還是沒辦法避免。

剛剛突然想到可以問 AI 工具看看有什麼解法 (本來打算叫 Cluade Code 去看 Linux kernel & PulseAudio 了),結果在網頁上的 Claude 問一問他就推薦我用 PipeWire 了,而且看起來有相容層疊上去,另外問了他要怎麼強制 resampling 成 96KHz 也都很簡單就可以設定好了,換過去測了一些目前會有聲音的應用程式都沒問題,就換過去不用再管 PulseAudio 了。

看起來之後裝完 Xfce 後,要把預設用的 PulseAudio 都換成 PipeWire 了...

Linux 下用 bubblewrap (bwrap) 跑 Claude Code

避免 Claude Code 在全自動模式下 (--dangerously-skip-permissions) 爆炸的時候把一堆東西給弄炸,一般會用 container 環境包起來,不過在 Linux 下可以用 bubblewrap 這樣更清量的工具限制,調整了一陣子,算是穩下來了,我會包一個 ~/bin/claude-bwrap 白名單把需要的目錄掛進去:

#!/bin/bash
exec bwrap --unshare-all --share-net \
    --cap-drop ALL \
    --clearenv \
    --setenv COLORTERM "${COLORTERM}" \
    --setenv DISPLAY "${DISPLAY}" \
    --setenv EDITOR "${EDITOR}" \
    --setenv HOME "${HOME}" \
    --setenv LANG "${LANG}" \
    --setenv LANGUAGE "${LANGUAGE}" \
    --setenv PATH "${PATH}" \
    --setenv TERM "${TERM}" \
    --dev /dev \
    --proc /proc \
    --ro-bind /bin /bin \
    --ro-bind /etc/alternatives /etc/alternatives \
    --ro-bind /etc/hosts /etc/hosts \
    --ro-bind /etc/localtime /etc/localtime \
    --ro-bind /etc/resolv.conf /etc/resolv.conf \
    --ro-bind /etc/ssl /etc/ssl \
    --ro-bind /lib /lib \
    --ro-bind /lib32 /lib32 \
    --ro-bind /lib64 /lib64 \
    --ro-bind /usr /usr \
    --ro-bind /sbin /sbin \
    --tmpfs /run \
    --tmpfs /tmp \
    --tmpfs /var/tmp \
    --ro-bind ~/.local/share/mise ~/.local/share/mise \
    --ro-bind ~/.local/state/mise ~/.local/state/mise \
    --ro-bind ~/.vim ~/.vim \
    --bind-try ~/.claude.json ~/.claude.json \
    --bind-try ~/.claude ~/.claude \
    --bind-try ~/.claude-c1 ~/.claude-c1 \
    --bind-try ~/.claude-c2 ~/.claude-c2 \
    --bind-try "$(pwd)" "$(pwd)" \
    "$@"

基本的想法是用使用者權限跑 (而且要避免讓他變成 root 亂搞),然後網路讓你隨便連,但是不讓你碰到 credentials (像是 ~/.config 下面的東西)。

環境變數的部分:

  • COLORTERMTERM 是讓 TUI 程式的 rendering 正常。
  • DISPLAY 是針對 X11 的應用,讓我可以用 Ctrl-V 直接貼上圖片。(Claude Code 會去讀 clipboard)
  • HOMEPATH 是蠻多應用程式的 requirement,就帶進去。
  • LANGLANGUAGE 主要是要吃 UTF-8 設定 (我是習慣用 en_US.UTF-8),沒設定的話很多 C function 會用 POSIX 或是 ASCII 跑,會有問題。

目錄的部分就是把會用到的東西都 read-only 掛進去,然後讓他可以寫 ~/.claude.json~/.claude 與現在的目錄。

這邊比較特別的是 /etc 下的東西我不想全掛,所以就挑了有用到的東西進去,/etc/resolv.conf/etc/hosts 是各種 hostname 查詢用的,/etc/ssl 是各種 TLS 連線需要驗證用到的,/etc/localtime 讓 Claude Code 顯示正確的時區資訊。

另外一塊是我這邊用 mise,所以就把 mise 的目錄掛進去;同理我主要是用 Vim 系列的東西。

這種東西就是自己慢慢 tune 出適合自己用的版本...

維基百科上有條目在講 Gmail 的歷史

https://kottke.org/26/02/0048339-when-gmail-was-released-a 這邊看到當初是拿三百台都沒人想用的 Pentium III 跑的:

ran on three hundred old Pentium III computers nobody else at Google wanted

去找「History of Gmail」條目裡面可以看到這段:

Gmail ran on three hundred old Pentium III computers nobody else at Google wanted. This was sufficient for the limited beta rollout the company planned, which involved inviting about 1,000 opinion leaders and then allowing them to invite their friends and family members to become beta testers, with trials beginning on 21 March 2004.

當年的信箱都是 MB 在算的,10MB 算常見的,Google 當時在愚人節推出 1GB 大家以為是 april fools' joke,但到後來大家發現是真的,改變了整個 email 生態系:

After considering alternatives such as 100 MB, the company finally settled upon 1 GB of space, compared to the 2 to 4 MB that was the standard at the time.

記得當時因為太大,還有人開發用 Gmail 當作 storage 的功能... (還沒有 Google Drive 的年代)

Babylon 5 上 YouTube 了

看到「Babylon 5 Is Now Free to Watch On YouTube (via)」這個消息,這部影集也 30 年了 (1994 到 1998,共五季),當年也是得獎過很多次,剛好過年期間可以找時間來重溫了?

看起來是本來授權給 Tubi 的合約在到期後改放到 YouTube 上:

In a move that has delighted fans of classic science fiction, Warner Bros. Discovery has begun uploading full episodes of the iconic series Babylon 5 to YouTube, providing free access to the show just as it departs from the ad-supported streaming platform Tubi.

來看看英聽又退步多少...

AWS 的台北區 Local Zone 要廢除了 (ap-northeast-1-tpe-1a)

收到信件 AWS 要廢 ap-northeast-1-tpe-1a 了,畢竟 ap-east-2 的 region 都成立了:

[アクションが必要] AWS 台北 Local Zone (ap-northeast-1-tpe-1a) は 2027 年 3 月 2 日に廃止されます | [Action Required] AWS Taipei Local Zone (ap-northeast-1-tpe-1a) retirement March 2, 2027 [AWS Account: xxxxxxxxxxxx] [AP-NORTHEAST-1]

信件是日文 + 英文,大概是掛在東京區 (ap-northeast-1) 上面的關係,沒有中文... 主要的兩個時間點是明年 2027/02/02 開始就不能建立開的資源了,然後 2027/03/02 就會收掉:

* February 2, 2027: Creation of new resources will be disabled.
* March 2, 2027: Access to the “ap-northeast-1-tpe-1a” Local Zone will be disabled – and resources will no longer be able to run.

看起來是當初有在 local zone 開過機器才會收到...

Amazon EC2 instance 可以跑虛擬化了

Hacker News 上看到「AWS Adds support for nested virtualization (github.com/aws)」這個,從 AWS SDK 上看到 Amazon EC2 支援 nested virtualization 的消息:

* **Feature**: Launching nested virtualization. This feature allows you to run nested VMs inside virtual (non-bare metal) EC2 instances.

在官方的文件 run-instances 也出現了,目前 nested virtualization 只支援比較新的 instance:

Indicates whether to enable the instance for nested virtualization. Nested virtualization is supported only on 8th generation Intel-based instance types (c8i, m8i, r8i, and their flex variants). When nested virtualization is enabled, Virtual Secure Mode (VSM) is automatically disabled for the instance.

這代表 QEMU 之類的東西可以透過硬體加速了?