Google Datastore slow using gcloud-node

548 views Asked by At

I'm trying to call Google Datastore using gcloud-node and am consistently getting response times of around 400ms for very simple queries. The Google AppEngine status says the service is responding to gets in about 10ms at the moment, but I never go below 200ms.

I've tried running both on a Google Compute instance and locally and it doesn't make any significant different (I'm not running on Google AppEngine).

Am I doing something wrong or is Datastore really this slow?

Here is a trivial program I'm using to test performance:

var gcloud = require('gcloud');

var dataset = gcloud.datastore.dataset({
    projectId: 'myProject',
    keyFilename: 'key.json'
});

var calls = 0;

for (var i = 0; i < 10; i++) {
    var call = 'get' + calls++;
    console.time(call);

    dataset.get(dataset.key(['Kind', 'Name']),
        (function(call) {
            return function(err, entities, nextQuery) {
                if (err) { console.log(err); }

                console.timeEnd(call);
            }
        })(call)
    )
}

I get the following output:

get1: 654ms
get2: 656ms
get4: 657ms
get0: 668ms
get3: 793ms
get5: 916ms
get6: 919ms
get7: 933ms
get8: 952ms
get9: 1055ms

I've tried googling Datastore performance but apart from complaints dating back to 2011 I find very little.

Thankful for any pointers!

1

There are 1 answers

0
Ed Davisson On

Operations on Google Cloud Datastore are currently expected to take longer than analogous operations on App Engine Datastore due to architectural differences (so the App Engine System Status page isn't directly applicable).

We are actively working on reducing the latency gap. For updates, please follow this issue on our issue tracker.