Skip to content
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

Use persistent HTTP client to speed up requests #168

Merged
merged 2 commits into from
Aug 27, 2020

Conversation

JelteF
Copy link
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

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