Google Cloud Datastore性能(高延迟)

时间:2017-09-26 14:48:11

标签: java performance google-app-engine google-cloud-datastore

我在Google应用引擎自定义灵活环境中运行了API。它使用部署了tomcat的spring-boot在java中编码,并使用google云数据存储客户端(https://github.com/GoogleCloudPlatform/google-cloud-java/tree/master/google-cloud-datastore

我使用newrelic跟踪事务并发现瓶颈,我遇到了一些问题,如图所示:

newrelic_trace

我有2个DAO类,它们使用数据存储区连接从BaseDao扩展,如所有示例所示:

private final Datastore datastore = DatastoreOptions.getDefaultInstance().getService();

为什么这么多次调用 HttpURLConnection [datastore.googleapis.com] (平均值为27.6,如图所示)?我应该以某种方式获取此连接吗?

只是要明确这几乎是请求的作用,这远远不是27次调用数据存储区:

txn = datastore.newTransaction();
datastore.run(query1);
datastore.run(query2);
txn.put(entity1);
txn.put(entity2);
txn.commit();
txn.isActive();

0 个答案:

没有答案
相关问题