# Delay on nginx serving from backend

**URL:** <https://www.ruby-forum.com/t/delay-on-nginx-serving-from-backend/207784>\
**Category:** NGINX\
**Created:** [June 2, 2011, 2:34pm UTC](https://www.ruby-forum.com/t/delay-on-nginx-serving-from-backend/207784 "2011-06-02T14:34:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 2, 2011, 2:34pm UTC](https://www.ruby-forum.com/t/delay-on-nginx-serving-from-backend/207784/1 "2011-06-02T14:34:47Z")

</div>

Dear Nginx community ,

I am running nginx 1.04 , ( also tried 1.0 ) , and the backend has an  
ejabber server serving http requests.

I am experiencing delays in requests being served when i serve the  
request via nginx , whereas serving the same request from the backend  
works without any delay .

On debugging , i can see that nginx received a response from backend  
within milliseconds but is not serving back the user with the response .  
there is a 5 second delay at this point . please find below the debug  
log just before and after the delay .

Debug Log is pasted here [nginx\_delay - Pastebin.com](http://pastebin.com/S81ESzUz)

Notice that there is no activity between  
06:26:33 and 06:26:38

Can anyone explain what could cause this delay .

There is no network connectivity issue between nginx and upstream , as  
from the same machine when i connect directly to the backned result is  
received instantly .

I should be seeing a 400 request right away , but it takes 5-6 seconds  
for the request to come .

Posted at Nginx Forum:

> **[Delay on nginx serving from backend](https://forum.nginx.org/read.php?2,203270,203270#msg-203270)**
>
> Dear Nginx community , I am running nginx 1.04 , ( also tried 1.0 ) , and the backend has an ejabber server serving http requests. I am experiencing delays in requests being served when i serve the request via nginx , whereas serving the same request...
