-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server): calculate sha1 checksum #525
Conversation
panoti
commented
Aug 23, 2022
- calculate sha1 checksum by stream
- store sha1 checksum into asset entity
server/libs/database/src/migrations/1661270339373-AddAssetChecksum.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the approach of writing the file while computing the hash on-the-fly
Are you still planning on benchmarking the two methods of calculating the hash (couple into Multer's storage engine vs. operating the process separately?) |
Yeah, I am preparing env for this benchmark. I hope it will be done ASAP. |
Thank you, no rush 😃 |
Benchmark source code (https://github.com/panoti/hash-benchmark). There are 2 parts in the benchmark source code: server and client. ServerTo test the computational ability of the 2 algorithms, I build a NodeJS app with 2 entrypoints:
ClientUsing k6.io to simulate file upload.
Run benchmark on server
Sequence hashing 1MB (08/27/2022 05:53+7)To simulate 10 virtual users upload a 1MB file during 5 minutes ( sudo docker run -it --rm --network mynet ghcr.io/panoti/hash-benchmark/client:main run --vus 10 --duration 5m /app/sequence-test-1MB.js Client logs
Server logsStream hashing 1MB (08/27/2022 06:08+7)To simulate 10 virtual users upload a 1MB file during 5 minutes ( sudo docker run -it --rm --network mynet ghcr.io/panoti/hash-benchmark/client:main run --vus 10 --duration 5m /app/stream-test-1MB.js Client logs
Server logs
|
Node app host on server: Jetson Nano 2GB
sequence-test-1MB.js (08/28/2022 01:01+7)To simulate 4 virtual users upload a 1MB file during 5 minutes (
Client logs
Server logsstream-test-1MB.js (08/28/2022 01:12+7)To simulate 4 virtual users upload a 1MB file during 5 minutes ( k6 run --vus 4 --duration 5m ./stream-test-1MB.js Client logs
Server logssequence-test-50MB.js (08/28/2022 01:12+7)To simulate 1 virtual users upload a 50MB file during 10 minutes ( k6 run --vus 1 --duration 10m ./sequence-test-50MB.js Client logs
Server logssequence-test-50MB.js (08/28/2022 01:12+7)To simulate 1 virtual users upload a 50MB file during 10 minutes ( k6 run --vus 1 --duration 10m ./sequence-test-50MB.js Client logs
Server logsSummary
|
What does the client's average duration account for? upload time? |
This is latency per upload request. |