tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
2.95k stars 467 forks source link

v2.1.0 cpu 100% #1028

Closed dcboy closed 7 months ago

dcboy commented 8 months ago

Question i upgrade new version server side as some logic with v1.13.0, but the new version run cpu 100%

Setup details Please provide following details, if applicable to your situation:

this is pprof cpu profile profile.zip

Acconut commented 8 months ago

Was this capture while performing a single upload or while load testing it? What storage did you use? How was the CPU usage in tusd v1 for you?

dcboy commented 7 months ago

Was this capture while performing a single upload or while load testing it? What storage did you use? How was the CPU usage in tusd v1 for you?

just single file upload and use local filestore, tusd v1 only cpu 2%

Acconut commented 7 months ago

Looking at the profile, I didn't spot any obvious issue. 66% of the samples are spent inside syscall, as is expected for a program that reads from network and writes to disk.

I wasn't able to reproduce high CPU usage locally when uploading large files using tusd. Can you provide me with a method to reproduce this issue?

dcboy commented 7 months ago

i will try furnish demo,thx

dcboy commented 7 months ago

i have reconstruct hold logic, now is ok

Acconut commented 7 months ago

Glad that you found a solution! Could you share a few more details to help other users if they also run into similar issues? Was the root cause part of your own Go code?