google cloud datastore - AppEngine NDB query and datastore_v3.Next() -


i have few appengine operations take more time expected, i've been looking @ trace logs on gae console insights.

one of them consists in simple query sort entities, such

(data, cursor, more) = query.order(-cls.created).fetch_page(results_per_page, start_cursor=cursor) 

but according logs, , if understand trace correctly (screenshot below), operation run 2 queries: 1 data (runquery), 1 find if there's more data (next). neither take time, there's 600ms delay between both.

i'm wondering why delay both long? i've seen issues next() queries took longer (how prevent application calling datastore_v3.next() when calling get_multi?), time next() in case minimal. bottleneck seems time between both. happens in lots of cases - previous ndb query example.

so:

  1. can avoid calls next() or
  2. can minimize delay between runquery , next()

i'm using standard instance, , don't have specific setup in app.yaml file, besides inbound warmup.

enter image description here

use .fetch() instead of .fetch_page() ... former fetches limit , stops... doesn't return information whether there more results


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -