# $request\_time in logging

**URL:** <https://www.ruby-forum.com/t/request-time-in-logging/154624>\
**Category:** NGINX\
**Created:** [December 2, 2008, 9:51am UTC](https://www.ruby-forum.com/t/request-time-in-logging/154624 "2008-12-02T09:51:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marlon\_de\_Boer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ba9def/32.png) [@Marlon\_de\_Boer](https://www.ruby-forum.com/u/Marlon_de_Boer)\
**Post date:** [December 2, 2008, 9:51am UTC](https://www.ruby-forum.com/t/request-time-in-logging/154624/1 "2008-12-02T09:51:13Z")

</div>

Hi all,

Does $request\_time includes the socket operations (accept(), read(),  
send() and close()) or only the local processing time?

I’m curious because I wrote some rrdtool stats based on this log feature  
and seeing some long timeouts.

Regards  
Marlon

---

<div class="post-metadata">

**Author:** ![Marlon\_de\_Boer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ba9def/32.png) [@Marlon\_de\_Boer](https://www.ruby-forum.com/u/Marlon_de_Boer)\
**Post date:** [December 2, 2008, 10:16am UTC](https://www.ruby-forum.com/t/request-time-in-logging/154624/2 "2008-12-02T10:16:25Z")

</div>

On Tue, Dec 02, 2008 at 09:40:10AM +0100, Marlon de Boer wrote:

> Does $request\_time includes the socket operations (accept(), read(),  
> send() and close()) or only the local processing time?
> 
> I’m curious because I wrote some rrdtool stats based on this log feature  
> and seeing some long timeouts.

$request\_time is time between first read() and last write()/sendfile().  
The time between accept() and first read() is not accounted.

---

<div class="post-metadata">

**Author:** ![Marlon\_de\_Boer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ba9def/32.png) [@Marlon\_de\_Boer](https://www.ruby-forum.com/u/Marlon_de_Boer)\
**Post date:** [December 2, 2008, 10:56am UTC](https://www.ruby-forum.com/t/request-time-in-logging/154624/3 "2008-12-02T10:56:59Z")

</div>

Igor S. wrote:

> $request\_time is time between first read() and last write()/sendfile().  
> The time between accept() and first read() is not accounted.

Ok, just to be sure, this will include the time spend reading the  
request from the client and sending the actual data to the client?

Regards  
Marlon

---

<div class="post-metadata">

**Author:** ![Marlon\_de\_Boer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ba9def/32.png) [@Marlon\_de\_Boer](https://www.ruby-forum.com/u/Marlon_de_Boer)\
**Post date:** [December 2, 2008, 11:01am UTC](https://www.ruby-forum.com/t/request-time-in-logging/154624/4 "2008-12-02T11:01:42Z")

</div>

On Tue, Dec 02, 2008 at 10:49:19AM +0100, Marlon de Boer wrote:

> Igor S. wrote:
> 
> > $request\_time is time between first read() and last write()/sendfile().  
> > The time between accept() and first read() is not accounted.
> 
> Ok, just to be sure, this will include the time spend reading the  
> request from the client and sending the actual data to the client?

Yes. However, as to sending nginx pass data to kernel only and can not  
control when the data will be recieved by a client.
