From 03ca96ccc3fb2679ef1142d9c2d9752e97902212 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 31 Oct 2021 06:24:11 +0100 Subject: [PATCH] performance tips --- README.md | 16 ++++++++++++++++ docs/notes.sh | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/README.md b/README.md index 72487a45..2dc79938 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ turn your phone or raspi into a portable file server with resumable uploads/down * [up2k](#up2k) - quick outline of the up2k protocol, see [uploading](#uploading) for the web-client * [why chunk-hashes](#why-chunk-hashes) - a single sha512 would be better, right? * [performance](#performance) - defaults are usually fine - expect `8 GiB/s` download, `1 GiB/s` upload + * [client-side](#client-side) - when uploading files * [security](#security) - some notes on hardening * [gotchas](#gotchas) - behavior that might be unexpected * [recovering from crashes](#recovering-from-crashes) @@ -860,6 +861,21 @@ below are some tweaks roughly ordered by usefulness: ...however it adds an overhead to internal communication so it might be a net loss, see if it works 4 u +## client-side + +when uploading files, + +* chrome is recommended, at least compared to firefox: + * up to 90% faster when hashing, especially on SSDs + * up to 40% faster when uploading over extremely fast internets + * but [up2k.py](https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py) can be 40% faster than chrome again + +* if you're cpu-bottlenecked, or the browser is maxing a cpu core: + * up to 30% faster uploads if you hide the upload status list by switching away from the `[🚀]` up2k ui-tab (or closing it) + * switching to another browser-tab also works but that makes firefox stop updating the favicon + * unlikely to be a problem, but can happen when uploding many small files, or your internet is too fast, or PC too slow + + # security some notes on hardening diff --git a/docs/notes.sh b/docs/notes.sh index 4e6a715a..968c63c7 100644 --- a/docs/notes.sh +++ b/docs/notes.sh @@ -38,6 +38,13 @@ para() { for s in 1 2 3 4 5 6 7 8 12 16 24 32 48 64; do echo $s; for r in {1..4} avg() { awk 'function pr(ncsz) {if (nsmp>0) {printf "%3s %s\n", csz, sum/nsmp} csz=$1;sum=0;nsmp=0} {sub(/\r$/,"")} /^[0-9]+$/ {pr($1);next} / MiB/ {sub(/ MiB.*/,"");sub(/.* /,"");sum+=$1;nsmp++} END {pr(0)}' "$1"; } +## +## time between first and last upload + +python3 -um copyparty -nw -v srv::rw -i 127.0.0.1 2>&1 | tee log +cat log | awk '!/"purl"/{next} {s=$1;sub(/[^m]+m/,"");gsub(/:/," ");t=60*(60*$1+$2)+$3} !a{a=t;sa=s} {b=t;sb=s} END {print b-a,sa,sb}' + + ## ## bad filenames