このスレッドでは、メッセージストリーミングプラットフォームである Apache Iggyが、0.6.0のリリースに合わせてTokioからcompioへと移行したことについて語られています。このことについて、Iggy 0.6.0のリリースポスト では以下のようにまとめられています。
The most significant change in 0.6.0 is the complete server rewrite using io_uring with a thread-per-core, shared-nothing architecture. This represents a fundamental shift from the previous Tokio-based poll model to a completion-based async runtime using compio.
Key aspects of this architectural change:
・Completion-based I/O - unlike poll-based models, io_uring uses completion queues where the kernel notifies when operations finish
・Thread-per-core design - each CPU core runs its own event loop with dedicated resources, eliminating cross-thread synchronization overhead
・Shared-nothing model - data is partitioned across cores to minimize contention and cache invalidation
和訳:
0.6.0で最も大きな変更点は、io_uring を使用したサーバーの完全な書き換えです。これは thread-per-core、shared-nothing architecture を採用しています。以前のTokioベースのポーリングモデルから、compio を使用した完了ベースの非同期ランタイムへと根本的に転換しました。
このアーキテクチャ変更の主なポイント:
・完了ベースI/O - ポーリングベースのモデルとは異なり、io_uring は完了キューを使用し、カーネルが操作の完了を通知
・ thread-per-core設計 - 各CPUコアは専用のリソースを持つ独自のイベントループを実行し、スレッド間の同期オーバーヘッドを排除
・shared-nothingモデル - 競合やキャッシュの無効化を最小限に抑えるために、データはコアごとに分割して配置
デファクトスタンダードであるTokioから新進気鋭のcompioへの移行ということで、かなり野心的な試みに思えます。なぜそのような決定に至ったのかを、Redditのスレッドを参照しながらTokioとcompioのアーキテクチャの違いに着目して見ていきたいと思います。