{"id":11703,"date":"2019-03-15T22:51:59","date_gmt":"2019-03-15T22:51:59","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11703"},"modified":"2019-03-15T22:51:59","modified_gmt":"2019-03-15T22:51:59","slug":"httpstat-a-curl-statistics-tool-to-check-website-performance","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/httpstat-a-curl-statistics-tool-to-check-website-performance\/","title":{"rendered":"httpstat \u2013 A Curl Statistics Tool to Check Website Performance"},"content":{"rendered":"<p><strong>httpstat<\/strong>\u00a0is a Python script that reflects curl statistics in a fascinating and well-defined way, it is a single file which is compatible with Python 3 and requires no additional software (dependencies) to be installed on a users system.<\/p>\n<p>It is fundamentally a wrapper of cURL tool, means that you can use several valid cURL options after a URL(s), excluding the options\u00a0<strong>-w<\/strong>,\u00a0<strong>-D<\/strong>,\u00a0<strong>-o<\/strong>,\u00a0<strong>-s<\/strong>, and\u00a0<strong>-S<\/strong>, which are already employed by\u00a0<strong>httpstat<\/strong>.<\/p>\n<div id=\"attachment_23669\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Curl-Statistics-Tool.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23669\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Curl-Statistics-Tool.png\" alt=\"httpstat Curl Statistics Tool \" width=\"720\" height=\"340\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">httpstat Curl Statistics Tool<\/p>\n<\/div>\n<p>You can see in the above image an\u00a0<strong>ASCII<\/strong>\u00a0table displaying how long each process took, and for me the most important step is\u00a0<strong>\u201cserver processing\u201d<\/strong>\u00a0\u2013 if this number is higher, then you need to\u00a0<a href=\"https:\/\/www.tecmint.com\/apache-performance-tuning\/\" target=\"_blank\" rel=\"noopener\">tune your server to speed up website<\/a>.<\/p>\n<p>For website or server tuning you can check our articles here:<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/apache-performance-tuning\/\" target=\"_blank\" rel=\"noopener\">5 Tips to Tune Performance of Apache Web Server<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/install-mod_pagespeed-to-boost-apache-nginx-performance\/\" target=\"_blank\" rel=\"noopener\">Speed Up Apache and Nginx Performance Upto 10x<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/increase-nginx-performance-enable-gzip-compression-module\/\" target=\"_blank\" rel=\"noopener\">How to Boost Nginx Performance Using Gzip Module<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/mysql-mariadb-performance-tuning-and-optimization\/\" target=\"_blank\" rel=\"noopener\">15 Tips to Tune MySQL\/MariaDB Performance<\/a><\/li>\n<\/ol>\n<p>Grab\u00a0<strong>httpstat<\/strong>\u00a0to check out your website speed using following instillation instructions and usage.<\/p>\n<h3>Install httpstat in Linux Systems<\/h3>\n<p>You can install\u00a0<strong>httpstat<\/strong>\u00a0utility using two possible methods:<\/p>\n<p><strong>1.<\/strong>\u00a0Get it directly from its Github repo using the\u00a0<a href=\"https:\/\/www.tecmint.com\/10-wget-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">wget command<\/a>\u00a0as follows:<\/p>\n<pre>$ wget -c https:\/\/raw.githubusercontent.com\/reorx\/httpstat\/master\/httpstat.py\r\n<\/pre>\n<p><strong>2.<\/strong>\u00a0Using\u00a0<strong>pip<\/strong>\u00a0(this method allows\u00a0<strong>httpstat<\/strong>\u00a0to be installed on your system as a command) like so:<\/p>\n<pre>$ sudo pip install httpstat\r\n<\/pre>\n<p>Note: Make sure\u00a0<strong>pip<\/strong>\u00a0package installed on the system, if not install it using your distribution package manager\u00a0<a href=\"https:\/\/www.tecmint.com\/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement\/\" target=\"_blank\" rel=\"noopener\">yum<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.tecmint.com\/apt-advanced-package-command-examples-in-ubuntu\/\" target=\"_blank\" rel=\"noopener\">apt<\/a>.<\/p>\n<h3>How to Use httpstat in Linux<\/h3>\n<p><strong>httpstat<\/strong>\u00a0can be used according to the way you installed it, if you directly downloaded it, run it using the following syntax from within the download directory:<\/p>\n<pre>$ python httpstat.py url cURL_options \r\n<\/pre>\n<p>In case you used\u00a0<strong>pip<\/strong>\u00a0to install it, you can execute it as a command in the form below:<\/p>\n<pre>$ httpstat url cURL_options  \r\n<\/pre>\n<p>To view the help page for\u00a0<strong>httpstat<\/strong>, issue the command below:<\/p>\n<pre>$ python httpstat.py --help\r\nOR\r\n$ httpstat --help\r\n<\/pre>\n<div class=\"code-label\">httpstat help<\/div>\n<pre>Usage: httpstat URL [CURL_OPTIONS]\r\n       httpstat -h | --help\r\n       httpstat --version\r\n\r\nArguments:\r\n  URL     url to request, could be with or without `http(s):\/\/` prefix\r\n\r\nOptions:\r\n  CURL_OPTIONS  any curl supported options, except for -w -D -o -S -s,\r\n                which are already used internally.\r\n  -h --help     show this screen.\r\n  --version     show version.\r\n\r\nEnvironments:\r\n  HTTPSTAT_SHOW_BODY    Set to `true` to show response body in the output,\r\n                        note that body length is limited to 1023 bytes, will be\r\n                        truncated if exceeds. Default is `false`.\r\n  HTTPSTAT_SHOW_IP      By default httpstat shows remote and local IP\/port address.\r\n                        Set to `false` to disable this feature. Default is `true`.\r\n  HTTPSTAT_SHOW_SPEED   Set to `true` to show download and upload speed.\r\n                        Default is `false`.\r\n  HTTPSTAT_SAVE_BODY    By default httpstat stores body in a tmp file,\r\n                        set to `false` to disable this feature. Default is `true`\r\n  HTTPSTAT_CURL_BIN     Indicate the curl bin path to use. Default is `curl`\r\n                        from current shell $PATH.\r\n  HTTPSTAT_DEBUG        Set to `true` to see debugging logs. Default is `false`\r\n<\/pre>\n<p>From the output of the help command above, you can see that\u00a0<strong>httpstat<\/strong>\u00a0has a collection of useful environmental variables that influence its behavior.<\/p>\n<p>To use them, simply export the variables with the appropriate value in the\u00a0<code>.bashrc<\/code>\u00a0or\u00a0<code>.zshrc<\/code>\u00a0file.<\/p>\n<p>For instance:<\/p>\n<pre>export  HTTPSTAT_SHOW_IP=false\r\nexport  HTTPSTAT_SHOW_SPEED=true\r\nexport  HTTPSTAT_SAVE_BODY=false\r\nexport  HTTPSTAT_DEBUG=true\r\n<\/pre>\n<p>Once your are done adding them, save the file and run the command below to effect the changes:<\/p>\n<pre>$ source  ~\/.bashrc\r\n<\/pre>\n<p>You can as well specify the cURL binary path to use, the default is curl from current shell\u00a0<a href=\"https:\/\/www.tecmint.com\/set-unset-environment-variables-in-linux\/\" target=\"_blank\" rel=\"noopener\">$PATH environmental variable<\/a>.<\/p>\n<p>Below are a few examples showing how\u00a0<strong>httpsat<\/strong>\u00a0works.<\/p>\n<pre>$ python httpstat.py google.com\r\nOR\r\n$ httpstat google.com\r\n<\/pre>\n<div id=\"attachment_23670\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23670\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-768x414.png 768w\" alt=\"httpstat - Showing Website Statistics\" width=\"802\" height=\"432\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">httpstat \u2013 Showing Website Statistics<\/p>\n<\/div>\n<p>In the next command:<\/p>\n<ol>\n<li><code>-x<\/code>\u00a0command flag specifies a custom request method to use while communicating with the HTTP server.<\/li>\n<li><code>--data-urlencode<\/code>\u00a0data posts data (a=b in this case) with URL-encoding turned on.<\/li>\n<li><code>-v<\/code>\u00a0enables a verbose mode.<\/li>\n<\/ol>\n<pre>$ python httpstat.py httpbin.org\/post -X POST --data-urlencode \"a=b\" -v \r\n<\/pre>\n<div id=\"attachment_23671\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Post-Request.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23671\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Post-Request.png\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Post-Request.png 882w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2016\/12\/httpstat-Post-Request-768x711.png 768w\" alt=\"httpstat - Custom Post Request\" width=\"882\" height=\"816\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">httpstat \u2013 Custom Post Request<\/p>\n<\/div>\n<p>You can look through the cURL man page for more useful and advanced options or visit the\u00a0<strong>httpstat<\/strong>\u00a0Github repository:\u00a0<a href=\"https:\/\/github.com\/reorx\/httpstat\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/github.com\/reorx\/httpstat<\/a><\/p>\n<p>In this article, we have covered a useful tool for monitoring cURL statistics is a simple and clear way. If you know of any such tools out there, do not hesitate to let us know and you can as well ask a question or make a comment about this article or httpstat via the feedback section below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/httpstat-curl-statistics-tool-check-website-performance\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>httpstat\u00a0is a Python script that reflects curl statistics in a fascinating and well-defined way, it is a single file which is compatible with Python 3 and requires no additional software (dependencies) to be installed on a users system. It is fundamentally a wrapper of cURL tool, means that you can use several valid cURL options &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/15\/httpstat-a-curl-statistics-tool-to-check-website-performance\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;httpstat \u2013 A Curl Statistics Tool to Check Website Performance&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11703","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11703"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11703\/revisions"}],"predecessor-version":[{"id":11704,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11703\/revisions\/11704"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}