latency issue with datastore

57 views
Skip to first unread message

David

unread,
Aug 18, 2016, 1:36:42 PM8/18/16
to Google App Engine
I have an application that has been in production for several years and the data access code has not been updated in a very long time.  Over the last couple of days I've seen poor latency for a significant number of requests.  From the log statements I see almost the entirety of time -- over 20 seconds -- is being spent fetching a single record from the datastore by record id.  Some requests immediately before or after these still perform in the expected few hundred ms time.

The java code is using an older version of JDO:

datanucleus-appengine-1.0.10.final.jar
datanucleus-core-1.1.5.jar
jdo2-api-2.3-eb.jar

and the relevant data access code is:

private CachedImage queryDatastore(String lookupKey)
    {
        PersistenceManager pm = null;
        CachedImage cachedImage = null;
        try
        {
            pm = PMF.get().getPersistenceManager();
            cachedImage = pm.getObjectById(CachedImage.class, lookupKey);
        }
        catch(JDOObjectNotFoundException e)
        {
            // not found, do nothing and return null
        }
        finally
        {
            if (pm != null)
            {
                pm.close();
            }
        }
        return cachedImage;
    }

The datastore records are organized and accessed by namespaces and the total size of the datastore is small 3GB. The namespace I've been testing against
is also tiny -- several thousand records and less than 40Mb in size.

Is anyone else experiencing similar issues with the datastore?  Does anyone have any ideas if something has changed with GAE or specifically its support for JDO
that may explain why performance is suddenly so bad?

Thanks,
David

Nick (Cloud Platform Support)

unread,
Aug 18, 2016, 5:47:49 PM8/18/16
to Google App Engine
Hey David,

It's difficult to say what might be the cause of this. There's no outage or ongoing issue at the moment, so this is worthy of further investigation. Could you email me your Project ID at pay...@google.com? How are you determining the time spent fetching? Do you have custom timing code, or some other method?

Cheers,

Nick
Cloud Platform Community Support
Reply all
Reply to author
Forward
0 new messages