A Scalable, User-Friendly Source Control System.
Go to file
Thomas Orozco 1c6ca01a25 mononoke/filestore: make writes fast
Summary:
This updates the Filestore to make writes faster by farming out all hashing to
separate Tokio tasks. This lets us increase throughput of the Filestore
substantially, since we're no longer limited by the ability of a single core to
hash data.

On my dev server, when running on a 1MB file, this lets us improve the
throughput of the Filestore for writes from 36.50 MB/s (0.29 Gb/s) to 152.61
MB/s (1.19 Gb/s) when using a chunk size of 1MB and a concurrency level of 10
(i.e. 10 concurrent chunk uploads).

Note that the chunk size has a fairly limited impact on performance (e.g.
making 10KB instead has a <10% impact on performance).

Of course, this doesn't reflect performance when uploading to a remote
blobstore, but note that we can tune that by tweaking our upload concurrency
(making uploads faster at the expense of more memory).

 ---

Note that as part of this change, I updated the implementation away from stream
splitting, and into an implementation that fans out to Sinks. I actually had
implementation of a higher-performance filestore for both, but went with this
approach because it doesn't require the incoming Stream to be Send (and I have
a forthcoming diff to make the whole Filestore not require a Send input), which
will be useful when incorporating with the API Server, which unfortunately does
not provide us with a Send input.

Reviewed By: aslpavel

Differential Revision: D16560769

fbshipit-source-id: b2e414ea3b47cc4db17f82d982618bbd837f93a9
2019-07-31 05:19:42 -07:00
apiserver mononoke/apiserver: make DownloadLargeFile a streaming response 2019-07-31 05:19:41 -07:00
async-compression Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
asyncmemo Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
benchmark mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
blobimport_lib/src mononoke/blobimport: support LFS filenodes 2019-07-31 05:19:41 -07:00
blobrepo mononoke/blobimport: support LFS filenodes 2019-07-31 05:19:41 -07:00
blobrepo_utils mononoke: remove Logger from BlobRepo 2019-07-17 08:31:56 -07:00
blobstore mononoke/filestore: rebuild metadata on read 2019-07-31 05:19:38 -07:00
blobstore_sync_queue mononoke: 1.3x speed improvement for populate_healer job 2019-07-18 05:07:08 -07:00
bonsai_hg_mapping mononoke: Change stats prefix 2019-07-18 06:23:00 -07:00
bonsai_utils Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
bookmarks rust: Head start on some upcoming warnings 2019-07-12 00:56:44 -07:00
bundle2_resolver mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
bytes-ext rust/thrift: Remove dependency of thrift runtime on folly 2019-07-12 18:09:34 -07:00
cache_warmup/src add more traces 2019-06-17 05:13:11 -07:00
changesets rust: Head start on some upcoming warnings 2019-07-12 00:56:44 -07:00
cmdlib/src mononoke: hoist up to_string() calls 2019-07-17 12:57:42 -07:00
cmds mononoke/filestore: default to no chunking 2019-07-31 05:19:42 -07:00
common mononoke: avoid combinatoric explosion in derived_data framework 2019-07-24 11:55:34 -07:00
derived_data/src mononoke: avoid combinatoric explosion in derived_data framework 2019-07-24 11:55:34 -07:00
failure_ext Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
filenodes sql: do not use shard_id in fb303 counter names 2019-07-19 06:30:40 -07:00
filestore/src mononoke/filestore: make writes fast 2019-07-31 05:19:42 -07:00
futures-ext mononoke/filestore: verify hashes before committing a store 2019-07-31 05:19:37 -07:00
hgcli Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
hgproto Log clienttelemetry data (correlator, hostname, short command) 2019-07-26 03:41:24 -07:00
hook_tailer mononoke: remove Logger from BlobRepo 2019-07-17 08:31:56 -07:00
hooks mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
manifest mononoke: move typed fetch to Blobstore Trait 2019-07-31 05:19:36 -07:00
mercurial mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
mercurial_bundles tp2/rust: add lettre and riker to rust-crates-io 2019-07-24 20:04:48 -07:00
mercurial_types mononoke: UploadHgFileContents: don't buffer contents to compute a Filenode ID 2019-07-31 05:19:40 -07:00
metaconfig mononoke: hoist up to_string() calls 2019-07-17 12:57:42 -07:00
mononoke_api/src remove inefficient find_path_in_manifest 2019-06-19 09:33:50 -07:00
mononoke_types mononoke/blobimport: support LFS filenodes 2019-07-31 05:19:41 -07:00
netstring rust: Remove extern crate from common/rust 2019-07-10 11:58:48 -07:00
phases mononoke: remove Logger from BlobRepo 2019-07-17 08:31:56 -07:00
py_tar_utils move tar_utils.py from update_rust into an open sourceable location 2017-09-14 13:52:23 -07:00
reachabilityindex mononoke: improve memory usage on mononoke startup and reduce number of small allocations 2019-07-19 04:30:26 -07:00
ready_state/src Apply rustfmt to all rust files 2019-07-10 19:36:32 -07:00
repo_client mononoke/filestore: incorporate in Mononoke 2019-07-31 05:19:40 -07:00
revset mononoke: replace Box::new with boxify() 2019-07-19 01:49:52 -07:00
server mononoke: add a few more logs 2019-07-24 11:06:14 -07:00
sshrelay Transition fbcode Rust crates to 2018 edition 2019-06-24 13:15:17 -07:00
tests mononoke/blobimport: support LFS filenodes 2019-07-31 05:19:41 -07:00
.gitignore add .gitignore 2018-03-13 11:58:20 -07:00
.rlsconfig mononoke: add a .rlsconfig 2019-07-04 02:00:09 -07:00
.travis.yml Add travis-CI integration by adding .travis.yml file. 2018-07-26 10:09:32 -07:00
Cargo.toml mononoke: rename crates to contain underscores instead of dashes 2019-03-06 07:18:28 -08:00
CONTRIBUTING.md Initial commit 2017-07-27 18:00:19 -07:00
LICENSE Initial commit 2017-07-27 18:00:19 -07:00
packman.yml mononoke: add mononoke_exec helper script 2019-06-14 03:59:58 -07:00
README.md mononoke: simple useless change 2019-05-21 12:25:10 -07:00
rustfmt.toml provide edition in .rustfmt.toml 2019-05-29 19:55:37 -07:00

Mononoke

Mononoke is a next-generation server for the Mercurial source control system, meant to scale up to accepting thousands of commits every hour across millions of files. It is primarily written in the Rust programming language.

Caveat Emptor

Mononoke is still in early stages of development. We are making it available now because we plan to start making references to it from our other open source projects such as Eden.

The version that we provide on GitHub does not build yet.

This is because the code is exported verbatim from an internal repository at Facebook, and not all of the scaffolding from our internal repository can be easily extracted. The key areas where we need to shore things up are:

  • Full support for a standard cargo build.
  • Open source replacements for Facebook-internal services (blob store, logging etc).

The current goal is to get Mononoke working on Linux. Other Unix-like OSes may be supported in the future