{"id":916,"date":"2009-12-07T23:55:34","date_gmt":"2009-12-08T04:55:34","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=916"},"modified":"2009-12-07T23:55:34","modified_gmt":"2009-12-08T04:55:34","slug":"quick-performance-site-test","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/","title":{"rendered":"Quick performance site test"},"content":{"rendered":"<p>time curl -s &#8220;http:\/\/g33kinfo.com?[1-1000]&#8221;     <\/p>\n<p>real\t0m0.017s<br \/>\nuser\t0m0.006s<br \/>\nsys\t0m0.006s<\/p>\n<p>and another one from bashcurescancer\/com <\/p>\n<pre style=\"border: 1px inset; margin: 0px; padding: 0px; overflow: auto; width:100%; height:25%;  text-align: left;\" dir=\"ltr\">\n #!\/bin\/bash\n# Author: see http:\/\/bashcurescancer.com\/improve-this-script-win-100-dollars.html\n# Modified and extended by \"Chris F.A. Johnson\" <cfajohnson @gmail.com>, 2007-02-25 \n# Web site: http:\/\/cfaj.freeshell.org\n\n## Features:\n##  Will use non-standard port if specified in URL\n##     (e.g., http:\/\/example.com:8080\/index.html)\n##  Checks for successful connection\n##  Moderately meaningful exit codes\n##  Parses headers for\n##     Successful request\n##     Content-Type\n##     Content-Length\n##     Transfer-Encoding: chunked (the reason for f19 before and 0 after HTML)\n##  Stores headers in shell array\n##  Command-line options:\n##     Save output to a file\n##     Save headers to a file\n##     Verbose output in various degrees\n##  Works in KornShell93 as well as bash\n\n## To do:\n##     Better usage function, including command-line options\n##     Automatically follow redirections (301, 302, 303)\n##     More selective verbosity\n##     Strip CRs from chunked encoded text\n##     Add From: line to request\n##     More comments\n\n## References:\n##   HTTP Made Really Easy:\n##      A Practical Guide to Writing Clients and Servers\n##      <http :\/\/www.jmarshall.com\/easy\/http\/#http1.1c2>\n\nhttpClient()\n{\n  local URL=$1\n  local type=\n  local HEADERS HOST RESOURCE PORT=$PORT\n\n  case $URL in\n      http:\/\/*) ;;\n      \"\") die \"$ERR_USAGE\" \"$USAGE\" ;;\n      *) die \"$ERR_URL\" \"$URL not a valid URL. Must start with http:\/\/\" ;;\n  esac\n\n  # Get the host\n  HOST=${URL#http:\/\/} ## Discard http:\/\/\n  case $HOST in\n      *\/*) RESOURCE=\/${HOST#*\/}       # Extract resource from URL\n           HOST=${HOST%\"$RESOURCE\"}\n           ;;\n      *) \n          ;;\n  esac\n  case $HOST in\n      *:*) PORT=${HOST##*:}\n           HOST=${HOST%:*}\n           ;;\n  esac\n\n  [ $verbose -gt 0 ] && {\n      echo \"HOST=$HOST\"\n      echo \"PORT=$PORT\"\n      echo \"RESOURCE=$RESOURCE\"\n  }\n\n  exec 3<> \/dev\/tcp\/$HOST\/$PORT       # Open connection\n  ERR=$?\n  [ \"$ERR\" -ne 0 ] && die \"$ERR_CONNECT\" \"Error $ERR: COULD NOT CONNECT\"\n\n  request >&3\n  [ $verbose -gt 2 ] && request >&2\n\n  ## Get headers\n  while :\n  do\n    IFS= read -r -u 3 -t ${TIMEOUT:=1} || die \"$ERR_HEADER\"\n    LINE=${REPLY%\"$CR\"}\n    [ $verbose -gt 0 ] && printf \"%s\\n\" \"$LINE\"\n    case $LINE in\n        \"\") break ;; ## end of headers\n        HTTP\/1.[01]*) ;;  ## Add redirection here\n        Transfer-Encoding:*chunked*) type=chunked ;;\n        Content-Length:*) length=${LINE#Content-Length: } ;;\n        Content-Type:*) type=$type${LINE#Content-Type: } ;;\n    esac\n    HEADERS[${#HEADERS[@]}]=$LINE  # Save headers, for no reason\n  done\n\n  ## Redirect stdout to file if specified\n  [ -n \"$outfile\" ] && {\n      exec > \"$outfile\" || die \"$ERR_WRITE\" \"Could not write to $outfile\"\n  }\n\n  ## Print body to stdout (assumes text)\n  [ $verbose -eq 2 ] && {\n      while IFS= read -u3 -r -t1 line\n      do\n        printf \"%s\\n\" \"${line%\"$CR\"}\"\n      done\n      exit\n  }\n\n  ## Get the body\n  case $type in\n      chunked*) while read_chunk; do :; done ;;\n      Text\/*)\n          while :\n          do\n            IFS= read -r -u 3 -t \"$TIMEOUT\" ||   # read from server\n            die \"$ERR_TIMEOUT\" \"Server timed out\"\n            printf \"%s\\n\" \"${REPLY%$CR}\"   # Eliminate \\r, we are using UNIX\n          done\n          ;;\n      *) dd bs=$length count=1 < &#038;3 2>\/dev\/null ;;\n  esac\n\n  exec 3< &#038;-\n}\n\nrequest()\n{\n    printf \"GET %s HTTP\/1.1\\r\\n\" \"${RESOURCE:-\/}\"  # Request resource, only care about gets.\n    printf \"host: %s:%d\\r\\n\" \"$HOST\" \"$PORT\"       # Send host header, what about encoding?\n    printf \"User-agent: %s %s\\r\\n\" \"$progname\" \"$version\" # Send user agent\n    printf \"\\r\\n\"                                  # End request\n}\n\nread_chunk()\n{\n  IFS= read -r -t1 num\n  num=${num%%[!0-9a-fA-F]*}\n  case $num in\n      \"\") return 0 ;;\n  esac\n  size=$( printf \"%d\\n\" \"0x${num#0[xX]}\" )\n  [ $verbose -gt 2 ] &#038;&#038; printf \"CHUNK SIZE: %d (%s)\\n\" \"$size\" \"$num\" >&2\n  [ \"$size\" -eq 0 ] && return 1\n  dd bs=$size count=1 2>\/dev\/null\n} < &#038;3\n\ndie() {\n    result=$1\n    shift\n    [ -n \"$*\" ] &#038;&#038; printf \"%s\\n\" \"$*\" >&2\n    exec 3< &#038;-\n\n    [ -n \"$headerfile\" ] &#038;&#038; printf \"%s\\n\" \"${HEADERS[@]}\" > \"$headerfile\"\n    exit $result\n}\n\nCR=$'\\r'\nNL=$'\\n'\nprogname=${0##*\/}\nversion=0.1\nUSAGE=\"Usage: $progname [OPTIONS] http:\/\/URL\"\nERR_USAGE=1\nERR_URL=2\nERR_CONNECT=3\nERR_REQUEST=4\nERR_HEADER=5\nERR_TIMEOUT=6\nERR_WRITE=7\n\nPORT=80\nheaderfile=\noutfile=\nverbose=0\n\n## Save options (for future redirection)\nCOMMAND_LINE=( \"$@\" )\n\nwhile getopts h:o:v opt\ndo\n  case $opt in\n      h) headerfile=$OPTARG ;;\n      o) outfile=$OPTARG ;;\n      v) verbose=$(( $verbose + 1 )) ;;\n  esac\ndone\nshift \"$(( $OPTIND - 1 ))\"\n\nhttpClient \"$@\"\n\n[ -n \"$headerfile\" ] && printf \"%s\\n\" \"${HEADERS[@]}\" > \"$headerfile\"\n\n<\/http><\/cfajohnson><\/pre>\n<p>\nreturns;<\/p>\n<p>real\t0m0.040s<br \/>\nuser\t0m0.005s<br \/>\nsys\t0m0.008s<\/p>\n<p>same as above&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>time curl -s &#8220;http:\/\/g33kinfo.com?[1-1000]&#8221; real 0m0.017s user 0m0.006s sys 0m0.006s and another one from bashcurescancer\/com #!\/bin\/bash # Author: see http:\/\/bashcurescancer.com\/improve-this-script-win-100-dollars.html # Modified and extended by &#8220;Chris F.A. Johnson&#8221; , 2007-02-25 # Web site: http:\/\/cfaj.freeshell.org ## Features: ## Will use non-standard port if specified in URL ## (e.g., http:\/\/example.com:8080\/index.html) ## Checks for successful connection ## Moderately&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-916","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Quick performance site test - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quick performance site test - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"time curl -s &#8220;http:\/\/g33kinfo.com?[1-1000]&#8221; real 0m0.017s user 0m0.006s sys 0m0.006s and another one from bashcurescancer\/com #!\/bin\/bash # Author: see http:\/\/bashcurescancer.com\/improve-this-script-win-100-dollars.html # Modified and extended by &quot;Chris F.A. Johnson&quot; , 2007-02-25 # Web site: http:\/\/cfaj.freeshell.org ## Features: ## Will use non-standard port if specified in URL ## (e.g., http:\/\/example.com:8080\/index.html) ## Checks for successful connection ## Moderately... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2009-12-08T04:55:34+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Quick performance site test\",\"datePublished\":\"2009-12-08T04:55:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/\"},\"wordCount\":40,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/\",\"name\":\"Quick performance site test - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2009-12-08T04:55:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/quick-performance-site-test\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quick performance site test\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quick performance site test - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/","og_locale":"en_US","og_type":"article","og_title":"Quick performance site test - Linux Shtuff","og_description":"time curl -s &#8220;http:\/\/g33kinfo.com?[1-1000]&#8221; real 0m0.017s user 0m0.006s sys 0m0.006s and another one from bashcurescancer\/com #!\/bin\/bash # Author: see http:\/\/bashcurescancer.com\/improve-this-script-win-100-dollars.html # Modified and extended by \"Chris F.A. Johnson\" , 2007-02-25 # Web site: http:\/\/cfaj.freeshell.org ## Features: ## Will use non-standard port if specified in URL ## (e.g., http:\/\/example.com:8080\/index.html) ## Checks for successful connection ## Moderately... Read More","og_url":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2009-12-08T04:55:34+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Quick performance site test","datePublished":"2009-12-08T04:55:34+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/"},"wordCount":40,"commentCount":0,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/","url":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/","name":"Quick performance site test - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2009-12-08T04:55:34+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/quick-performance-site-test\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Quick performance site test"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/916","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=916"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/916\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=916"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=916"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=916"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}