简体   繁体   中英

Picture upload and download to google appengine is slow

I am storing pictures in the google datastore that have the size of around 450 x 450 pixels but download speed and especially the upload speed is very slow. Around 5 -15 secs.

In my android app I transform Bitmaps to byte arrays and the byte arrays to a Base64 encoded String which is stored as a Blob in the datastore. For download I do the same the other way around.

I checked the appengine latency but its quite fast about 150ms. So i guess the problem is somehow the bandwith speed...

Does anyone know if this is normal for that picture size? And is it maybe the wrong way how I transform the pictures? What are usually the techniques to send a bitmap fast?

Thanks for any help!

Edit I am using google cloud endpoints

Sending files as byte arrays in JSON services and storing the files in the datastore are both pretty bad practices. You should use the BlobStore to upload the images and then use the images service to get a serving URL for the image you uploaded. Store the blob ID and URL in the datastore and whenever you want to view an image in the client - load it directly from Google's CDN by fetching the URL you got. Both upload and download will be orders of magnitude faster this way and even cost you less.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM