Code Monkey home page Code Monkey logo

Comments (19)

krojew avatar krojew commented on July 16, 2024 1

It might help out of the box, but also remember you can fine tune many settings. If you still get those spikes, try lowering heartbeat interval and/or pool size.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

start_processing is a bit misleading - it starts read/write loops per connection, so it will naturally show up on the flamegraph as the main culprit, especially when connections live as long as the whole application. Can you share debug logs from the moment it happens?

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

I will redeploy my app to run with debug symbols and at debug log level and I will update the logs here once I have them.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

You don't have to run a debug build - just debug logs will be fine. The problem might be in any part of the application, maybe even not in cdrs, so it's important to get the logs from the exact moment it happens.

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

I will run a release build itself but with debug symbols.

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

I ran again and captured the flamegraph with same results as above. I finally decided to use another library named scylla which does not have this problem. Is there any possibility that start_processing::{closure}::{..} can somehow be stuck in a infinite loop?

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

No it can't, since it's simply a read/write loop which waits for data. That's why you're seeing it on the flamegraph - it runs for the entire duration of the session, but doesn't actually do anything until data comes in or out. That's why you can see AsynRead and AsyncWrite there which don't actually take any CPU cycles - they wait an do work only when data is available. It would be great if you provided the debug logs, so we could see what's actually going on.

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

I ran with RUST_LOG=debug but it cdrs_tokio did not logged anything. Did i missed something? I use rust nightly and tokio-tracing.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

Are you using the latest version? Do you have any tracing subscriber, which outputs the logs, e.g. https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html?

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

Are you using the latest version?

Yes, (I usually perform cargo update once a week)

Do you have any tracing subscriber, which outputs the logs, e.g. https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/index.html?

Yes, I use the above tracing_subscriber itself. I am able to get logs from hyper, h2 and other crates.

I have been running the service for a long time and this has been happening all the time. I am able to get some logs from cdrs_tokio target at ERROR.

Screenshot 2023-04-29 at 9 32 03 PM

Screenshot 2023-04-29 at 9 31 50 PM

For now, I have moved to scylla which does not have this problem. This library used to somehow cause so much IO, that our istio-sidecar would also consume more CPU, resulting in a high overall pod CPU usage. There must be some tight loop somewhere in transport.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

"Connection reset by peer" means the cluster shut the connection down. Can you verify two things:

  1. You are using version 8.1, not 8.0 which was yanked.
  2. RUST_LOG is set to DEBUG, since it seems you have some other log level set, as if the env variable was not set for your application. cdrs uses tracing for logging, so it follows all the usual rules.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

Just had a thought - if you are using 8.0 and the nodes drop connections, the io spikes might be related to connection pools being re-established. Lowering pool size might be the solution.

from cdrs-tokio.

coder3101 avatar coder3101 commented on July 16, 2024

You are using version 8.1, not 8.0 which was yanked.

Now that I check, I was using cdrs-tokio = { version = "7.0.4", features = ["derive"] }, Let me check back these things with latest version.

from cdrs-tokio.

vaikzs avatar vaikzs commented on July 16, 2024

I'm facing similar issue wherein CPU usage is ~50% and I tried both lowering connection pooling (local: 1 and remote:0) and upgrading to 8.1.0. Both didn't help as of now.

from cdrs-tokio.

krojew avatar krojew commented on July 16, 2024

Do you have a flamegraph and/or debug logs?

from cdrs-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.