Git Product home page Git Product logo

demo-latency's Introduction

demo-latency

checking NS response

dig +trace google.com @8.8.8.8 | tail -n2 | grep -i received

;; Received 55 bytes from 216.239.32.10#53(ns1.google.com) in 35 ms

checking latency with curl (result in seconds)

cat > curl-format.txt <<EOF
time_DNS_resolved:  %{time_namelookup}\n
time_TCP_established:  %{time_connect}\n
time_TLS_handshake_done:  %{time_appconnect}\n
time_pretransfer:  %{time_pretransfer}\n
time_redirect:  %{time_redirect}\n
time_TTFB:  %{time_starttransfer}\n
----------\n
time_total:  %{time_total}\n
EOF

curl -w "@curl-format.txt" -L -o /dev/null -s "https://google.com/"

time_DNS_resolved:  0.151635
time_TCP_established:  0.473644
time_TLS_handshake_done:  0.579267
time_pretransfer:  0.579403
time_redirect:  0.473711
time_TTFB:  0.883309
----------
time_total:  0.916728

reuse session

curl -w "@curl-format.txt" -L -o /dev/null -s "https://google.com/" -o /dev/null/ "https://google.com/"

time_DNS_resolved:  0.002012
time_TCP_established:  0.053303
time_TLS_handshake_done:  0.174710
time_pretransfer:  0.174917
time_redirect:  0.153164
time_TTFB:  0.300262
----------
time_total:  0.303981
time_DNS_resolved:  0.000096
time_TCP_established:  0.000101
time_TLS_handshake_done:  0.000103
time_pretransfer:  0.000300
time_redirect:  0.073336
time_TTFB:  0.139116
----------
time_total:  0.139482

usefull tool visualization: httpstat

httpstat -Lv https://google.com/

HTTP 3 checking

docker run -it --rm ymuski/curl-http3 curl -ILv https://blog.cloudflare.com --http3

* Sent QUIC client Initial, ALPN: h3-25h3-24h3-23
* h3 [:method: HEAD]
* h3 [:path: /]
* h3 [:scheme: https]
* h3 [:authority: blog.cloudflare.com]
* h3 [user-agent: curl/7.69.0-DEV]
* h3 [accept: */*]
* Using HTTP/3 Stream ID: 0 (easy handle 0x5569a53b2780)
> HEAD / HTTP/3
> Host: blog.cloudflare.com
> user-agent: curl/7.69.0-DEV
> accept: */*
> 
< HTTP/3 200
HTTP/3 200

Checking latency:

docker run -it --rm ymuski/curl-http3 curl -w " time_DNS_resolved: %{time_namelookup}\n time_TCP_established: %{time_connect}\n time_TLS_handshake_done: %{time_appconnect}\n time_pretransfer: %{time_pretransfer}\n time_redirect: %{time_redirect}\n time_TTFB: %{time_starttransfer}\n time_total: %{time_total}\n" -o /dev/null -s https://blog.cloudflare.com --http3

 time_DNS_resolved: 0.036634
 time_TCP_established: 0.000000
 time_TLS_handshake_done: 0.000000
 time_pretransfer: 0.084228
 time_redirect: 0.000000
 time_TTFB: 0.112559
 time_total: 0.136620

Checking latency with httpstat:

docker run -it --rm ymuski/curl-http3 ./httpstat.sh -ILv https://blog.cloudflare.com --http3

docker run -it --rm ymuski/curl-http3 ./httpstat.sh -ILv https://yurets.pro --http3

demo-latency's People

Contributors

yurymuski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.