socket.io-stream icon indicating copy to clipboard operation
socket.io-stream copied to clipboard

Uploading @ max 125KB/s, too slow

Open joeyben opened this issue 10 years ago • 5 comments

Hi there, any idea why it's very slow when i upload a file from Client to Server? I tested this with Socket.io and it's downloading at a speed of 1.5MB/s.

Thanks in advance!

joeyben avatar Nov 05 '15 14:11 joeyben

I'm seeing this too. I'm using an fs.createReadStream, piped through socket.io-stream (on the same machine during testing) and sending a 100mb file is taking minutes to transfer.

Any ideas on this?

jdfwarrior avatar Jan 15 '16 14:01 jdfwarrior

Actually, mine seems to be a transform. 100mb was a small file for my testing. I have some files > 1gb that I need to stream (all text) and was using a transform to add a header and ensure that when the data was chunked, it didn't split mid-line. The 100mb file was taking 6.5 minutes to send with the transform in place. Without the transform, sends in seconds.

jdfwarrior avatar Jan 15 '16 17:01 jdfwarrior

I too am facing some issues with uploading. My clients emits events every 1250s and the server receives it pretty late. So for around 100 events transmitted, the server has received just 20-25 and it keeps receiving. If I stop emitting from the client, the difference of 75 events keep coming to the server. Any idea what could be the issue.

vlabzdev avatar Feb 07 '16 06:02 vlabzdev

@jdfwarrior I suggest you use opressor or some other browserify compatible compression module aswell. (Also Heads up websockets#latest support gzip out of the box and it will be enabled by default on socket.io).

The limit might be imposed by the browser

darkyen avatar May 22 '16 17:05 darkyen

Just set higher watermark on BlobReadStream, like this:

ss.createBlobReadStream(file, {
  highWaterMark: 1024 * 200 // Desired chunk length in bytes, 200kb in this example
});

thers avatar Dec 28 '16 17:12 thers