Git Product home page Git Product logo

Comments (8)

alexcrichton avatar alexcrichton commented on May 21, 2024

Thanks for the report! Can you detail how you generated the numbers in the table? The command you provided just shows throughput for one connection (I think) for me, so I wasn't sure how you were sending successive connections.

from tokio.

jethrogb avatar jethrogb commented on May 21, 2024

In my entire report, I meant request = line (one request for Echo as Service). So yeah, a single connection.

The numbers were generated with the command shown. You have to divide the bytes/s by two to get requests/s since each request (line) is 2 bytes. You can also wait for the command to finish and divide the time reported by the second dd instance by the count= number.

from tokio.

alexcrichton avatar alexcrichton commented on May 21, 2024

Isn't this just showing that if each requests sends more data it takes longer to process that request?

from tokio.

jethrogb avatar jethrogb commented on May 21, 2024

No, all requests are the same size (note the LineCodec).

from tokio.

alexcrichton avatar alexcrichton commented on May 21, 2024

I believe this is due to this loop https://github.com/tokio-rs/tokio-proto/blob/8fb8e482dcd55cf02ceee165f8e08eee799c96d3/src/streaming/pipeline/server.rs#L136-L138

This is hitting a pessimistic case where there's millions of concurrent requests on one connection and because they're pipeliend they must be completed in order, and right now they're all polled every time.

If this is a problem for you I'd recommend avoiding tokio-proto and using something like stream.buffered(N) as it has a more scalable implementation.

from tokio.

jethrogb avatar jethrogb commented on May 21, 2024

The docs suggest there might be a way to limit the number of in-flight requests, but I can't figure out how.

from tokio.

carllerche avatar carllerche commented on May 21, 2024

I think that might never have been implemented :)

from tokio.

carllerche avatar carllerche commented on May 21, 2024

Hopefully this is resolved now. Closing due to inactivity. Feel free to open again on the repo (tokio-proto) that fits best. This repo is being reclaimed to implement tokio-rs/tokio-rfcs#3.

from tokio.

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.