Giter Site home page Giter Site logo

Comments (3)

JKorf avatar JKorf commented on August 13, 2024 1

As you've pointed out @ridicoulous, because HTTP 1.1 is used the default is keep-alive anyway. With your PR changes of reusing the HttpClient it should now also be able to actually re-use the connection when making a second request.

As far is I could see there is no notable performance difference (tested some requests to Binance). The consumed time per request is mainly waiting for the server to serve up the data, not making the connection.

from cryptoexchange.net.

JKorf avatar JKorf commented on August 13, 2024

I've tried setting the Connection header to both Close and KeepAlive, but I've seen no timing difference between the two. If you can show me any data which suggests a performance improvement when setting the header I'll be happy to change it.

from cryptoexchange.net.

ridicoulous avatar ridicoulous commented on August 13, 2024

@nikkozp
I solved it via overriding ConstructRequest method in my RestClient implementation.

@JKorf requests with keep alive header should reuse existing connection, instead opening new (what can took at least 30-35ms). But according to msdn, keep alive connection is used by default if you uses HTTP 1.1
May be you didn't see any diffrenece, cause your server send Close header in responses?

from cryptoexchange.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.