performance improvements #342

Merged
lx merged 21 commits from lx-perf-improvements into main 2022-09-12 14:38:44 +00:00
Owner

Performance improvements included in this PR:

  • Use Bytes at a few places where appropriate, instead of Vec<u8>, to reduce the number of copies
    • StreamChunker now accumulates incoming slices in a Vec<Bytes> instead of a VecDeque<u8>. Replaces calls to .extend() and .drain() that were quite costly by a simple concat() on a vec of slices which is much more optimized
  • Hashing (b2, sha256, md5) is now done on a Tokio thread dedicated to cpu-intensive tasks, using spawn_blocking
  • Block manager now uses 256 independant locks instead of one big lock for writing, reduces contention when writing several/many objects in parallel
  • Better LMDB defaults: we now put flags NoSync and NoMetaSync to avoid fsync at each transaction (extremely slow). Also increased number of LMDB readers to accomodate more intensive workloads

Other changes included in this PR:

  • Update to hashing and MAC crates: md5 and sha2 from 0.9 to 0.10, hmac from 0.10 to 0.12
  • switch to tracing_subscriber for logs, which allows to have timing of each event
Performance improvements included in this PR: - [x] Use `Bytes` at a few places where appropriate, instead of `Vec<u8>`, to reduce the number of copies - [x] StreamChunker now accumulates incoming slices in a `Vec<Bytes>` instead of a `VecDeque<u8>`. Replaces calls to `.extend()` and `.drain()` that were quite costly by a simple `concat()` on a vec of slices which is much more optimized - [x] Hashing (b2, sha256, md5) is now done on a Tokio thread dedicated to cpu-intensive tasks, using `spawn_blocking` - [x] Block manager now uses 256 independant locks instead of one big lock for writing, reduces contention when writing several/many objects in parallel - [x] Better LMDB defaults: we now put flags `NoSync` and `NoMetaSync` to avoid `fsync` at each transaction (extremely slow). Also increased number of LMDB readers to accomodate more intensive workloads Other changes included in this PR: - [x] Update to hashing and MAC crates: md5 and sha2 from 0.9 to 0.10, hmac from 0.10 to 0.12 - [x] switch to `tracing_subscriber` for logs, which allows to have timing of each event
lx added 17 commits 2022-07-29 10:24:54 +00:00
Run clippy in nix, leveraging nix caching ability
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
fcb04843f7
Migrate to nix-daemon builders
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
a184f0d0b5
- reduce contention on mutation_lock by having 256 of them
- better lmdb defaults
fix clippy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
16f6a1a65d
lx force-pushed lx-perf-improvements from 1b3df6017d to ebc20a8798 2022-08-29 14:44:21 +00:00 Compare
lx added 1 commit 2022-08-29 14:48:38 +00:00
Update drone signature
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
continuous-integration/drone Build is passing
4da67b0035
lx added 1 commit 2022-08-31 12:24:54 +00:00
Replace logging crate pretty_env_logger by tracing_subscriber::fmt
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
dd5304f6fc
lx added 1 commit 2022-08-31 12:28:28 +00:00
Tracing-subscriber: write to stderr
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
44cd98d2e4
lx added 1 commit 2022-08-31 12:43:37 +00:00
Add env filter to tracing subscriber
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
efbca67ce4
lx added 1 commit 2022-08-31 15:42:11 +00:00
update cargo.nix
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
eb97e13a6a
lx added 1 commit 2022-09-02 12:33:23 +00:00
Update to netapp 0.4.5 - fixed ping
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
6226f5ceca
lx added 1 commit 2022-09-05 10:40:26 +00:00
Merge branch 'main' into lx-perf-improvements
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
07e6bcde85
lx added 1 commit 2022-09-06 19:53:47 +00:00
Merge branch 'main' into lx-perf-improvements
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
d23b3a14fc
lx added 1 commit 2022-09-08 13:49:26 +00:00
Merge branch 'main' into lx-perf-improvements
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
d9d199a6c9
lx changed title from WIP: performance improvements to performance improvements 2022-09-12 14:14:57 +00:00
lx added 1 commit 2022-09-12 14:24:05 +00:00
Simplify+improve async hasher by using bounded channel
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
f91fab8582
lx merged commit 309d7aef3f into main 2022-09-12 14:38:44 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#342
No description provided.