Skip to content

Datastore cross region latency #890

@ovaltzer

Description

@ovaltzer

Hello,
We are doing a basic deployment for a service that uses google datastore.
it is hosted as multi-region in us-central and our service is running in us-east-1.
while running (using golang code) a basic get request (get by key name) and we are having a very bad performance (~400-500 ms) per request (us-east-1 & us-west).
while running from us-central we are having ~100-120 ms.
while running from a local laptop we get ~80-100 ms (very, very, very awkward that it is better then us-east-1 because we are in Israel).
these times are pretty bad while working in multi region.
we tried many options (with different service accounts and etc.) but nothing seems to get good performance while accessing datastore from us-east-1

important to say that we are doing consecutive requests one after the other, where the first one takes more then the others without region to the location of the caller.

I would be super happy if there is a solid explanation to this because we got lost from all the issues (stackoverflow\issues\etc). we are seriously considering to drop from GCP solution as this is a very basic service that we want to use as a good solution for cross region access.

func main() {
	c, err := datastore.NewClient(context.Background(), "us-east-1-project")
	if err != nil {
		log.Fatalf("Google Datastore client failed to initiate. error:%s", err.Error())
	}
	var mu sync.Mutex

	for i := 0; i < 100; i++ {
		go func(j int) {
			mu.Lock()
			defer mu.Unlock()
			start := time.Now()
			res := R{}
			if err := c.Get(context.Background(), datastore.NameKey("someKind", "exsitingKey", nil), &res); err != nil {
				log.Print(err)
			}

			log.Printf("%d: %v", j, time.Since(start))
		}(i)
	}

	time.Sleep(60 * time.Second)
}

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions