| 用途 | 请求全链路调试 |
|---|---|
| 语法 | curl -v URL / curl --trace-time --trace - URL |
| 辅助 | -w 记录耗时分解 |
常用示例
常用示例
curl -v https://api.example.com/health 2>&1 | head -40
curl -sS -o /dev/null -w 'dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} ttfb=%{time_starttransfer} total=%{time_total}\n' https://example.com
curl --trace-time --trace - http://10.0.0.5:8080/debug 2>&1 | tail -30TTFB 高但 connect 低 = 服务端处理慢;connect 高 = 网络/连接队列问题;TLS 段高 = 握手慢。