Daily Archives: 2012 年 09 月 18 日

[Linux笔记]CURL性能优化

Leave a comment

很多时候使用CURL发现响应不够快,想优化。但是不知道到底是慢在哪里。下面这条命令就能帮你找到哪里慢,请自行把URL替换成需要测试的URL。

curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} http://www.meidahua.com

结果:

0.223:1.110:1.772

计时器 描述
time_connect 建立到服务器的 TCP 连接所用的时间
time_starttransfer 在发出请求之后,Web 服务器返回数据的第一个字节所用的时间
time_total 完成请求所用的时间 Continue reading