ext3/ext4とプリアロケートの話
Posted: April 27, 2012 Filed under: tech | Tags: ext3, ext4, fs, linux, mongodb, xfs 1 CommentMongoDBをext3とext4でベンチマークしてみたらext4が圧勝だった
あたりに関連する話。(ちなみに筆者の環境ではext3でMongoDBを動かしてしまっているため、悲しいことにファイルのアロケーションが起こる度に実質MongoDBがフリーズするような状態になるが、まぁ、だましだまし運用している状態)
ext3について、プリアロケートに時間がかかるというのは、必ずしも悪い話ではない。zeroで上書きしているため、ファイルシステム上に(大きな)ファイルが断片化せずに生成されることを保証してくれることに繋がるからだ。
VMware Serverのsparseファイルのせいでひどい目にあったことがあるので、そう感じた。
ext4(とxfs)は非常に早くこのプリアロケートが終わるということで、将来的に断片化を起こしてパフォーマンスがひどいことになるんじゃないの?と感じたが、Wikipediaのext4の項目を見ると
Persistent pre-allocation
ext4 can pre-allocate on-disk space for a file. To do this on most file systems, you would write zeros to the file when you create it. In ext4 (and some other files systems, such as XFS), you can use fallocate(), a new system call in the Linux kernel. The allocated space would be guaranteed and likely contiguous. This situation has applications for media streaming and databases.
ということで、断片化せず、ほぼ隣接する(likely contiguous)領域で高速なプリアロケートを実現しているとのこと。素晴らしい…
結論: MongoDBではext4かxfsを使うベシ
MonjaDB (MongoDB GUI client tool)リリースしました
Posted: April 14, 2012 Filed under: tech | Tags: eclipse, java, mongodb Leave a comment去年末からコツコツ作り始めたMongoDB用クライアント、MonjaDBをとりあえずリリースしました。
MonjaDB
Recent Comments