Skip to content
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

Google cloud datastore slow. >1 sec / query #4560

Closed
nojvek opened this issue Dec 8, 2017 · 6 comments
Closed

Google cloud datastore slow. >1 sec / query #4560

nojvek opened this issue Dec 8, 2017 · 6 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. backend needs more info This issue needs more information from the customer to proceed. performance type: question Request for information or clarification. Not an issue.

Comments

@nojvek
Copy link

nojvek commented Dec 8, 2017

We've been getting consistent greater than 1 second on average calls from gcds. Not sure why its ridiculously slow.

We are using it from python version : google-cloud-datastore==1.2.0

from google.cloud import datastore

client = datastore.Client('foo', 'bar')
client.query(
  kind='Blah',
  filters=(
      ('name', '=', 'yolo'),
  ),
  order=('timestamp',)
)

print(list(query.fetch()))

Very simple call but consistently very slow.

@dhermes dhermes added api: datastore Issues related to the Datastore API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: question Request for information or clarification. Not an issue. labels Dec 8, 2017
@dhermes
Copy link
Contributor

dhermes commented Dec 8, 2017

@nojvek Two potential explanations immediately come to mind for me:

  • Your internet connection is slow
  • list(query.fetch()) is making MANY requests. query.fetch() will return an iterator and will continue paging through results (i.e. making one API request per page) until all results matching the query have been found

Do either of these seem reasonable?

@chemelnucfin
Copy link
Contributor

@nojvek Hello, may I ask if @dhermes answered your question?

@nojvek
Copy link
Author

nojvek commented Jan 11, 2018 via email

@chemelnucfin
Copy link
Contributor

@dmcgrath Hi Dan, I saw your answer in #4925. May I ask if you have any insights on this issue?

Thanks.

@tseaver tseaver added performance and removed priority: p2 Moderately-important priority. Fix may not be included in next release. labels Apr 10, 2018
@tseaver
Copy link
Contributor

tseaver commented Oct 18, 2018

@nojvek Your example doesn't show it, but is it possible you are doing the reads in the context of a transaction? The "one per second" response time sounds like one of the limits mentioned in the Datastore API docs:

Maximum rate of transactions reading from or writing to an entity group | 1 per sec

That row links to the Transactions and Entity Groups concept doc:

There is a write throughput limit of about one transaction per second within a single entity group. This limitation exists because Cloud Datastore performs masterless, synchronous replication of each entity group over a wide geographic area to provide high reliability and fault tolerance.

@pcostell Can you suggest any other explanation?

@sduskis sduskis added the needs more info This issue needs more information from the customer to proceed. label Dec 4, 2018
@sduskis
Copy link
Contributor

sduskis commented Dec 6, 2018

I'm going to take the initiative and close this. This thread is old, and generally latency issues benefit from working with Google Cloud support engineers who have more access to information than the client team would. Please reopen if there's no smoking gun from the service side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. backend needs more info This issue needs more information from the customer to proceed. performance type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

5 participants