-
-
Notifications
You must be signed in to change notification settings - Fork 683
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
Stream write is slow and laggy #895
Comments
The problem is in your write method: Are you making a http request on every write call ? |
Yes, it is according to oracle documentation for multipart uploads. |
Well, making a HTTP request on every chunk is extremely inefficient, and no wonder it is slow. Try to find a way to pipe the stream directly. |
As I said, those http requests are fast. And it is according to oracle documentation. So that is not the problem. Also oracle API is AWS S3 compliant. So how do you imagine utilizing |
Do it like the s3 example with a passtrough stream https://github.com/node-formidable/formidable/blob/master/examples/store-files-on-s3.js |
Support plan
Context
What are you trying to achieve or the steps to reproduce?
I'm trying to upload files directly to oracle cloud object storage. I use their API with npm package and
fileWriteStreamHandler
feature of formidable. When I upload a file, the upload from broweser perspective is terribly slow and not responsive to changes.On browser side I'm checking upload progress by event
But this event is not often called and oftentimes the upload seems like it's stuck. It gets stuck on some percentage, then after like a minute it jumps to different percentage and gets stuck again. Direct upload to oracle cloud from my computer is fast.
On server side I have a class which is basically adapter and this is the important code:
this.localTemp
is variable from configuration, which switches between local storage of temporary files and uploading file directly from form to cloud storage. When I use local sotrage, everything works good and fast. With stream write, it's slow. Butwrite
anddone()
inwrite
are fired often and fast.What was the result you got?
Slow and laggy upload with
fileWriteStreamHandler
What result did you expect?
Approximately same speed/responsivenes as uploading when using local temp storage or as uploading directly to oracle cloud.
The text was updated successfully, but these errors were encountered: