개발자의뇌

curl http response time check 본문

개발/Linux

curl http response time check

devbrain 2020. 7. 27. 11:19

서버에 http timeout 이 자주 발생하기에 모니터링을 하기 위해

 

curl로 응답속도를 체크하는 방법을 찾아 기록함.

 

 

vi curl-format.txt

total:%{time_total} lookup:%{time_namelookup} connect:%{time_connect} appconnect:%{time_appconnect} pretransfer:%{time_pretransfer} redirect:%{time_redirect} starttransfer:%{time_starttransfer}

 

curl 실행

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

 

curl-format.txt 를 조정하면 원하는 형태의 로그 포맷을 지정할 수 있다.

 

curl로 가져오는 http response body는 /dev/null 로 버린다.

Comments