Portál AbcLinuxu, 30. dubna 2025 10:20
Phoronix upozorňuje na projekt Flashcache. Tento jaderný modul vyvinutý firmou Facebook a uvolněný jako FOSS v roce 2010 poskytuje blokovou cache pro zrychlení čtení a zápisů z pomalejších zařízení ve třech režimech: writeback, writethrough a writearound. Pro více informací vizte dokumentaci.
Tiskni
Sdílej:
Flashcache od Facebooku je ve světě už nějakou dobu. Uvidíme, jak se popere s bcache (by Kent Overstreet):
Flashcache uses hashing, it's a fairly straightforward simple design, from what I've seen. The trouble with hashing is that new entries will be scattered at random throughout the entire hash - if you're index is 50 mb, that means you're going to be writing at random throughout that 50 mb. SSDs are interently weak at random writes.
Bcache is a much more complex design, around 3x as many lines of code as flashcache. It uses a hybrid btree/log (the btree nodes themselves are logs) in order to never do random writes. Btrees also store keys in sorted order - it preserves spatial locality in index updates. In practice, index updates will often go to the same bucket, thus allowing them to be written out together.
Basically, Bcache spares no expense in order to do IO as efficiently as possible, and thus performance should ultimately be higher. The most recent benchmarks have it beating Flashcache at MySQL, and not by a small margin - which is what Flashcache was written for. There's still plenty of work to do on performance, too.
Zatím je ale bcache ještě dost zanořena do návrhové fáze, věci jako "kam umístit kód", "jak řešit rozhraní s uživatelem", apod.
Protože pak by ext měl svoji implementace, btrfs svoji, reiserfs taky svoji, jfs (dle mých zkušeností nejlepší pro DB) také svoji implementaci, .....
To je podobné asi jako "proč na kernelu nedělají vývojáři desktopových prostředí - kernel musí odhadovat, se kterou aplikací uživatel zrovna pracuje".
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.