# Why response time for packetbeat memcache protocol is always zero

**URL:** <https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497>\
**Category:** Beats\
**Tags:** packetbeat\
**Created:** [April 15, 2016, 12:22pm UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497 "2016-04-15T12:22:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirann42](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kirann42](https://discuss.elastic.co/u/kirann42)\
**Post date:** [April 15, 2016, 12:22pm UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/1 "2016-04-15T12:22:12Z")

</div>

We are using packetbeat to measure memcache flows.Somehow the response time field in the packetbeat logs is always zero for any memcache request-response flow.

What could be the reason ?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 15, 2016, 2:09pm UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/2 "2016-04-15T14:09:19Z")

</div>

Response time is given in [milliseconds based on timestamps packets have been sniffed from network interface](https://github.com/elastic/beats/blob/master/packetbeat/protos/memcache/memcache.go#L328). That is, it depends on sniffer + clock accuracy. The packet timestamps are the timestamps of first packet seen for said messages. This does not include the time it takes to send the full response. There might still be some extra time used in client libs to read/parse the response + processing. Theoretical responses can be received and processed in parallel (responses of GET requests can be stream-processed one-by-one). If processing takes 'longer' some data might be buffered in OS network buffers (there is no way packetbeat can measure this).

Response time computation requires request and response message. In case response is missing (there are some request-only message types in the protocol), the response time is set to -1.

Have you tried to implement some traffic shaping delaying the memcached responses in time?

---

<div class="post-metadata">

**Author:** ![kirann42](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kirann42](https://discuss.elastic.co/u/kirann42)\
**Post date:** [April 15, 2016, 4:08pm UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/3 "2016-04-15T16:08:41Z")

</div>

Thanks for the detail explanation.Few points

1)Wanted to confirm if response times for memcache are provided by packetbeat.

As per your answer and from docs,I get that the response time is a generic field which is provided for supported protocols including additional protocol specific fields too.

2)As I was not sure about 1) ,I did not test much on trying to introduce delay in memcache response.Will do that and update the question.

3)As the response times are less than millisecond ,these might be coming as zero.

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [April 18, 2016, 11:39am UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/4 "2016-04-18T11:39:39Z")

</div>

1. yes, every application layer analyzer dealing with transactions computes a response time.

2. right. Given granularity of your clock. We rely on timestamps reported by sniffer/OS.

---

<div class="post-metadata">

**Author:** ![kirann42](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@kirann42](https://discuss.elastic.co/u/kirann42)\
**Post date:** [April 20, 2016, 11:56am UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/5 "2016-04-20T11:56:41Z")

</div>

Thanks.

---

<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:** [July 5, 2017, 9:52pm UTC](https://discuss.elastic.co/t/why-response-time-for-packetbeat-memcache-protocol-is-always-zero/47497/6 "2017-07-05T21:52:59Z")

</div>


