Skip to content

Use persistent HTTP client to speed up requests#168

Merged
vinjiang merged 2 commits into
Azure:devfrom
JelteF:persistent-http
Aug 27, 2020
Merged

Use persistent HTTP client to speed up requests#168
vinjiang merged 2 commits into
Azure:devfrom
JelteF:persistent-http

Conversation

@JelteF
Copy link
Copy Markdown
Contributor

@JelteF JelteF commented Jul 14, 2020

I have to delete multiple blobs at once. This is quite anoying in Azure
Blob storage in general, since it does not support batch deletes. So I
need to send a request for each delete (multiple thousands in my case).

The problem is made much worse by this library not keeping its HTTP
connections open for successive requests. This commit fixes that by
using the Net:HTTP::Persistent adapter from Faraday.

This makes sending multiple requests much faster. On a bad connection it
also causes less errors, since a connection timeout can only happen
once. After connecting successfully the connection will continue
working as TCP will handle any hicups, instead of getting ETIMEDOUT
errors.

I have to delete multiple blobs at once. This is quite anoying in Azure
Blob storage in general, since it does not support batch deletes. So I
need to send a request for each delete (multiple thousands in my case).

The problem is made much worse by this library not keeping its HTTP
connections open for successive requests. This commit fixes that by
using the `Net:HTTP::Persistent` adapter from Faraday.

This makes sending multiple requests much faster. On a bad connection it
also causes less errors, since a connection timeout can only happen
once. After connecting successfully the connection will continue
working as TCP will handle any hicups, instead of getting `ETIMEDOUT`
errors.
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 14, 2020

Coverage Status

Coverage decreased (-0.01%) to 87.078% when pulling 5d4b076 on JelteF:persistent-http into 956cd1a on Azure:master.

@katmsft katmsft changed the base branch from master to dev August 27, 2020 07:28
@vinjiang vinjiang merged commit 8548981 into Azure:dev Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants