Linux – Cheap way to detect client round trip times for http

linuxlinux-networkingnetworkingnginxtcpdump

I am trying to figure out a way to detect round trip times for each IP that connects to port 80 on my server. What is a good way to do this?

There are far to many connections, and pinging each ip is not practical. I was thinking, somehow measuring the time difference between when server send the syn/ack packet and when server receives the ack for it.

Is there a way to log this cheaply? Maybe using some magic tcpdump filter?

The goal of this exercise is to aggregate the data and figure if there are any routing inefficiencies. Say one ISP in one region maybe routing incorrectly, etc.

FWIW the webserver is nginx.

Best Answer

$tcpinfo_rtt, $tcpinfo_rttvar, $tcpinfo_snd_cwnd, $tcpinfo_rcv_space

information about the client TCP connection; available on systems that support
the TCP_INFO socket option

http://nginx.org/en/docs/http/ngx_http_core_module.html#variables

Related Topic