Re: Tool to measure ssh latency ("sshping") ?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



while true
do
time echo test | ssh user@machine.somewhere <mailto:user@machine.somewhere> cat
done

Well, shouldn't it be more like this?

  while true
  do
    echo foobar
  done | ssh user@machine > /dev/null


But for a remote rpc service that requires low latency, take a look
at multiplexing
https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing and
daemonize the Master connection

Yeah, that keeps a common SSH connection as well.



My €0.02: just use existing tools.

  for nr in $(seq 0 3600)
  do
    id=$(date +%s.%N,$$,$nr | md5sum)
    echo $id
    sleep 1
done | strace -o /tmp/ssh.trace -tt -s 30 --trace=read,write > /dev/null

Please note that "strace" does a dup() of STDIN, STDOUT, and STDERR,
so it's not fd 0,1,2 but 4,5,6 for me.


Sadly I couldn't get strace to log _only_ these fd --
but but by associating the read() and write() requests by the MD5-ID
it should be fairly easy to associate the matching calls,
and subtracting the timestamps should get a fairly accurate picture
of the latency.

(Also you should be able to see the communication to/from the ssh
process vs. the communication of ssh to the other host - ie. you can
measure "input encryption time, latency to remote answer, output
decryption time".)

That doesn't include processing _outside_ ssh, of course.


If the machine you're doing that on has a fairly recent linux kernel
running, you could also use bpftrace to get better filtered results.



_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux