<br>This isn&#39;t a problem with nginx, it is likely a configuration issue with your ipvs software. Removing ipvs from the configuration shows that. You might want to look at how your LB is timing out tcp sessions. In your case it shows that the connection close (fin) from your nginx server isn&#39;t making it to your realservers &quot;foo&quot; and &quot;bar&quot;. Capture a http request at all 3 points in the chain to determine what is happening.<br>
<br> Sridhar<br><br><div class="gmail_quote">On Mon, Aug 16, 2010 at 9:14 AM, dwass <span dir="ltr">&lt;<a href="mailto:nginx-forum@nginx.us">nginx-forum@nginx.us</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Have a strange problem. We have a configuration (this is only a part of<br>
the configuration) that has problems if the upstream server is a<br>
load-balanced server using ipvs/keepalived.<br>
<br>
Here is the relevant part of the configuration:<br>
<br>
upstream fb_server {<br>
        server foobar:8080;<br>
}<br>
server {<br>
  listen 80;<br>
  server_name <a href="http://f.b.com" target="_blank">f.b.com</a>;<br>
  location /fb/ {<br>
     proxy_pass <a href="http://fb_server" target="_blank">http://fb_server</a>;<br>
  }<br>
}<br>
<br>
The hostname &quot;foobar&quot; resolves to an IP address that is load-balanced<br>
over 2 physical servers (&quot;foo&quot; and &quot;bar&quot;) using ipvs/keepalived.<br>
<br>
What we see is that on the 2 upstream servers &quot;foo&quot; and &quot;bar&quot; there are<br>
a lot of connections in FIN_WAIT2 state and on the machine where nginx<br>
is running we see an increasing number of connections in LAST_ACK state.<br>
This would imply that nginx is not managing the upstream connection<br>
shutdown properly.<br>
<br>
In order to prove that the problem is related to the load-balancing, if<br>
we change the upstream server to either &quot;foo&quot; or &quot;bar&quot; the problem goes<br>
away.<br>
<br>
Now I realize that we can also use nginx to do the load-balancing and<br>
not use ipvs/keepalived, but I&#39;d like to know why this doesn&#39;t work<br>
properly in this configuration. It is also probably a useful thing for<br>
the nginx authors and users to know as well.<br>
<br>
If anyone has any idea why this is behaving like this I&#39;d love to hear<br>
from you.<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,120319,120319#msg-120319" target="_blank">http://forum.nginx.org/read.php?2,120319,120319#msg-120319</a><br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Sridhar<br>