T
T
trauus2015-11-22 18:18:43
C++ / C#
trauus, 2015-11-22 18:18:43

Why is HttpClient slow?

I am writing a desktop application to work with Google.Drive. I'm using the Google API. Problem with uploading files to the cloud. When uploading, the file is divided into 4 MB chunks. Each chunk is sent as a separate HttpRequestMessage. The HTTPS protocol is used.
The speed is very small, but stable - 600 Kb / s with a channel of 6 Mb / s. Increasing the chunk size doesn't really help.

Wireshark shows this:
2a1f06aa2e6f452ca68a4da7fc8c0715.png
Each chunk is divided into a huge number of small TLS packets of 4000 bytes, and a TCP ACK is expected for each packet.
I'm running a Fiddler proxy with the Https capture option (but no reuse client / server connections options). The speed rises to the limit of the channel. Wireshark at the same time shows that at first a huge number of TLS packets are sent almost instantly without waiting for a TCP ACK. Then comes a bunch of confirmations and everything repeats for the next chunk.

Checked on 5 PCs with Win7 - slows down. I tried it on a PC with Win10 - the speed was 10 times higher.

Questions:
1. Is it normal that System.Http.HttpClient breaks each chunk into such small fragments? Is it configured somewhere?
2. How can I speed up the sending of chunks without running Fiddler?
3. Is it possible to force HttpClient to divide a chunk into larger fragments?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Zolotov, 2015-11-22
@SZolotov

For which venda do you write, what SDK do you use? Sample code needed.
For example, in Win RT SDK it is not recommended to use httpclient to download/upload files larger than a few kilobytes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question