Skip to content

Performance issue #91

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

Closed
moisesdelacruz opened this issue Mar 22, 2021 · 3 comments
Closed

Performance issue #91

moisesdelacruz opened this issue Mar 22, 2021 · 3 comments

Comments

@moisesdelacruz
Copy link

Hello,

I just did tests with InfluxQL in cURL in terminal, and it works very fast (milliseconds), now the same query takes up to 19 seconds in influxdb-rust.

Any idea what the problem may be?

  • Rust Version: rustc 1.50.0 (cb75ad5db 2021-02-10)
  • Runtime version (e.g. Tokio): 0.2.22
  • OS Version: MacOS 10.14.6

Steps to Reproduce:

#[tokio::main]
async fn main() {
    // Connect to db `test` on `http://localhost:8086`
    let client = Client::new("https://influxdb-host", "example_db")
        .with_token("jwt");

    // Let's see if the data we wrote is there
    let read_query = Query::raw_read_query("SELECT * FROM example_db.example_rp.history WHERE tag='example'");

    let start = Time::now();
    let result = client
        .query(&read_query)
        .await;
    let end = Time::now();

    println!("{}", result.unwrap());
    println!("{:?}", end - start); // Duration { seconds: 16, nanoseconds: 823561000 }
}

VS

curl --get https://influxdb-host/query?db=example_db \
  --header "Authorization: Token jwt" \
  --data-urlencode "q=SELECT * FROM example_db.example_rp.history WHERE tag='example'"

# took miliseconds
@moisesdelacruz
Copy link
Author

In this case it is bringing a month of data, where in every second there is at least one record.

@msrd0
Copy link
Collaborator

msrd0 commented Oct 28, 2021

@moisesdelacruz Can you confirm that you ran these tests in release mode? Rust in debug mode can be pretty slow

@Empty2k12
Copy link
Collaborator

Empty2k12 commented Apr 4, 2024

@moisesdelacruz has this been resolved? I am closing now and will reopen once you confirm it's an issue with this crate.

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

No branches or pull requests

3 participants