mirror of
https://github.com/narrrl/proton-drive-linux.git
synced 2026-11-03 16:41:26 +01:00
perf(fuse): drain with 16 workers, and wake the idle ones when an op lands
This commit is contained in:
1 parent
dbc4d9a8c5
commit
16fca10e6c
5 files changed
+29
-11
No files matched your search
@@ -363,10 +363,15 @@ impl Core {
|
||||
}
|
||||
// The access check let this attempt through, so any earlier run of
|
||||
// deferrals is over and must not be counted against the next one.
|
||||
if matches!(outcome, Ok(DrainDisposition::Applied))
|
||||
&& let Err(error) = self.db.clear_op_access_deferral(op.id)
|
||||
{
|
||||
debug!(uid = %op.uid, %error, "clearing an access-deferral window failed");
|
||||
if matches!(outcome, Ok(DrainDisposition::Applied)) {
|
||||
if let Err(error) = self.db.clear_op_access_deferral(op.id) {
|
||||
debug!(uid = %op.uid, %error, "clearing an access-deferral window failed");
|
||||
}
|
||||
// What landed may have made other ops claimable: the files
|
||||
// made in a folder that has its uid now, the next change to the
|
||||
// same node. This worker only takes one of them; the others
|
||||
// slept until the next idle poll.
|
||||
self.wake_drain();
|
||||
}
|
||||
if let Err(e) = outcome {
|
||||
let attempts = op.attempts + 1;
|
||||
|
||||
@@ -201,10 +201,13 @@ const UPLOAD_TIME_MEMORY: usize = 512;
|
||||
///
|
||||
/// One meant a single 10 GiB upload blocked every queued rename, trash and
|
||||
/// small write behind it. Ordering only has to hold per node — enforced by the
|
||||
/// claim query, not by the thread count — so the rest is throughput. Kept small:
|
||||
/// these are uploads, and past a handful they compete for the same uplink and
|
||||
/// for the SDK's own per-request concurrency.
|
||||
const DRAIN_WORKERS: usize = 3;
|
||||
/// claim query, not by the thread count — so the rest is throughput. Most ops
|
||||
/// spend their time waiting: a create waits for Drive to list the node it made
|
||||
/// before it reads it back. Three workers left a thousand small creates taking
|
||||
/// 0.3 s each on a LAN and 2.5 s on Wi-Fi, one after another. Uploads cannot
|
||||
/// crowd each other out by number: the SDK caps the blocks in flight across
|
||||
/// the client.
|
||||
const DRAIN_WORKERS: usize = 16;
|
||||
|
||||
/// How long a staged blob that names no node is kept before it is retired.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user