|
|
Subscribe / Log in / New account

Optimizing Linux with cheap flash drives

Optimizing Linux with cheap flash drives

Posted Feb 21, 2011 19:44 UTC (Mon) by nix (subscriber, #2304)
In reply to: Optimizing Linux with cheap flash drives by Tara_Li
Parent article: Optimizing Linux with cheap flash drives

You won't be seeing slowdowns from writes unless a lot is being written or you are terribly short of memory, as they can always be cached and written back later. It's blocking for reads that's killing you.

The best way to speed up reads on current systems is probably to use RAID: add lots of disks and reads speed up enormously, given a fast enough bus (at a cost in write speed). e.g. my four-way RAID-5 here combines four fairly slow low-power disks to given an aggregate read speed between 190Mb/s and 250Mb/s. That knocks the socks off any single disk: even high-speed ones at the fast outer edge of the disk are slower than this RAID array is at the slow inside.

It might also be worth trying cachefs, caching onto a USB key (and not caching the filesystem on which your media files are located), but I'm not sure that this will actually gain you anything. (Worth trying though.)

If you turn off swap and the system is already short of memory performance will hit a wall, because all of a sudden rarely used but dirtied pages of non-file-backed memory *have* to be held in RAM, rather than being swapped to disk once and forgotten about. (glibc creates several hundred Kb of these for every program that might use locales, which pretty much means anything that calls printf(), i.e. everything). So all of a sudden your available memory plunges and lots of frequently-used but read-only pages of program text get forced out of memory, leading to major thrashing as they get pulled back off disk all the time. (So you will probably find iostat and/or blktrace reporting major *reads* in this situation, but not major *writes*.)


to post comments

Optimizing Linux with cheap flash drives

Posted Feb 21, 2011 21:58 UTC (Mon) by Tara_Li (guest, #26706) [Link] (1 responses)

How do you tell Linux not to cache a filesystem? I can't find it in mount options.

Optimizing Linux with cheap flash drives

Posted Feb 22, 2011 0:24 UTC (Tue) by nix (subscriber, #2304) [Link]

This isn't about the page cache. I was talking about FS-Cache, which is a separate filesystem layer which can be used to cache other filesystems on local media (such as, well, flash drives, or, more often, hard drives).

-- unfortunately it needs specific support for each filesystem, and it doesn't look like this has been added for any non-networked filesystems. Curses.

(See Documentation/filesystems/caching/.)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds