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

时间指标解释 :

time_connect    建立到服务器的 TCP 连接所用的时间

time_starttransfer    在发出请求之后,Web 服务器返回数据的第一个字节所用的时间

The time, in seconds, it took from the start
until the first byte was just about to be trans-
ferred. This includes time_pretransfer and also
the time the server needed to calculate the
result

time_total   完成请求所用的时间

在 发出请求之后,Web 服务器处理请求并开始发回数据所用的时间是

(time_starttransfer)1.044 - (time_connect)0.244 = 0.8 秒

客户机从服务器下载数据所用的时间是

(time_total)2.672 - (time_starttransfer)1.044 = 1.682 秒

指定特定主机IP地址访问网站

curl -x 58.214.7.150:80 http://www.baidu.com

curl -x 58.214.7.150:80 http://www.baidu.com

curl用法大全

-x 指定访问IP与端口号

curl -x 192.168.1.1:80  http://www.miotour.com

-I 仅仅取文件的http头部

curl   -I  -x 192.168.1.1:80  http://www.miotour.com

用referer做的防盗链,就可以使用-e来设置

curl -e “http://www.qiecuo.org”    http:// www.miotour.com -v  -I

-H去构造你想要的http头部

curl -H “X-Forward-For:8.8.8.8″ http://www.miotour.com  -v  -I

curl反馈时间,例如连接时间,下载时间等信息

curl -w %{time_connect}:%{time_starttransfer}:%{time_total} -s -o /dev/null

将一个文件保存到硬盘上,命名为file.html

curl -o file.html  http://www.miotour.com/index.html

下载index.html文件, -O是大写的字母

curl -O http://www.miotour.com/index.html

curl提交用户名和密码

curl http://name:passwd@www.miotour.com
curl -u name:passwd http://www.miotour.com

-b “cookie” 此参数用来构造一个携带cookie的请求

CURL访问url显示响应时间的更多相关文章

  1. 在linux下使用curl访问 多参数url GET参数问题

    一.在Crontab中使用PHP执行脚本 就像在Crontab中调用普通的shell脚本一样(具体Crontab用法),使用PHP程序来调用PHP脚本.每一小时执行myscript.php如下: # ...

  2. Linux查看进程,端口,访问url

    # 查看进程# ps -ef|grep python# 终止进程# kill -9 id # 端口 netstat -ntl # 显示正在监听的tcp端口,以端口号显示 netstat -apn|gr ...

  3. php访问url(get和post请求)

    get请求 /* * php访问url路径,get请求 */ function curl_file_get_contents($durl){ // header传送格式 $headers = arra ...

  4. LB层到Real Server之间访问请求的响应时间及HTTP状态码监控及报警设置

    为了监控到各业务的访问质量,基于LB层的Nginx日志,实现LB层到Real Server之间访问请求的响应时间(即upstream_response_time)及HTTP状态码(即upstream_ ...

  5. linux 下使用 curl 访问带多参数,GET掉参数解决方案

    url 为 http://mywebsite.com/index.php?a=1&b=2&c=3 web形式下访问url地址,使用 $_GET是可以获取到所有的参数 curl  -s  ...

  6. SpringCloud-Config通过Java访问URL对敏感词加密解密

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  7. Django项目:CRM(客户关系管理系统)--84--74PerfectCRM实现CRM权限和权限组限制访问URL

    #models.py # ————————01PerfectCRM基本配置ADMIN———————— from django.db import models # Create your models ...

  8. php取得当前访问url文件名的几种方法

    php下获取当前访问的文件名的几种方法.推荐函数:一是PHP获取当前页面的网址: dedecms用的也是这个哦. <?php //获得当前的脚本网址 function GetCurUrl() { ...

  9. 利用javascript Location访问Url,重定向,刷新页面

    网上转来了, 方便以后查询参考 本文介绍怎么使用javascript Location对象读和修改Url.怎么重载或刷新页面.javascript提供了许多方法访问,修改当前用户在浏览器中访问的url ...

随机推荐

  1. flex flashplayer 程序 和 air 程序 通过 LocalConnection 通信

    flashplayer 做控制端: <?xml version="1.0" encoding="utf-8"?> <s:Application ...

  2. do{...}while(0)的意义和用法(转载)

    linux内核和其他一些开源的代码中,经常会遇到这样的代码: do{ ... }while(0) 这样的代码一看就不是一个循环,do..while表面上在这里一点意义都没有,那么为什么要这么用呢? 实 ...

  3. asp.net时间范围查询

    1.首先要查询类表中的一个时间段,要明确我的数据库中只有一个时间字段,我们先将他拆分一下. if ($("#news_OpenTime").val() != "" ...

  4. sharepoint 2013基于AD的Form表单登录(三)——选择用户时,屏蔽掉AD。

    //来源:http://www.cnblogs.com/lrforever/p/3695820.html 隐藏AD人员选择,$ad.IsVisible设置为true,则显示出AD里用户 $cpm = ...

  5. CMake如何执行shell命令

    我在cmake编译后想执行一些特定的shell命令(执行.lcov收集代码覆盖报告等),我又不想写到XX.sh的shell脚本中,如何直接通过CMake执行shell命令呢? 在网上翻江倒海了一下,找 ...

  6. ansible尝试

    1.下载软件 http://releases.ansible.com/ansible/ 2.软件安装 [root@Yangjian-VM02-241 ansible-stable-2.0.0.1]# ...

  7. A. Alyona and Numbers(CF ROUND 358 DIV2)

    A. Alyona and Numbers time limit per test 1 second memory limit per test 256 megabytes input standar ...

  8. mac搭建cordova的android环境

    搭建步骤: 1,下载cordova-android解压到自己目录 2,安装node.js:下载地址:http://nodejs.org/,解压按步骤安装即可,检测在终端输入:#npm 3,安装dos2 ...

  9. 网络最大流最短增广路Dinic算法模板

    #include<cstdio> #include<cstring> #include<string> #include<cmath> #include ...

  10. mvn 如何添加本地jar包 IDEA pom.xm

    -------------背景介绍------------------------------------ 最近做的项目,就是office在线浏览功能, 使用的是openoffice+jodconve ...