Python client is slow: takes 20min to query data that takes 6 seconds using a cURL command

See original GitHub issue

I am finding the python client to be very very slow

I’m querying the data using python as follows, which takes about 20min to execute

result = query_api.query_data_frame('from(bucket: "testing")'
  			'|> range(start: 2020-02-19T23:30:00Z, stop: now())'
  			'|> filter(fn: (r) => r._measurement == "awair-api")'
               , org=credentials.org)

I run the same command using a shell script which extracts the data in about 6 seconds

curl https://us-west-2-1.aws.cloud2.influxdata.com/api/v2/query?org=org@org.com -XPOST -sS \
  -H 'Authorization: Token tokencode==' \
  -H 'Accept: application/csv' \
  -H 'Content-type: application/vnd.flux' \
  -d 'from(bucket:"testing") |> range(start: 2020-02-19T23:30:00Z, stop: now()) |> filter(fn: (r) => r._measurement == "awair-api")' >> test.csv

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
bednarcommented, Aug 13, 2020

Hi @joranbeasley,

Could you share how your data looks like?

One of the possible speed up could be install a ciso8601. The ciso8601 speed up parsing dates a lot of.

pip install ciso8601

Regards

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python requests response is very slow and not equal to cURL
Also, Python is very slow: cURL takes about 6 seconds, but Python is 2 minutes. My cURL command is: curl -L -s -k...
Read more >
How do I debug latency issues using curl? - Heroku Help
Issue. My requests are slower from Heroku when compared with a local development server. · Resolution · Network round trip times · Request...
Read more >
Getting very slow speed while downloading storage blob.
I am using .net core 3.1 web api application to download it and return it with api response. Following is the code. BlockBlobClient ......
Read more >
Change Log – Binance API Documentation - GitHub Pages
Please use WebSocket Streams for live updates to avoid polling the API. ... Updated endpoints for Margin, new parameter archived to query data...
Read more >
Date/Time and Interval Functions and Operators - Elastic
Elasticsearch SQL accepts also the plural for each time unit (e.g. both ... Currently, using a precision greater than 6 doesn't make any ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found