Total Storage Data Limited Question

45 views
Skip to first unread message

BarrenTeam

unread,
Jul 5, 2011, 7:15:08 AM7/5/11
to google-a...@googlegroups.com
Hi Gae users,
We have a question about Storage data quota.

Our app store about 2663 entities for a total of stored data equals to 57MB

(See statistics.jpg attached)

We have only one index on the key attribute of 1100 entities.

(See datastore index.jpg attached)

Task Queue Stored Task Bytes are 690

(See taskqueue.jpg attached)

In the memcache we store 1102 entities of about 1022byte each entity and 1 entity of about 50kb

we would to know why the total storage data is 100%

(See dashboard.jpg attached)


dashboard.jpg
datastore index.png
statistics.jpg
taskqueue.jpg

Stephen Johnson

unread,
Jul 5, 2011, 12:09:58 PM7/5/11
to google-a...@googlegroups.com
Hi,
Even though you only have one composite index on __key__ (desc), there
are also other indexes you may have. For example, every __key__ has
an ascending index and every property that you have indexed (which may
have been done automatically for you unless you specified otherwise
for example if you're using JDO) will have 2 (yes 2) indexes created
(one ascending and one descending). What's more if those entries are
lists then they will have 1 index entry for each item in the list. So,
ten items in an indexed list field will have 20 index entries (10 for
the ascending index and 10 for the descending index). Also, remember
that the data in the field is copied into the index entry so if you
have indexes on long text fields then you've got problems. Also, if
you are doing a lot of updates/deletes then you can run out of storage
space because AppEngine does soft deletes where it marks items as
deleted and then periodically cleans them up. I myself see that it
takes about 24 hours for storage to be reclaimed and reported in the
dashboard but there has never been any official word that I know of on
how often this happens.
Hope this helps,
Stephen

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/rhUlCE-GW8AJ.
> To post to this group, send email to google-a...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengi...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>

BarrenTeam

unread,
Jul 6, 2011, 7:05:20 AM7/6/11
to google-a...@googlegroups.com
Thank you Stephen.

Yes we do many updates in our app, probably we fill the datastore because of the soft delete, indeed after at least 24 hours we have in the datastore about 3% of storage data.

We also think that the indexs waste many storage quota.

Thus, we have two more questions:

1) We use JDO. How do we do to avoid the automatic creation of indexes?

2) When we did deletes and inserts instead of updates the storage data quota remained constant. Why? 

Stephen Johnson

unread,
Jul 6, 2011, 12:51:57 PM7/6/11
to google-a...@googlegroups.com
To avoid automatic property index creation with JDO use the following
on properties you don't want indexed.

@Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")

One caveat is that if you plan to use that property as a composite
index then you'll need to have that property indexed. Unindexed
properties/fields can't be used as part of a composite index.

Also, to reduce you database usage, make sure to use short entity
names (I use 2 letter names) and short property names (I use 3
letter). For properties you can use

@Column(name="abc")

to specify a shorter name for the datastore while using a longer name
in your code, thus putting it all together it will look like

@Persistent
@Column(name="abc")
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value="true")
private int
heyIAmAReallyLongNameButWhoCaresCuzTheDatastoreWillUseTheShortName =
0;

As for your #2 question, I'm not sure what you may have been
experiencing there. But as a warning if you do lots and lots and lots
and lots of deletes you can run in to a situation where there are so
many soft deleted entries in your indexes that when you query the
index the query will timeout because it needs to scan past all those
entries. This has happened to people for example that have deleted all
the entries in a particular entity kind and then aren't able to query
for a period of time. No one but the Googlers really know what's going
on at the lowest levels and so it's kind of a black box at figuring
out some of these side effects that you might encounter. Let me know
if you have any other questions and I'll do my best to try to help out
as will others I'm sure.

Stephen

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/google-appengine/-/LAjhJyp4lPEJ.

BarrenTeam

unread,
Jul 7, 2011, 9:24:06 AM7/7/11
to google-a...@googlegroups.com
Thank you again Stephen! :)

We have solved many of our doubts thanks to your answers :)

Stephen Johnson

unread,
Jul 7, 2011, 12:46:12 PM7/7/11
to google-a...@googlegroups.com
Glad to be of help!

On Thu, Jul 7, 2011 at 6:24 AM, BarrenTeam <barre...@gmail.com> wrote:
> Thank you again Stephen! :)
> We have solved many of our doubts thanks to your answers :)
>

> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/google-appengine/-/zEOYzhQkJeQJ.

Reply all
Reply to author
Forward
0 new messages