Merge lp://staging/~jderose/filestore/fadvise into lp://staging/filestore

Proposed by Jason Gerard DeRose
Status: Merged
Merged at revision: 268
Proposed branch: lp://staging/~jderose/filestore/fadvise
Merge into: lp://staging/filestore
Diff against target: 208 lines (+68/-24)
2 files modified
benchmark.py (+25/-22)
filestore.py (+43/-2)
To merge this branch: bzr merge lp://staging/~jderose/filestore/fadvise
Reviewer Review Type Date Requested Status
James Raymond Approve
Review via email: mp+132004@code.staging.launchpad.net

Description of the change

In the future we should experiment with POSIX_FADV_WILLNEED, but for now, this simple change provides an impressive performance improvement (almost 10%).

Changes:

 * When needed, monkey patch `os` module with dummy `os.posix_fadvise()`

 * reader() now calls on.posix_fadvise() with os.POSIX_FADV_SEQUENTIAL before starting read

 * batch_reader() now calls on.posix_fadvise() with os.POSIX_FADV_SEQUENTIAL before starting each read

 * batch_import_iter() now uses a queue size of 8 instead of 16 (meaning now at most 64 MiB will be in-flight in the queue, instead of 128 MiB)

 * reader() and batch_reader() now log.exception() when an exception is caught to make debugging easier

 * benchmark.py script now uses batch_import_iter(), other misc changes

To post a comment you must log in.
275. By Jason Gerard DeRose

Wow, with os.POSIX_FADV_WILLNEED, now I'm up to almost an 18% improvement, 31.2 MB/s

276. By Jason Gerard DeRose

Changed reader() to use os.POSIX_FADV_WILLNEED also

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Okay, I decided to undergo said experiment right now... and holy crap, fast.

Using os.POSIX_FADV_WILLNEED, I'm up to almost an 18% performance improvement.

31.2 MB/s over USB2, up from 26.5 MB/s.

There are a few things that need further tuning on the Dmedia side of things, but the filestore read performance is now pretty stellar (under Python3.3 anyway).

Revision history for this message
James Raymond (jamesmr) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches