Giter Site home page Giter Site logo

Comments (15)

joanhey avatar joanhey commented on May 20, 2024 1

If you use http1.1 or http2.0, the keep alive is automatic.
In reality we can remove it from the wrk headers, and still it will use keep alive.

An SPA is very difficult that only use 1 call to the server.

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

f you use http1.1 or http2.0, the keep alive is automatic.

Yes, so what? If "keep alive" is not used, it does not matter if this feature is enabled or not.

An SPA is very difficult that only use 1 call to the server.

As a developer who has been professionally developing SPAs since 2014, I can assure you that the complexity of SPAs has no effect on requests to the backend. In SPA, more often than not, a single request to the backend is used when changing the URL. Even if the SPA doesn't use GraphQL, the frontend is still typically send one request at a time.

from frameworkbenchmarks.

fakeshadow avatar fakeshadow commented on May 20, 2024

Modern http favor tcp/udp connection reuse for good reason. Disabling keep alive is neither practical nor meaningful(perf test wise).

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

Disabling keep alive is neither practical nor meaningful

Yes, tell that to the users who use GraphQL that they are "not modern" and instead of one query they need to use dozens of queries.

from frameworkbenchmarks.

joanhey avatar joanhey commented on May 20, 2024

I think that you are misunderstanding the benefits of Keep Alive.
It's the same if they only need 1 request to the server, the next request will be slower.

Remove Keep Alive is like returning 30 years in the past.

And worst if you are using SSL.

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

The Keep Alive feature is used, but this is done by front-end servers, which usually run nginx, apache, etc. They handle static files, including SSL.

from frameworkbenchmarks.

joanhey avatar joanhey commented on May 20, 2024

Sorry, but it isn't so.
If you connect your server app via proxy with nginx, apache,... without Keep Alive. The performance will be terrible.

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

@joanhey, what are you talking about? Describe a specific real-life scenario where the client is an SPA that is written in React or Angular.

From my many years of practice, all static requests are served by nginx with the "keep alive" feature enabled, and the backend receives requests only for dynamic requests. As I wrote above, probably 90% of dynamic requests do not use "keep alive".

from frameworkbenchmarks.

joanhey avatar joanhey commented on May 20, 2024

https://www.nginx.com/blog/http-keepalives-and-web-performance/

https://www.nginx.com/blog/avoiding-top-10-nginx-configuration-mistakes/#no-keepalives

It's the same if it's SPA or a normal app.

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

@joanhey, I'm not the first time I see how you actually bring something that is not an argument in place of arguments. And now you've done it again. I know very well what "keep alive" is, why are you giving me a link to an article that describes what it is and how to enable it?

from frameworkbenchmarks.

joanhey avatar joanhey commented on May 20, 2024

I send you 2 articles that explain why you need to use it.

If you can't understand it, I can't give you more information.

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

If you can't understand it, I can't give you more information.

Please don't be rude to me, because I can do it too and our discussion will not go in a constructive direction.

from frameworkbenchmarks.

bhauer avatar bhauer commented on May 20, 2024

Single Page Applications (which are very popular now) often use two web servers: one for static files, one for dynamic requests. Benchmarks are usually run for frameworks with dynamic requests, and probably in 90% of cases, such a feature as "keep alive" is not used (in particular because of use a single GraphQL query).

In a typical back-end deployment, an HTTP reverse proxy (e.g., nginx, HAProxy, Traefik) is positioned between clients and the back-end application. Whether or not HTTP KeepAlive is used between the client and the HTTP reverse proxy, it is extremely common to have HTTP KeepAlive enabled between the proxy and the back-end. This is precisely for the performance reasons you cite, namely, closing the proxy server's connection to the back-end after each front-end request would be a significant performance tax on both servers. Since this project measures the maximum throughput of back-end technologies, we specify the use of KeepAlive to be consistent with this common configuration.

(Sidebar: it's acknowledged that there are some back-end technologies that subsume the typical proxy server into the back-end itself. In this configuration, in many cases it remains marginally beneficial to enable KeepAlive to benefit scenarios where a client may make multiple requests during the keep-alive window.)

Can you elaborate on the specific architectural configuration you anticipate would be represented by testing with KeepAlive disabled?

from frameworkbenchmarks.

KostyaTretyak avatar KostyaTretyak commented on May 20, 2024

Whether or not HTTP KeepAlive is used between the client and the HTTP reverse proxy, it is extremely common to have HTTP KeepAlive enabled between the proxy and the back-end.

Show me the part where I deny that. When I say that 90% of SPAs requests do not use Keep Alive - that means that 10% of requests use this feature. So I'm saying that in real life Keep Alive is enabled on the frontend and backend servers. But we're talking about benchmarks on TechEmpower that completely ignore the ability of servers to work when Keep Alive is not used (regardless of whether it is enabled by the server or not). So, to simulate work without Keep Alive, we just need to ask the backend servers to close the connection after processing each request.

Can you elaborate on the specific architectural configuration you anticipate would be represented by testing with KeepAlive disabled?

wrk -H 'Connection: close' # ...

from frameworkbenchmarks.

bhauer avatar bhauer commented on May 20, 2024

Show me the part where I deny that.

There is no need for defensiveness, as I am not accusing you of anything. I am trying to understand the motivation for what you're requesting.

But we're talking about benchmarks on TechEmpower that completely ignore the ability of servers to work when Keep Alive is not used (regardless of whether it is enabled by the server or not).

I'll rephrase my inquiry from the previous message: Aside from purely academic curiosity, what value do you expect could be gleaned from benchmarks run with HTTP KeepAlive disabled?

What deployment architecture would such a test approximate? I have not personally deployed or seen back-end deployments where the reverse proxy and back-end are not using kept-alive connections. In other words, to my understanding, a test without HTTP KeepAlive on the back-end would not be representative of any real-world scenarios. (I'll reiterate that I understand your point that SPAs will frequently use non-KeepAlive connections to the back-end's reverse proxy, but that is an independent matter.)

As much as this project and all of the included test types are synthetic, it nevertheless is a goal that the tests serve as high-water marks of performance for real-world applications. If there is a real-world scenario where back-end servers would be receiving requests without reusing connections from the reverse proxy, perhaps others on the project could be convinced of the value of such testing.

from frameworkbenchmarks.

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.