Random TCP 3 second delay
Maxim Dounin
mdounin at mdounin.ru
Fri May 13 13:01:57 UTC 2011
Hello!
On Thu, May 12, 2011 at 11:50:22PM +0300, Michael wrote:
>
> MD> 3 seconds delay usually indicate packet loss somewhere along the
> MD> path. You have to examine your network between nginx and your app
> MD> to find out where (and why) packets are lost.
> I don't think i have packet loss, traffic is going via loopback
Packet loss is quite possible over loopback as well, though it's
usually caused by some resource shortage or policy rules in
action.
BTW, please make sure you don't have net.inet.tcp.nolocaltimewait
set.
> MD> Some basic steps on FreeBSD include looking though "netstat -id",
> MD> "netstat -s" output, "vmstat -z" output and your ethernet
> MD> controller stats via "sysctl dev.<driver>" (if any).
> I don't see dropped packets on lo0 with netstat -id
> What should i see in "netstat -s" and "vmstat -z"?
In netstat - look for various drops and overflows, most notably
syncache and others tcp-related. In vmstat -z - look for
allocation failures and/or full zones, most notably mbufs and
other tcp-related zones.
> MD> You may also want to check if you by accident have some statefull
> MD> firewall between nginx and backend.
> I have only ipfw rules, and the first rule is accepting local
> traffic: 00005 8211184509 4547370329265 allow ip from me to me
>
> can this be the problem?
AFAIK it shouldn't, but you may want to check sysctl
net.inet.ip.fw.dyn_count and net.inet.ip.fw.dyn_max sysctl's
anyway.
Maxim Dounin
More information about the freebsd-net
mailing list