Well Duh, You are generating a JPG, you said send the bytes but you are
modifying, rendering, and compressing a JPG. That takes some CPU.
My app sends jpgs and uses no CPU as it were because it really is do I have
this? Oh I do? Great here it is
Your app is Hey Draw me a pretty picture Um... Ok let me do that for
youYou probably want that as a JPG not a BMP let me compress that
Let me save it to a blob incase you need it later... here you go
It's the difference between having an intern running a photo copy and asking
Me to paint you a picture of you with my cat. And now I'm certain you are
using APIs which have a minimum CPU per action cost.
Likely if these are one time use images, you should just write them, no
blob.
These are small, so likely if you need to keep them around you should write
them to data store
If you only kind of need them sometimes, consider memcache so you don't have
to clean up in a week when you have lots of these.
-Original Message-
From: google-appengine@googlegroups.com
[mailto:google-appengine@googlegroups.com] On Behalf Of stevep
Sent: Saturday, May 14, 2011 3:06 PM
To: Google App Engine
Subject: [google-appengine] Re: What's going on with my CPU times
Thanks Brandon. Every image is unique, and is generated by users from the
client. So statics limitations make it infeasible.
Right now I think this has to do with the on/off again hits. I went into my
Dashboard after a few individual calls, and saw I had gone from 3 resident
instances: 3 resident and 3 dynamic. Although this was serving a query rate
of 0.018 per second. My average instance latency was 65ms I think.
Have no idea what the resident instances are doing. But guess will wait and
see.
Cheers,
stevep
On May 14, 12:27 pm, Brandon Wirtz drak...@digerat.com wrote:
Put it not in a blog.
Consider using Static (depending what else you are doing)
With out code it is hard to tell what you are doing but you may be
using API cpu and not CPU Cpu
Most of my CPU bill is API.
-Original Message-
From: google-appengine@googlegroups.com
[mailto:google-appengine@googlegroups.com] On Behalf Of stevep
Sent: Saturday, May 14, 2011 8:04 AM
To: Google App Engine
Subject: [google-appengine] What's going on with my CPU times
Can anyone help me understand these CPU times.
I have an on-line handler function that basically does a get_by_id(),
and sends out the bytes for a 150x100 pixel jpeg BLOB record value. A
pretty straightforward image retrieval from the datastore.
My CPU loads are all over the map. I am $9 paying for 3 instances to
stay resident. An instance takes just less than 15 meg of RAM. Very
low volumes right now, so maybe that affects this?
Looking at AppStats, the function itself is consistently taking 200ms
or less for every call. So how am I getting 13,000ms for this simple
function?
I've copied/pasted a series of calls for this image below. Here is an
extract of the last 4 url calls:
242ms...80cpu
351ms...13,740cpu
466ms4,903cpu
182ms2,922cpu
Looking at the full list below, I only occasionally get fast cpu
times. This is the simplest function, can't imagine where the
inefficiencies are. Is the HR datastore that slow at pushing a small
payload of bytes out the door? Man oh man, averaging these cpu times
for a 150x100 pixel jpg, I better switch my image saves/retrieves to
S3 mucho soon.
Thanks in advance,
stevep
2011-05-14 07:20:10.949 /cardimage/59005_t.jpg 200 242ms 80cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-14 07:03:04.967 /cardimage/59005_t.jpg 200 351ms 13740cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 14:50:48.065 /cardimage/59005_t.jpg 200 466ms 4903cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 13:57:09.990 /cardimage/59005_t.jpg 200 182ms 2922cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 10:39:27.922 /cardimage/59005_t.jpg 200 196ms 1474cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 09:01:08.347 /cardimage/59005_t.jpg 200 494ms 777cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 08:13:33.672 /cardimage/59005_t.jpg 200 501ms 435cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 07:23:52.577 /cardimage/59005_t.jpg 200 371ms 117cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip(gfe),gzip(gfe),gzip(gfe)
2011-05-13 07:06:09.403 /cardimage/59005_t.jpg 200 880ms 1585cpu_ms
8api_cpu_ms 35kb facebookplatform/1.0 (+http://
developers.facebook.com),gzip