<div dir="ltr"><div style>it's description in man lsof</div><div><br></div><div>SIZE, SIZE/OFF, or OFFSET<br></div><div> ... In other cases, files don't have true sizes - e.g., sockets, FIFOs, pipes - so lsof displays for their sizes the content amounts it finds in their kernel buffer descriptors (e.g., socket buffer size counts or TCP/IP window sizes.) ...</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/29 Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div class="im"><br>
On Fri, Mar 29, 2013 at 06:04:54PM +0800, MCoder wrote:<br>
<br>
> my nginx is just a http tunul proxy http connection, and max connection is<br>
> just lower than 100.<br>
><br>
> # ps aux<br>
> root 19849 0.0 0.0 18028 2452 ? Ss 2012 0:00 nginx:<br>
> master process /usr/local/qqwebsrv/nginx/sbin/nginx<br>
> nobody 25389 0.1 0.0 19752 4104 ? S Mar25 9:07 nginx:<br>
> worker process<br>
> nobody 25390 0.1 0.0 19752 4104 ? S Mar25 9:03 nginx:<br>
> worker process<br>
> nobody 25391 0.1 0.0 19752 4108 ? S Mar25 8:46 nginx:<br>
> worker process<br>
> nobody 25392 0.1 0.0 19760 4116 ? S Mar25 8:58 nginx:<br>
> worker process<br>
><br>
> # lsof | grep nginx | grep socket<br>
> nginx 19849 root 3w unix 0xffff8102b7574380<br>
> 1677964948 socket<br>
<br>
</div>[...]<br>
<div class="im"><br>
> nginx 25392 nobody 3u unix 0xffff8102b7574380<br>
> 1677964948 socket<br>
> nginx 25392 nobody 6u unix 0xffff8102dce9dcc0<br>
> 1677964950 socket<br>
> nginx 25392 nobody 8u unix 0xffff81027785a980<br>
> 1677964954 socket<br>
> nginx 25392 nobody 12u unix 0xffff81010e285100<br>
> 1677964958 socket<br>
><br>
> # lsof |awk '$1=="nginx" && $NF == "socket" {n[$6]=$7} END {for (i in n) {m<br>
> += n[i]} print m / (1024 * 1024 * 1024)}'<br>
> 12.5018<br>
<br>
</div>What makes you think that what you are counting is memory? From<br>
here it looks like NODE column, with SIZE/OFF colum omitted for<br>
some reason (likely just empty). On a linux system here the<br>
output looks like:<br>
<br>
$ lsof | egrep 'socket|SIZE'<br>
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME<br>
nginx 30299 mdounin 3u unix 0xffff880224f836c0 0t0 1953927 socket<br>
nginx 30299 mdounin 6u unix 0xffff880413ff0380 0t0 1953928 socket<br>
nginx 30300 mdounin 6u unix 0xffff880413ff0380 0t0 1953928 socket<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/en/donation.html" target="_blank">http://nginx.org/en/donation.html</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br></div>