# Latency between ElasticSearch and AWS

**URL:** <https://discuss.elastic.co/t/latency-between-elasticsearch-and-aws/233592>\
**Category:** Elasticsearch\
**Created:** [May 20, 2020, 6:43pm UTC](https://discuss.elastic.co/t/latency-between-elasticsearch-and-aws/233592 "2020-05-20T18:43:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cyt/32/49777_2.png) [@cyt](https://discuss.elastic.co/u/cyt)\
**Post date:** [May 20, 2020, 6:43pm UTC](https://discuss.elastic.co/t/latency-between-elasticsearch-and-aws/233592/1 "2020-05-20T18:43:58Z")

</div>

I have an Amazon EC2 instance used to make requests to an Elastic Cloud instance hosted on AWS. Both are in the same region on AWS (N. Virginia). However, I am seeing incredibly high ping between the two servers.

Using the ElasticSearch PHP client, timing `client->ping()` measures the time at about 200 milliseconds.

I am trying to implement search-as-you-type. When I time the queries in Kibana, they take only a few milliseconds to complete. However, the search-as-you-type is unusable due to the latency between ES and EC2 servers.

How can I diagnose/resolve this issue? I would expect a ping of around a tenth of what I am getting due to the proximity of the servers.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 22, 2020, 4:20am UTC](https://discuss.elastic.co/t/latency-between-elasticsearch-and-aws/233592/2 "2020-05-22T04:20:17Z")

</div>

Are you including the time to initialise the client and/or set up the connection in that latency?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 19, 2020, 4:20am UTC](https://discuss.elastic.co/t/latency-between-elasticsearch-and-aws/233592/3 "2020-06-19T04:20:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
