<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi<br><div><br><blockquote type="cite"><div>There will be another connection between nginx and php, but it <br>will be live (in ESTABLISHED state). It will wait for php to <br>finish request processing and sending response back to nginx. <br>Once php is done - nginx will close both nginx-php and <br>client-nginx connections.<br></div></blockquote></div><div><br></div><div>That's what I though, but I've got no nginx-php connections in ESTABLISHED mode when a client-nginx connection goes to CLOSE_WAIT. </div><div><br></div><div>This is what I get now on a netstat -nap:</div><div><br></div><div><div>Active Internet connections (servers and established)</div><div>Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name</div><div>tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 13040/php5-fpm</div><div>tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 6731/mysqld </div><div>tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 16936/nginx</div><div>tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 881/sshd </div><div>tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1416/exim4</div><div>tcp 324 0 10.10.10.10:80 66.249.68.247:36979 ESTABLISHED -</div><div>tcp 113 0 127.0.0.1:80 127.0.0.1:39229 CLOSE_WAIT -</div><div>tcp 335 0 10.10.10.10:80 65.55.207.102:47057 ESTABLISHED -</div><div>tcp 116 0 10.10.10.10:80 83.170.113.102:60149 ESTABLISHED -</div><div>tcp 413 0 10.10.10.10:80 81.52.143.26:51658 CLOSE_WAIT -</div><div>tcp 117 0 10.10.10.10:80 83.170.113.102:56117 CLOSE_WAIT -</div><div>tcp 1 0 10.10.10.10:80 66.249.68.247:62666 CLOSE_WAIT 16940/nginx: worker</div><div>tcp 1 0 10.10.10.10:80 66.249.68.247:37085 CLOSE_WAIT 16939/nginx: worker</div><div>tcp 1 0 10.10.10.10:80 66.249.68.247:51700 CLOSE_WAIT 16938/nginx: worker</div><div>tcp 1 0 10.10.10.10:80 67.195.115.83:53503 CLOSE_WAIT 16937/nginx: worker</div><div>tcp 117 0 10.10.10.10:80 74.52.50.50:52833 CLOSE_WAIT -</div><div>tcp 483 0 10.10.10.10:80 213.171.250.126:35648 ESTABLISHED -</div><div>tcp 0 288 10.10.10.10:22 193.145.230.6:50184 ESTABLISHED 17110/0</div><div>tcp 1 0 10.10.10.10:80 87.68.237.93:51575 CLOSE_WAIT 16939/nginx: worker</div><div>tcp 244 0 10.10.10.10:80 123.125.66.48:22675 CLOSE_WAIT -</div><div>tcp 1 0 10.10.10.10:80 193.145.230.6:50134 CLOSE_WAIT 16938/nginx: worker</div><div>tcp 116 0 10.10.10.10:80 74.52.50.50:55178 ESTABLISHED -</div><div>tcp6 0 0 :::22 :::* LISTEN 881/sshd</div><div>udp 0 0 10.10.10.10:53 0.0.0.0:* 1515/tinydns</div><div>udp 0 0 0.0.0.0:68 0.0.0.0:* 769/dhclient3</div><div>Active UNIX domain sockets (servers and established)</div><div>Proto RefCnt Flags Type State I-Node PID/Program name Path</div><div>unix 2 [ ACC ] STREAM LISTENING 481377 6731/mysqld /var/run/mysqld/mysqld.sock</div><div>unix 3 [ ] DGRAM 601444 867/rsyslogd /dev/log</div><div>unix 2 [ ] DGRAM 673 298/udevd @/org/kernel/udev/udevd</div><div>unix 2 [ ] DGRAM 611850 17110/0</div><div>unix 3 [ ] STREAM CONNECTED 609800 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609799 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609797 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609796 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609794 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609793 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609791 16936/nginx</div><div>unix 3 [ ] STREAM CONNECTED 609790 16936/nginx</div><div>unix 2 [ ] DGRAM 533124 769/dhclient3</div><div>unix 2 [ ] DGRAM 481379 6735/logger</div><div><div>unix 3 [ ] STREAM CONNECTED 324617 27662/php5-fpm</div><div>unix 3 [ ] STREAM CONNECTED 324616 27662/php5-fpm</div><div>unix 3 [ ] STREAM CONNECTED 324613 27662/php5-fpm</div><div>unix 3 [ ] STREAM CONNECTED 324612 27662/php5-fpm</div></div></div><div><br></div><div><br></div><div>11 client-nginx connections in CLOSE_WAIT, no nginx-php connections. Unless they're the last four unix domain sockets connections, but I've configured nginx to use 127.0.0.1:9000 as the fcgi server.</div><div><br></div><div>How can I debug what these CLOSE_WAIT connections were doing, which request were they serving? Anything I can activate on the logs or on nginx-status, a la Apache's extended server-status?</div><div><br></div><div>Thanks</div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>-- </div><div> Vicente Aguilar <<a href="mailto:bisente@bisente.com">bisente@bisente.com</a>> | <a href="http://www.bisente.com/">http://www.bisente.com</a></div></div>
</div>
<br></body></html>