A simple database query in Google App Engine with lots of CPU time

I am new to Google App Engine and Python, but I just released my first site with a real site. But now I am having problems with one path that uses significantly more CPUs (and CPU APIs) than other paths. I narrowed it down to one data collection causing the problem:Carvings.all().fetch(1000)

Under the App Engine toolbar, it reports “1040cpu_ms 846api_cpu_ms” pretty reliably for every request for this path. It seemed that this could be the source of some of the immunity that my client experienced to the site as a whole.

Therefore, I cannot understand what is so expensive about this request. Here is the related data model:

class Carving(db.Model):
    title = db.StringProperty(required=True)
    reference_number = db.StringProperty()
    main_category = db.StringProperty()
    sub_category = db.StringProperty()
    image = db.ReferenceProperty(CarvingImage)
    description = db.TextProperty()
    price = db.FloatProperty()
    size = db.StringProperty()
    material = db.StringProperty()
    added_at = db.DateTimeProperty(auto_now_add=True)
    modified_at = db.DateTimeProperty(auto_now=True)

, , , , . 90, , .

0
4
  • Memcache, , . 90, , , .

  • Carvings? , , Entity, - CarvingSummary, . , , , .

, , , ? , , .

+2

, , .

memcache.

0

1000 ? , , , .

0

(/ Text), , , .

: memcache, . .

Second prize: I'm not sure how often your images change and how much you can have, but you can consider downloading them as static files and simply linking them in your HTML. Then it will be just an HTTP GET from the browser - far below the overhead.

0
source

All Articles